From edb4594ef5656ac215cd45d80a48faa907448ce9 Mon Sep 17 00:00:00 2001 From: nsubiron Date: Tue, 25 Apr 2017 18:30:30 +0200 Subject: [PATCH] Fix #14 --- Source/Carla/Game/CarlaGameController.cpp | 3 ++- Source/CarlaServer/source/carla/CarlaServer.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Carla/Game/CarlaGameController.cpp b/Source/Carla/Game/CarlaGameController.cpp index 42b7639b6..8b15ffce1 100644 --- a/Source/Carla/Game/CarlaGameController.cpp +++ b/Source/Carla/Game/CarlaGameController.cpp @@ -131,7 +131,8 @@ static bool SendReward( const ACarlaPlayerState &PlayerState) { auto reward = std::make_unique(); - reward->timestamp = PlayerState.GetPlatformTimeStamp(); + reward->platform_timestamp = PlayerState.GetPlatformTimeStamp(); + reward->game_timestamp = PlayerState.GetGameTimeStamp(); Set(reward->player_location, PlayerState.GetLocation()); Set(reward->player_orientation, PlayerState.GetOrientation()); Set(reward->player_acceleration, PlayerState.GetAcceleration()); diff --git a/Source/CarlaServer/source/carla/CarlaServer.h b/Source/CarlaServer/source/carla/CarlaServer.h index 5ff850737..52af5aa40 100644 --- a/Source/CarlaServer/source/carla/CarlaServer.h +++ b/Source/CarlaServer/source/carla/CarlaServer.h @@ -43,8 +43,10 @@ namespace carla { struct Reward_Values { Reward_Values(); ~Reward_Values(); - /// Time-stamp of the current frame. + /// Time-stamp of the current frame, in milliseconds as given by the OS. int32_t platform_timestamp; + /// In-game time-stamp, milliseconds elapsed since the beginning of the + /// current level. int32_t game_timestamp; /// World location of the player. Vector2D player_location;