From 5e48aa9e987719845c30ebf3520205d9498992f4 Mon Sep 17 00:00:00 2001 From: Sai Kishor Kothakota Date: Sun, 12 May 2024 21:36:06 +0200 Subject: [PATCH] Cleanup unused helper method --- controller_manager/src/controller_manager.cpp | 53 ------------------- 1 file changed, 53 deletions(-) diff --git a/controller_manager/src/controller_manager.cpp b/controller_manager/src/controller_manager.cpp index f4de720bca..abe85b3f43 100644 --- a/controller_manager/src/controller_manager.cpp +++ b/controller_manager/src/controller_manager.cpp @@ -133,59 +133,6 @@ bool is_interface_a_chained_interface( return true; } -bool is_interface_exported_from_controller( - const std::string & interface_name, const std::string & controller_name) -{ - auto split_pos = interface_name.find_first_of('/'); - if (split_pos == std::string::npos) // '/' exist in the string (should be always false) - { - RCLCPP_FATAL( - rclcpp::get_logger("ControllerManager::utils"), - "Character '/', was not find in the interface name '%s'. This should never happen. " - "Stop the controller manager immediately and restart it.", - interface_name.c_str()); - throw std::runtime_error("Mismatched interface name. See the FATAL message above."); - } - - auto interface_prefix = interface_name.substr(0, split_pos); - if (controller_name.compare(interface_prefix) == 0) - { - return true; - } - else - { - return false; - } -} - -bool is_controller_exported_state_interfaces_inuse_by_other_controllers( - const std::string & controller_name, - const std::vector & controllers, - std::vector blacklist) -{ - for (const auto & controller : controllers) - { - auto blacklist_it = std::find(blacklist.begin(), blacklist.end(), controller.info.name); - if (blacklist_it != blacklist.end() || controller_name.compare(controller.info.name) == 0) - { - continue; - } - if (!is_controller_active(controller.c)) - { - continue; - } - auto controller_exported_state_interfaces = controller.c->state_interface_configuration().names; - for (const auto & ctrl_itf_name : controller_exported_state_interfaces) - { - if (is_interface_exported_from_controller(ctrl_itf_name, controller_name)) - { - return true; - } - } - } - return false; -} - template void add_element_to_list(std::vector & list, const T & element) {