diff --git a/Source/CarlaServer/source/carla/CarlaServer.h b/Source/CarlaServer/source/carla/CarlaServer.h index 6b9fef1ee..5ff850737 100644 --- a/Source/CarlaServer/source/carla/CarlaServer.h +++ b/Source/CarlaServer/source/carla/CarlaServer.h @@ -44,7 +44,8 @@ namespace carla { Reward_Values(); ~Reward_Values(); /// Time-stamp of the current frame. - int32_t timestamp; + int32_t platform_timestamp; + int32_t game_timestamp; /// World location of the player. Vector2D player_location; /// Orientation of the player. diff --git a/Source/CarlaServer/source/carla/server/Protocol.cpp b/Source/CarlaServer/source/carla/server/Protocol.cpp index 51aa098b2..095bcb911 100644 --- a/Source/CarlaServer/source/carla/server/Protocol.cpp +++ b/Source/CarlaServer/source/carla/server/Protocol.cpp @@ -264,7 +264,8 @@ static bool getPNGImages(const std::vector &images, Reward &rwd){ reward.set_player_y(values.player_location.y); reward.set_player_x(values.player_location.x); reward.set_speed(values.forward_speed); - reward.set_timestamp(values.timestamp); + reward.set_platform_timestamp(values.platform_timestamp); + reward.set_game_timestamp(values.game_timestamp); #ifdef WITH_TURBOJPEG diff --git a/Source/CarlaServer/source/carla/server/carla_protocol.proto b/Source/CarlaServer/source/carla/server/carla_protocol.proto index 44b8d01f6..103816d69 100644 --- a/Source/CarlaServer/source/carla/server/carla_protocol.proto +++ b/Source/CarlaServer/source/carla/server/carla_protocol.proto @@ -78,13 +78,14 @@ message Reward { optional float acceleration_x = 9; optional float acceleration_y = 10; optional float acceleration_z = 11; - optional int32 timestamp = 12; - optional float ori_x = 13; - optional float ori_y = 14; - optional float ori_z = 15; - optional bytes image_sizes = 16; - optional bytes depth_sizes = 17; - optional bytes images = 18; - optional bytes depths = 19; + optional int32 platform_timestamp = 12; + optional int32 game_timestamp = 13; + optional float ori_x = 14; + optional float ori_y = 15; + optional float ori_z = 16; + optional bytes image_sizes = 17; + optional bytes depth_sizes = 18; + optional bytes images = 19; + optional bytes depths = 20; } diff --git a/Source/CarlaServer/source/test/async_server.cpp b/Source/CarlaServer/source/test/async_server.cpp index c3b4c7cac..c029d7958 100644 --- a/Source/CarlaServer/source/test/async_server.cpp +++ b/Source/CarlaServer/source/test/async_server.cpp @@ -58,6 +58,7 @@ std::unique_ptr makeReward() { reward->collision_car = 10.0f; reward->intersect_other_lane = 0.5f; reward->intersect_offroad = 0.5f; + reward->game_timestamp = 0u; for (int i = 0; i < 4; ++i) { carla::Image img; @@ -74,8 +75,9 @@ std::unique_ptr makeReward() { reward->image_depth_0 = makeImage(imageWidth, imageHeight); reward->image_depth_1 = makeImage(imageWidth, imageHeight); */ - static decltype(carla::Reward_Values::timestamp) timestamp = 0u; - reward->timestamp = timestamp++; + static decltype(carla::Reward_Values::platform_timestamp) timestamp = 0u; + + reward->platform_timestamp = timestamp++; return reward; }