File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -452,6 +452,8 @@ void ControllerServer::computeControl()
452452 last_valid_cmd_time_ = now ();
453453 rclcpp::WallRate loop_rate (controller_frequency_);
454454 while (rclcpp::ok ()) {
455+ auto start_time = this ->now ();
456+
455457 if (action_server_ == nullptr || !action_server_->is_server_active ()) {
456458 RCLCPP_DEBUG (get_logger (), " Action server unavailable or inactive. Stopping." );
457459 return ;
@@ -479,10 +481,12 @@ void ControllerServer::computeControl()
479481 break ;
480482 }
481483
484+ auto cycle_duration = this ->now () - start_time;
482485 if (!loop_rate.sleep ()) {
483486 RCLCPP_WARN (
484- get_logger (), " Control loop missed its desired rate of %.4fHz" ,
485- controller_frequency_);
487+ get_logger (),
488+ " Control loop missed its desired rate of %.4f Hz. Current loop rate is %.4f Hz." ,
489+ controller_frequency_, 1 / cycle_duration.seconds ());
486490 }
487491 }
488492 } catch (nav2_core::InvalidController & e) {
You can’t perform that action at this time.
0 commit comments