From f5c66efe12dd06bfbdbe8b50f2e06edbeb34e151 Mon Sep 17 00:00:00 2001 From: Sai Kishor Kothakota Date: Sun, 14 May 2023 21:56:19 +0200 Subject: [PATCH] check if the activate and deactivate list is empty after all the checks --- controller_manager/src/controller_manager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/controller_manager/src/controller_manager.cpp b/controller_manager/src/controller_manager.cpp index 8bd9a3169b..db2060a6c2 100644 --- a/controller_manager/src/controller_manager.cpp +++ b/controller_manager/src/controller_manager.cpp @@ -808,6 +808,14 @@ controller_interface::return_type ControllerManager::switch_controller( } } + // Check after the check if the activate and deactivate list is empty or not + if (activate_request_.empty() && deactivate_request_.empty()) + { + RCLCPP_INFO(get_logger(), "Empty activate and deactivate list, not requesting switch"); + clear_requests(); + return controller_interface::return_type::OK; + } + for (const auto & controller : controllers) { auto to_chained_mode_list_it = std::find(