diff --git a/Source/Carla/Game/CarlaGameController.cpp b/Source/Carla/Game/CarlaGameController.cpp index 7f999cd3e..866cb8e51 100644 --- a/Source/Carla/Game/CarlaGameController.cpp +++ b/Source/Carla/Game/CarlaGameController.cpp @@ -108,7 +108,7 @@ static void SendReward( reward.image_height = Cameras[0u]->GetImageSizeY(); } Set(reward.image_rgb_0, Cameras[0u]); - Set(reward.image_rgb_1, Cameras[1u]); + // Set(reward.image_rgb_1, Cameras[1u]); // Set(reward.image_depth_0, ); // Set(reward.image_depth_1, ); UE_LOG(LogCarla, Log, TEXT("Send reward")); diff --git a/Source/CarlaServer/source/carla/server/Protocol.cpp b/Source/CarlaServer/source/carla/server/Protocol.cpp index f42d1c068..4c43b4571 100644 --- a/Source/CarlaServer/source/carla/server/Protocol.cpp +++ b/Source/CarlaServer/source/carla/server/Protocol.cpp @@ -63,21 +63,21 @@ namespace server { reward.set_speed(values.forward_speed); reward.set_timestamp(values.timestamp); - auto images = {values.image_rgb_0, values.image_rgb_1}; + auto images = {values.image_rgb_0/*, values.image_rgb_1*/}; for (const std::vector &image : images) { std::vector png_image; if (getPNGImage(image, values.image_width, values.image_height, png_image)) { - reward.add_image(std::string(png_image.begin(), png_image.end())); + reward.set_image(std::string(png_image.begin(), png_image.end())); } } - auto depths = {values.image_depth_0, values.image_depth_1}; - for (const std::vector &image : depths) { - std::vector png_image; - if (getPNGImage(image, values.image_width, values.image_height, png_image)) { - reward.add_depth(std::string(png_image.begin(), png_image.end())); - } - } + // auto depths = {values.image_depth_0, values.image_depth_1}; + // for (const std::vector &image : depths) { + // std::vector png_image; + // if (getPNGImage(image, values.image_width, values.image_height, png_image)) { + // reward.add_depth(std::string(png_image.begin(), png_image.end())); + // } + // } } void Protocol::LoadScene(Scene &scene, const Scene_Values &values) { diff --git a/Source/CarlaServer/source/carla/server/Server.cpp b/Source/CarlaServer/source/carla/server/Server.cpp index b5a1881f3..2c4089450 100644 --- a/Source/CarlaServer/source/carla/server/Server.cpp +++ b/Source/CarlaServer/source/carla/server/Server.cpp @@ -35,9 +35,9 @@ namespace server { } void Server::sendSceneValues(const Scene_Values &values) { - Scene scene; - _proto->LoadScene(scene, values); - _communication->sendScene(scene); + Scene *scene = new Scene; + _proto->LoadScene(*scene, values); + _communication->sendScene(*scene); } void Server::sendEndReset() { diff --git a/Source/CarlaServer/source/carla/server/carla_protocol.proto b/Source/CarlaServer/source/carla/server/carla_protocol.proto index 151a9917f..3d7165608 100644 --- a/Source/CarlaServer/source/carla/server/carla_protocol.proto +++ b/Source/CarlaServer/source/carla/server/carla_protocol.proto @@ -1,4 +1,3 @@ -syntax = "proto2"; // Client Messages message EpisodeStart { @@ -90,6 +89,6 @@ message Reward { optional float ori_x = 13; optional float ori_y = 14; optional float ori_z = 15; - repeated bytes image = 16; - repeated bytes depth = 17; + optional bytes image = 16; + optional bytes depth = 17; }