Skip to content

Commit

Permalink
fix: Don't divide time by zero if single stepping. (#3352)
Browse files Browse the repository at this point in the history
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
Co-authored-by: Janosch Machowinski <J.Machowinski@cellumation.com>
  • Loading branch information
jmachowinski and Janosch Machowinski authored Nov 8, 2023
1 parent 41b34e5 commit 7ccef40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gazebo/sensors/SensorManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void PublishPerformanceMetrics()
if (ignition::math::equal(diffSimTime.Double(), 0.0))
return;

if (realTime == 0)
if (diffRealtime == common::Time::Zero)
realTimeFactor = 0;
else
realTimeFactor = diffSimTime / diffRealtime;
Expand Down

0 comments on commit 7ccef40

Please sign in to comment.