Skip to content

Commit

Permalink
fixed clock-rate publisher execution
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Baca authored and Tomas Baca committed Jan 27, 2025
1 parent a3443ce commit 2cdd4c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/multirotor_simulator.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
simulation_rate: 100.0 # Hz
clock_rate: 100.0 # Hz
clock_rate: 100.0 # Hz, should be the same rate or lower than the simulation rate
realtime_factor: 1.0 # [-]

# when true, the simulation time will get initialized from wall time
Expand Down
2 changes: 1 addition & 1 deletion src/multirotor_simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void MultirotorSimulator::timerMain([[maybe_unused]] const ros::WallTimerEvent&

// | ---------------------- publish time ---------------------- |

if ((sim_time_ - last_published_time_).toSec() >= _clock_min_dt_) {
if ((sim_time_ - last_published_time_).toSec() >= _clock_min_dt_*(1.0-1e-6)) {

rosgraph_msgs::Clock ros_time;

Expand Down

0 comments on commit 2cdd4c3

Please sign in to comment.