PR2 gripper with GripperCommand or FollowJointTrajectory

341 views
Skip to first unread message

harsh deshpande

unread,
May 4, 2016, 10:40:23 AM5/4/16
to MoveIt! Users
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?

harsh deshpande

unread,
May 5, 2016, 9:58:12 AM5/5/16
to MoveIt! Users
OK I'm seeing a strange behavior now. I removed the code pertaining to the UR5 and used GripperCommand for PR2 gripper and it works perfectly fine. 
It opens and closes and returns the SUCCEEDED code.

But when I send a trajectory goal for the arm (which returns an ABORTED code after completing the trajectory), the GripperCommand goal waits infinitely.
What has the response of the trajectory goal got to do anything with the gripper goal?
Reply all
Reply to author
Forward
0 new messages