From 8cc0d71caf1557ea715fd17ddb254a5f9a34fad2 Mon Sep 17 00:00:00 2001 From: Sai Kishor Kothakota Date: Sun, 1 Oct 2023 23:05:43 +0200 Subject: [PATCH] Apply denis suggestions from code review Co-authored-by: Dr. Denis --- controller_manager/src/controller_manager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controller_manager/src/controller_manager.cpp b/controller_manager/src/controller_manager.cpp index bd5bb4263b..2c85b3cc26 100644 --- a/controller_manager/src/controller_manager.cpp +++ b/controller_manager/src/controller_manager.cpp @@ -2054,10 +2054,12 @@ controller_interface::return_type ControllerManager::update( if (controller_go) { auto controller_ret = - loaded_controller.c->update(time, run_controller_at_cm_rate ? period : controller_period); + loaded_controller.c->update(time, controller_period); if (*loaded_controller.next_update_cycle_time == rclcpp::Time(0)) + { *loaded_controller.next_update_cycle_time = time; + } *loaded_controller.next_update_cycle_time += controller_period; if (controller_ret != controller_interface::return_type::OK)