diff --git a/moveit_plugins/moveit_ros_control_interface/src/controller_manager_plugin.cpp b/moveit_plugins/moveit_ros_control_interface/src/controller_manager_plugin.cpp index 0cc3b04dcf..f57cae4d1c 100644 --- a/moveit_plugins/moveit_ros_control_interface/src/controller_manager_plugin.cpp +++ b/moveit_plugins/moveit_ros_control_interface/src/controller_manager_plugin.cpp @@ -256,8 +256,20 @@ class Ros2ControlManager : public moveit_controller_manager::MoveItControllerMan if (!ns_.empty()) { if (!node_->has_parameter("ros_control_namespace")) + { ns_ = node_->declare_parameter("ros_control_namespace", "/"); + } + else + { + node_->get_parameter("ros_control_namespace", ns_); + } } + else if (node->has_parameter("ros_control_namespace")) + { + node_->get_parameter("ros_control_namespace", ns_); + RCLCPP_INFO_STREAM(LOGGER, "Namespace for controller manager was specified, namespace: " << ns_); + } + list_controllers_service_ = node_->create_client( getAbsName("controller_manager/list_controllers")); switch_controller_service_ = node_->create_client(