Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix: reset controller_server loop_rate when missed desired rate #5712
When a single iteration takes longer than the expected period,
this impacts the next iterations behavior since they will have
less time to perform the control logic, thus increasing the actual
controller_frequency. By resetting the loop_rate on sleep() failure,
this ensures that each iteration will have a full period to exectue its
logic.

Signed-off-by: agennart <antoine.gennart@quimesis.be>
  • Loading branch information
agennart committed Nov 26, 2025
commit 8e4b2769cce5453a7698b6ce67bb5f428a2b0c83
1 change: 1 addition & 0 deletions nav2_controller/src/controller_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ void ControllerServer::computeControl()
get_logger(),
"Control loop missed its desired rate of %.4f Hz. Current loop rate is %.4f Hz.",
controller_frequency_, 1 / cycle_duration.seconds());
loop_rate.reset();
}
}
} catch (nav2_core::InvalidController & e) {
Expand Down
Loading