From 1b8044a85a2d667e283b7ad9dc80154e0879afe0 Mon Sep 17 00:00:00 2001 From: Michael Ferguson Date: Mon, 21 Oct 2024 08:07:34 -0400 Subject: [PATCH] fix parameter namespacing for gripper controller (#3023) * fix parameter name for parallel gripper mode * update other params * formatting --------- Co-authored-by: Sebastian Jahr --- .../src/moveit_simple_controller_manager.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/moveit_plugins/moveit_simple_controller_manager/src/moveit_simple_controller_manager.cpp b/moveit_plugins/moveit_simple_controller_manager/src/moveit_simple_controller_manager.cpp index 4d4cedb8f7..40af565902 100644 --- a/moveit_plugins/moveit_simple_controller_manager/src/moveit_simple_controller_manager.cpp +++ b/moveit_plugins/moveit_simple_controller_manager/src/moveit_simple_controller_manager.cpp @@ -156,7 +156,8 @@ class MoveItSimpleControllerManager : public moveit_controller_manager::MoveItCo new_handle = std::make_shared(node_, controller_name, action_ns, max_effort); bool parallel_gripper = false; - if (node_->get_parameter(makeParameterName(PARAM_BASE_NAME, "parallel"), parallel_gripper) && parallel_gripper) + if (node_->get_parameter(makeParameterName(PARAM_BASE_NAME, controller_name, "parallel"), parallel_gripper) && + parallel_gripper) { if (controller_joints.size() != 2) { @@ -170,14 +171,16 @@ class MoveItSimpleControllerManager : public moveit_controller_manager::MoveItCo else { std::string command_joint; - if (!node_->get_parameter(makeParameterName(PARAM_BASE_NAME, "command_joint"), command_joint)) + if (!node_->get_parameter(makeParameterName(PARAM_BASE_NAME, controller_name, "command_joint"), + command_joint)) command_joint = controller_joints[0]; static_cast(new_handle.get())->setCommandJoint(command_joint); } bool allow_failure; - node_->get_parameter_or(makeParameterName(PARAM_BASE_NAME, "allow_failure"), allow_failure, false); + node_->get_parameter_or(makeParameterName(PARAM_BASE_NAME, controller_name, "allow_failure"), allow_failure, + false); static_cast(new_handle.get())->allowFailure(allow_failure); RCLCPP_INFO_STREAM(getLogger(), "Added GripperCommand controller for " << controller_name);