From 3bd19bf7c83d3551ace29c0a7e84206aedfae629 Mon Sep 17 00:00:00 2001 From: Sai Kishor Kothakota Date: Fri, 13 Sep 2024 20:37:50 +0200 Subject: [PATCH] change conditioning to not trigger logging for a failed return as well --- controller_manager/src/controller_manager.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/controller_manager/src/controller_manager.cpp b/controller_manager/src/controller_manager.cpp index f36171c05d..b0600d59aa 100644 --- a/controller_manager/src/controller_manager.cpp +++ b/controller_manager/src/controller_manager.cpp @@ -2310,7 +2310,13 @@ controller_interface::return_type ControllerManager::update( } *loaded_controller.next_update_cycle_time += controller_period; - if (!trigger_status) + + if (controller_ret != controller_interface::return_type::OK) + { + failed_controllers_list.push_back(loaded_controller.info.name); + ret = controller_ret; + } + else if (!trigger_status) { RCLCPP_WARN( get_logger(), @@ -2319,12 +2325,6 @@ controller_interface::return_type ControllerManager::update( loaded_controller.info.name.c_str(), time.seconds(), loaded_controller.next_update_cycle_time->seconds()); } - - if (controller_ret != controller_interface::return_type::OK) - { - failed_controllers_list.push_back(loaded_controller.info.name); - ret = controller_ret; - } } } }