I'm trying to use Pr2 gripper with UR5. I want to use action interface for the gripper. For this I have tried with both -
(Have kept details only related to the gripper)
1. GripperCommand:
controllers.yaml
controller_list:
- name: r_gripper_controller
action_ns: gripper_cmd
default: true
type: GripperCommand
joints: [r_gripper_l_finger_joint]
control_grip.yaml
r_gripper_controller:
type: effort_controllers/GripperActionController
joint: r_gripper_l_finger_joint
gains:
r_gripper_l_finger_joint: {p: 100.0, i: 0.01, d: 10.0}
msg = GripperCommandGoal()
msg.command.position = 0.2
msg.command.max_effort = 10.0
client_grip.send_goal(msg)
client_grip.wait_for_result()
if client_grip.get_state() == GoalStatus.SUCCEEDED:
rospy.loginfo("opened!")
rospy.loginfo("gripper state: %i", client_grip.get_state())
But here the goal remains ACTIVE infinitely. Same is the case for closing as well.
2. FollowJointTrajectory
controllers.yaml
controller_list:
- name: r_gripper_controller
action_ns: follow_joint_trajectory
default: true
type: FollowJointTrajectory
joints: [r_gripper_l_finger_joint]
control_grip.yaml
r_gripper_controller:
type: effort_controllers/JointTrajectoryController
joint: r_gripper_l_finger_joint
gains:
r_gripper_l_finger_joint: {p: 100.0, i: 0.01, d: 10.0}
msg = FollowJointTrajectoryGoal()
msg.trajectory.header.stamp = rospy.Time.now() + rospy.Duration(0.4)
msg.trajectory.joint_names = ['r_gripper_l_finger_joint']
msg.trajectory.points.append(JointTrajectoryPoint(positions=[0.2], time_from_start = rospy.Duration(2)))
"Sometimes" the open works (position = 0.2), but in case of close (position = 0.0), the goal is either ABORTED (4) or REJECTED (5)
What am I doing wrong?