File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -419,6 +419,7 @@ void ControllerServer::computeControl()
419419{
420420 std::lock_guard<std::mutex> lock (dynamic_params_lock_);
421421
422+ auto start_time = this ->now ();
422423 RCLCPP_INFO (get_logger (), " Received a goal, begin computing control effort." );
423424
424425 try {
@@ -479,10 +480,12 @@ void ControllerServer::computeControl()
479480 break ;
480481 }
481482
483+ auto cycle_duration = this ->now () - start_time;
482484 if (!loop_rate.sleep ()) {
483485 RCLCPP_WARN (
484- get_logger (), " Control loop missed its desired rate of %.4fHz" ,
485- controller_frequency_);
486+ get_logger (),
487+ " Control loop missed its desired rate of %.4f Hz. Current loop rate is %.4f Hz." ,
488+ controller_frequency_, 1 / cycle_duration.seconds ());
486489 }
487490 }
488491 } catch (nav2_core::InvalidController & e) {
You can’t perform that action at this time.
0 commit comments