Skip to content

Commit

Permalink
Fix parameters for ros2_control namespaces (moveit#1833)
Browse files Browse the repository at this point in the history
Co-authored-by: AndyZe <[email protected]>
Co-authored-by: Henning Kayser <[email protected]>
  • Loading branch information
3 people authored Jan 26, 2023
1 parent 936b4ad commit 5838ce8
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>("ros_control_namespace", "/");
}
else
{
node_->get_parameter<std::string>("ros_control_namespace", ns_);
}
}
else if (node->has_parameter("ros_control_namespace"))
{
node_->get_parameter<std::string>("ros_control_namespace", ns_);
RCLCPP_INFO_STREAM(LOGGER, "Namespace for controller manager was specified, namespace: " << ns_);
}

list_controllers_service_ = node_->create_client<controller_manager_msgs::srv::ListControllers>(
getAbsName("controller_manager/list_controllers"));
switch_controller_service_ = node_->create_client<controller_manager_msgs::srv::SwitchController>(
Expand Down

0 comments on commit 5838ce8

Please sign in to comment.