Skip to content

Commit

Permalink
[Ticker] Fix precision issue when comparing the log and controller ti…
Browse files Browse the repository at this point in the history
…mestep
  • Loading branch information
gergondet committed Jul 25, 2023
1 parent 786558f commit 8c3434e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mc_control/Ticker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Ticker::Ticker(const Configuration & config) : config_(config), gc_(get_gc_confi
if(log_->size() > 1)
{
double dt = log_->get("t", 1, 0.0) - log_->get("t", 0, 0.0);
if(dt != gc_.timestep())
if(std::fabs(dt - gc_.timestep()) > 1e-6)
{
mc_rtc::log::error_and_throw("Controller timestep ({}) is different from replay timestep ({})", gc_.timestep(),
dt);
Expand Down

0 comments on commit 8c3434e

Please sign in to comment.