From 41fdce9a754dc0ee6ee7711a96244c793b523cac Mon Sep 17 00:00:00 2001 From: Michael Ferguson Date: Wed, 9 Oct 2024 10:20:28 -0400 Subject: [PATCH 1/3] fix parameter name for parallel gripper mode --- .../src/moveit_simple_controller_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..3dcf55e5ff 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,7 @@ 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) { From 0d86eee71fa9442c6315d3dc7772b166d67a7522 Mon Sep 17 00:00:00 2001 From: Michael Ferguson Date: Wed, 9 Oct 2024 10:23:08 -0400 Subject: [PATCH 2/3] update other params --- .../src/moveit_simple_controller_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 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 3dcf55e5ff..6941fb6c58 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 @@ -170,14 +170,14 @@ 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); From c050bc84514fc31bffaff0930022311bc940a12e Mon Sep 17 00:00:00 2001 From: Michael Ferguson Date: Tue, 15 Oct 2024 09:53:38 -0400 Subject: [PATCH 3/3] formatting --- .../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 6941fb6c58..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, controller_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, controller_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, controller_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);