Skip to content

Commit

Permalink
Simulation: returned back the missing global position groundtruth tim…
Browse files Browse the repository at this point in the history
…estamp
  • Loading branch information
Ilia-Loginov authored and haitomatic committed Nov 27, 2024
1 parent 4b6bc29 commit e902047
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/modules/mavlink/mavlink_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2349,6 +2349,7 @@ MavlinkReceiver::handle_message_hil_gps(mavlink_message_t *msg)
// Publish GPS groundtruth
vehicle_global_position_s hil_global_position_groundtruth{};
hil_global_position_groundtruth.timestamp_sample = hrt_absolute_time();
hil_global_position_groundtruth.timestamp = hrt_absolute_time();
hil_global_position_groundtruth.lat = hil_gps.lat / 1e7;
hil_global_position_groundtruth.lon = hil_gps.lon / 1e7;
hil_global_position_groundtruth.alt = hil_gps.alt / 1e3f;
Expand Down
2 changes: 2 additions & 0 deletions src/modules/simulation/gz_bridge/GZBridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,10 @@ void GZBridge::navSatCallback(const gz::msgs::NavSat &nav_sat)
vehicle_global_position_s global_position_groundtruth{};
#if defined(ENABLE_LOCKSTEP_SCHEDULER)
global_position_groundtruth.timestamp_sample = time_us;
global_position_groundtruth.timestamp = time_us;
#else
global_position_groundtruth.timestamp_sample = hrt_absolute_time();
global_position_groundtruth.timestamp = hrt_absolute_time();
#endif
global_position_groundtruth.lat = nav_sat.latitude_deg();
global_position_groundtruth.lon = nav_sat.longitude_deg();
Expand Down

0 comments on commit e902047

Please sign in to comment.