File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -452,6 +452,8 @@ void ControllerServer::computeControl()
452
452
last_valid_cmd_time_ = now ();
453
453
rclcpp::WallRate loop_rate (controller_frequency_);
454
454
while (rclcpp::ok ()) {
455
+ auto start_time = this ->now ();
456
+
455
457
if (action_server_ == nullptr || !action_server_->is_server_active ()) {
456
458
RCLCPP_DEBUG (get_logger (), " Action server unavailable or inactive. Stopping." );
457
459
return ;
@@ -479,10 +481,12 @@ void ControllerServer::computeControl()
479
481
break ;
480
482
}
481
483
484
+ auto cycle_duration = this ->now () - start_time;
482
485
if (!loop_rate.sleep ()) {
483
486
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 ());
486
490
}
487
491
}
488
492
} catch (nav2_core::InvalidController & e) {
You can’t perform that action at this time.
0 commit comments