Changes in the protocol

This commit is contained in:
nsubiron 2017-03-16 18:53:15 +01:00
parent 518f276633
commit 87f97e666e
4 changed files with 15 additions and 16 deletions

View File

@ -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"));

View File

@ -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<Color> &image : images) {
std::vector<unsigned char> 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<Color> &image : depths) {
std::vector<unsigned char> 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<Color> &image : depths) {
// std::vector<unsigned char> 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) {

View File

@ -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() {

View File

@ -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;
}