Skip to content

Commit d96d80a

Browse files
Merge pull request #219 from FS-Online/fix-218
Fix go signal timestamps …
2 parents b8dd493 + 2217cae commit d96d80a

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

ros/src/fsds_ros_bridge/include/airsim_ros_wrapper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ class AirsimROSWrapper
172172
std::string mission_name_; // rosparam obtained from launch file
173173
std::string track_name_; // rosparam obtained from launch file
174174
bool competition_mode_;
175+
ros::Time go_timestamp_;
175176

176177
msr::airlib::CarRpcLibClient airsim_client_;
177178
msr::airlib::CarRpcLibClient airsim_client_lidar_;

ros/src/fsds_ros_bridge/src/airsim_ros_wrapper.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ void AirsimROSWrapper::initialize_ros()
141141

142142
statistics_timer_ = nh_private_.createTimer(ros::Duration(1), &AirsimROSWrapper::statistics_timer_cb, this);
143143
go_signal_timer_ = nh_private_.createTimer(ros::Duration(1), &AirsimROSWrapper::go_signal_timer_cb, this);
144+
go_timestamp_ = ros::Time::now();
144145

145146
airsim_client_.enableApiControl(!manual_mode, vehicle_name);
146147
airsim_client_.armDisarm(true, vehicle_name);
@@ -792,6 +793,7 @@ void AirsimROSWrapper::statistics_timer_cb(const ros::TimerEvent &event)
792793
void AirsimROSWrapper::go_signal_timer_cb(const ros::TimerEvent &event)
793794
{
794795
fs_msgs::GoSignal go_signal_msg;
796+
go_signal_msg.header.stamp = go_timestamp_;
795797
go_signal_msg.mission = mission_name_;
796798
go_signal_msg.track = track_name_;
797799
go_signal_pub_.publish(go_signal_msg);

0 commit comments

Comments
 (0)