diff --git a/controller_manager/CMakeLists.txt b/controller_manager/CMakeLists.txt index d741e1e13f..b0db9990b0 100644 --- a/controller_manager/CMakeLists.txt +++ b/controller_manager/CMakeLists.txt @@ -9,7 +9,6 @@ set(THIS_PACKAGE_INCLUDE_DEPENDS ament_index_cpp controller_interface controller_manager_msgs - diagnostic_updater hardware_interface pluginlib rclcpp diff --git a/controller_manager/include/controller_manager/controller_manager.hpp b/controller_manager/include/controller_manager/controller_manager.hpp index 86eeecb78e..dd3b4b0c6f 100644 --- a/controller_manager/include/controller_manager/controller_manager.hpp +++ b/controller_manager/include/controller_manager/controller_manager.hpp @@ -40,7 +40,6 @@ #include "controller_manager_msgs/srv/switch_controller.hpp" #include "controller_manager_msgs/srv/unload_controller.hpp" -#include "diagnostic_updater/diagnostic_updater.hpp" #include "hardware_interface/handle.hpp" #include "hardware_interface/resource_manager.hpp" @@ -350,9 +349,6 @@ class ControllerManager : public rclcpp::Node const std::vector & controllers, int strictness, const ControllersListIterator controller_it); - void controller_activity_diagnostic_callback(diagnostic_updater::DiagnosticStatusWrapper & stat); - diagnostic_updater::Updater diagnostics_updater_; - std::shared_ptr executor_; std::shared_ptr> loader_; diff --git a/controller_manager/package.xml b/controller_manager/package.xml index 3dfa6adabf..9b1c01259c 100644 --- a/controller_manager/package.xml +++ b/controller_manager/package.xml @@ -15,7 +15,6 @@ backward_ros controller_interface controller_manager_msgs - diagnostic_updater hardware_interface launch launch_ros diff --git a/controller_manager/src/controller_manager.cpp b/controller_manager/src/controller_manager.cpp index 2afed99210..9f038d4e08 100644 --- a/controller_manager/src/controller_manager.cpp +++ b/controller_manager/src/controller_manager.cpp @@ -147,8 +147,7 @@ ControllerManager::ControllerManager( kControllerInterfaceNamespace, kControllerInterfaceClassName)), chainable_loader_( std::make_shared>( - kControllerInterfaceNamespace, kChainableControllerInterfaceClassName)), - diagnostics_updater_(this) + kControllerInterfaceNamespace, kChainableControllerInterfaceClassName)) { if (!get_parameter("update_rate", update_rate_)) { @@ -164,9 +163,6 @@ ControllerManager::ControllerManager( init_resource_manager(robot_description); - diagnostics_updater_.setHardwareID("ros2_control"); - diagnostics_updater_.add( - "Controllers Activity", this, &ControllerManager::controller_activity_diagnostic_callback); init_services(); } @@ -181,16 +177,12 @@ ControllerManager::ControllerManager( kControllerInterfaceNamespace, kControllerInterfaceClassName)), chainable_loader_( std::make_shared>( - kControllerInterfaceNamespace, kChainableControllerInterfaceClassName)), - diagnostics_updater_(this) + kControllerInterfaceNamespace, kChainableControllerInterfaceClassName)) { if (!get_parameter("update_rate", update_rate_)) { RCLCPP_WARN(get_logger(), "'update_rate' parameter not set, using default value."); } - diagnostics_updater_.setHardwareID("ros2_control"); - diagnostics_updater_.add( - "Controllers Activity", this, &ControllerManager::controller_activity_diagnostic_callback); init_services(); } @@ -2051,30 +2043,4 @@ controller_interface::return_type ControllerManager::check_preceeding_controller return controller_interface::return_type::OK; }; -void ControllerManager::controller_activity_diagnostic_callback( - diagnostic_updater::DiagnosticStatusWrapper & stat) -{ - // lock controllers - std::lock_guard guard(rt_controllers_wrapper_.controllers_lock_); - const std::vector & controllers = rt_controllers_wrapper_.get_updated_list(guard); - bool all_active = true; - for (size_t i = 0; i < controllers.size(); ++i) - { - if (!is_controller_active(controllers[i].c)) - { - all_active = false; - } - stat.add(controllers[i].info.name, controllers[i].c->get_state().label()); - } - - if (all_active) - { - stat.summary(diagnostic_msgs::msg::DiagnosticStatus::OK, "All controllers are active"); - } - else - { - stat.summary(diagnostic_msgs::msg::DiagnosticStatus::ERROR, "Not all controllers are active"); - } -} - } // namespace controller_manager