moveit / moveit2

:robot: MoveIt for ROS 2
https://moveit.ai/
BSD 3-Clause "New" or "Revised" License
1.09k stars 528 forks source link

Move_group /execute_trajectory does not send action to gripper (galactic) #2216

Closed lmendyk closed 1 year ago

lmendyk commented 1 year ago

I’m not very experience in robotics (yet), but I would expect to be able to control the robot which has arm and gripper.

The configuration is as for turtlebot3 with open manipulator moveit_controllers.yaml

I’m sending the following action: ros2 action send_goal /execute_trajectory moveit_msgs/action/ExecuteTrajectory \ "trajectory: {joint_trajectory: {joint_names:[joint1, joint2, joint3, joint4, gripper_left_joint], points: [\ {positions:[0.0, 0.0, 0.0, 0.0, 0.0], time_from_start: {sec: 0, nanosec: 0} },\ {positions:[1.57, 0.78, -0.78, 0.0, 0.0], time_from_start: {sec: 1, nanosec: 0} },\ {positions:[1.57, 0.78, -0.78, 0.0, 0.02], time_from_start: {sec: 2, nanosec: 0} },\ … ]} }"

The execution is reported to be successful but gripper_left_joint postion is not changed.

The log from move_group suggest the gripper is ignored and only action to arm_controller is sent but not to gripper_controller:

[move_group-2] [INFO] [1685612796.810690200] [moveit_move_group_default_capabilities.execute_trajectory_action_capability]: Execution request received [move_group-2] [INFO] [1685612796.810730900] [moveit.plugins.moveit_simple_controller_manager]: Returned 2 controllers in list [move_group-2] [INFO] [1685612796.810830900] [moveit_ros.trajectory_execution_manager]: Validating trajectory with allowed_start_tolerance 0.01 [move_group-2] [INFO] [1685612796.825812900] [moveit_ros.trajectory_execution_manager]: Starting trajectory execution ... [move_group-2] [INFO] [1685612796.826942100] [moveit.plugins.moveit_simple_controller_manager]: Returned 2 controllers in list [move_group-2] [INFO] [1685612796.827787900] [moveit.simple_controller_manager.follow_joint_trajectory_controller_handle]: sending trajectory to arm_controller [move_group-2] [INFO] [1685612796.831780300] [moveit.simple_controller_manager.follow_joint_trajectory_controller_handle]: arm_controller started execution [move_group-2] [INFO] [1685612796.831814500] [moveit.simple_controller_manager.follow_joint_trajectory_controller_handle]: Goal request accepted! [move_group-2] [INFO] [1685612803.882119900] [moveit.simple_controller_manager.follow_joint_trajectory_controller_handle]: Controller 'arm_controller' successfully finished [move_group-2] [INFO] [1685612803.906251000] [moveit_ros.trajectory_execution_manager]: Completed trajectory execution with status SUCCEEDED ... [move_group-2] [INFO] [1685612803.906418700] [moveit_move_group_default_capabilities.execute_trajectory_action_capability]: Execution completed: SUCCEEDED

When I send actions directly to the gripper that works fine: ros2 action send_goal /gripper_controller/gripper_cmd control_msgs/action/GripperCommand \ "{command: {position: 0.02}}" sleep 1 ros2 action send_goal /gripper_controller/gripper_cmd control_msgs/action/GripperCommand \ "{command: {position: 0.0}}"

Am I missing something or it is a bug (I’m still using galactic binaries with turtlebot3_manipulation built from sources adapted to galactic distribution)

lmendyk commented 1 year ago

I think I have found the issue: I have to use "moveit_ros_control_interface/MoveItMultiControllerManager" instead of "moveit_simple_controller_manager/MoveItSimpleControllerManager" (and have to install ros-galactic-moveit-ros-control-interface)

Still have issue that I don't see in RVIZ gripper movement event than I see both controllers getting goal [ros2_control_node-1] [INFO] [1685635016.221221300] [arm_controller]: Received new action goal [ros2_control_node-1] [INFO] [1685635016.221319000] [arm_controller]: Accepted new action goal [ros2_control_node-1] [INFO] [1685635016.223632200] [gripper_controller]: Received & accepted new action goal [ros2_control_node-1] [INFO] [1685635023.225467400] [arm_controller]: Goal reached, success!

In move_it I see warning (even after adding comman_joint in moveit_controllers.yaml) [move_group-2] [WARN] [1685634272.557427100] [moveit.simple_controller_manager.gripper_controller_handle]: No command_joint was specified for the MoveIt controller gripper handle. Please see GripperControllerHandle::addCommandJoint() and GripperControllerHandle::setCommandJoint(). Assuming index 0.

But this is a warning so I don't know why I can't observe in RVIZ the gripper movement which I can see when I send the action directly to gripper_controller.

lmendyk commented 1 year ago

I think I have found the underlaying problem.

When I send trajectory as this:

ros2 action send_goal /execute_trajectory moveit_msgs/action/ExecuteTrajectory \ "trajectory: {joint_trajectory: {joint_names:[gripper_left_joint], points: [\ {positions:[0.0], time_from_start: {sec: 0, nanosec: 0} },\ {positions:[0.02], time_from_start: {sec: 1, nanosec: 0} },\ {positions:[0.0], time_from_start: {sec: 2, nanosec: 0} }\ ]} }"

The goal is reported successful but gripper movement is not performed (as if the position: 0.02 is not performed. But when I split it as two separate actions: ros2 action send_goal /execute_trajectory moveit_msgs/action/ExecuteTrajectory \ "trajectory: {joint_trajectory: {joint_names:[gripper_left_joint], points: [\ {positions:[0.0], time_from_start: {sec: 0, nanosec: 0} },\ {positions:[0.02], time_from_start: {sec: 1, nanosec: 0} }\ ]} }"

and then

ros2 action send_goal /execute_trajectory moveit_msgs/action/ExecuteTrajectory \ "trajectory: {joint_trajectory: {joint_names:[gripper_left_joint], points: [\ {positions:[0.02], time_from_start: {sec: 0, nanosec: 0} },\ {positions:[0.0], time_from_start: {sec: 1, nanosec: 0} }\ ]} }"

I can see the gripper being open and then closed.

sjahr commented 1 year ago

Sorry for the late response and glad to hear you were able to resolve your problem :tada: With the EOL of Galactic we've also stopped actively maintaining the MoveIt 2 galactic version so for future questions I'd recommend you to update to a newer version (Rolling, Humble or Iron). Closing this issue for now. Feel free to open another one if you run into further problems