From 8ead5d0b2c03ebc68480379db327cf438dfecf6f Mon Sep 17 00:00:00 2001 From: Xisco Bosch Date: Wed, 5 Apr 2017 16:08:17 +0200 Subject: [PATCH] repeated image and depth --- Source/CarlaServer/source/carla/server/Protocol.cpp | 6 ++++-- Source/CarlaServer/source/carla/server/carla_protocol.proto | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/CarlaServer/source/carla/server/Protocol.cpp b/Source/CarlaServer/source/carla/server/Protocol.cpp index 0d923547d..d87c4d785 100644 --- a/Source/CarlaServer/source/carla/server/Protocol.cpp +++ b/Source/CarlaServer/source/carla/server/Protocol.cpp @@ -46,11 +46,13 @@ namespace server { tjCompress2(jpegCompressor, color_image.data(), width, 0, height, TJPF_RGB, &compressedImage, &jpegSize, TJSAMP_444, jpeg_quality, TJFLAG_FASTDCT); tjDestroy(jpegCompressor); + if (!depth) { - rwd.set_image(compressedImage, jpegSize); + rwd.add_image((char*)compressedImage); } else { - rwd.set_depth(compressedImage, jpegSize); + rwd.add_depth((char*)compressedImage); } + return true; } diff --git a/Source/CarlaServer/source/carla/server/carla_protocol.proto b/Source/CarlaServer/source/carla/server/carla_protocol.proto index 75cb93621..bf3d82003 100644 --- a/Source/CarlaServer/source/carla/server/carla_protocol.proto +++ b/Source/CarlaServer/source/carla/server/carla_protocol.proto @@ -100,6 +100,6 @@ message Reward { optional float ori_x = 13; optional float ori_y = 14; optional float ori_z = 15; - optional bytes image = 16; - optional bytes depth = 17; + repeated bytes image = 16; + repeated bytes depth = 17; }