From 64b5969993a12a3d6229b550358b6622f8e7d203 Mon Sep 17 00:00:00 2001 From: Rajat Singhal Date: Tue, 30 Jun 2020 10:26:36 +0530 Subject: [PATCH] Remove workaround for empty struct in RPC --- AirLib/include/api/RpcLibAdapatorsBase.hpp | 11 ----------- AirLib/src/api/RpcLibServerBase.cpp | 7 +------ 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/AirLib/include/api/RpcLibAdapatorsBase.hpp b/AirLib/include/api/RpcLibAdapatorsBase.hpp index 2295d75710..2e40a17197 100644 --- a/AirLib/include/api/RpcLibAdapatorsBase.hpp +++ b/AirLib/include/api/RpcLibAdapatorsBase.hpp @@ -405,12 +405,6 @@ class RpcLibAdapatorsBase { image_data_uint8 = s.image_data_uint8; image_data_float = s.image_data_float; - //TODO: remove bug workaround for https://github.com/rpclib/rpclib/issues/152 - if (image_data_uint8.size() == 0) - image_data_uint8.push_back(0); - if (image_data_float.size() == 0) - image_data_float.push_back(0); - camera_name = s.camera_name; camera_position = Vector3r(s.camera_position); camera_orientation = Quaternionr(s.camera_orientation); @@ -481,11 +475,6 @@ class RpcLibAdapatorsBase { { time_stamp = s.time_stamp; point_cloud = s.point_cloud; - - //TODO: remove bug workaround for https://github.com/rpclib/rpclib/issues/152 - if (point_cloud.size() == 0) - point_cloud.push_back(0); - pose = s.pose; } diff --git a/AirLib/src/api/RpcLibServerBase.cpp b/AirLib/src/api/RpcLibServerBase.cpp index 2cb514e0de..6c3b922b16 100644 --- a/AirLib/src/api/RpcLibServerBase.cpp +++ b/AirLib/src/api/RpcLibServerBase.cpp @@ -128,12 +128,7 @@ RpcLibServerBase::RpcLibServerBase(ApiProvider* api_provider, const std::string& return RpcLibAdapatorsBase::ImageResponse::from(response); }); pimpl_->server.bind("simGetImage", [&](const std::string& camera_name, ImageCaptureBase::ImageType type, const std::string& vehicle_name) -> vector { - auto result = getVehicleSimApi(vehicle_name)->getImage(camera_name, type); - if (result.size() == 0) { - // rpclib has a bug with serializing empty vectors, so we return a 1 byte vector instead. - result.push_back(0); - } - return result; + return getVehicleSimApi(vehicle_name)->getImage(camera_name, type); }); pimpl_->server.bind("simGetMeshPositionVertexBuffers", [&]() ->vector {