Hi Patrick,
I just checked my code again, and now I'm also confused. Maybe somebody
else here can help us out. :-)
The way that I use MoveIt for moving the gripper is through the C++
move_group.pick() function. It expects a list of moveit_msgs/Grasp,
which has a field grasp_posture, which gives a desired configuration of
the gripper. The thing is that grasp_posture is a
trajectory_msgs/JointTrajectory; I fill it like this:
grasp.grasp_posture.joint_names.push_back("katana_l_finger_joint");
grasp.grasp_posture.joint_names.push_back("katana_r_finger_joint");
grasp.grasp_posture.points.resize(1);
grasp.grasp_posture.points[0].positions.push_back(-0.44);
grasp.grasp_posture.points[0].positions.push_back(-0.44);
The reason that I'm confused is:
* JointTrajectory expects joint angles in radian (here: -0.44)
* the GripperCommand action seems to expect gripper gap size in meters
(but my implementation interprets it as radians, that's why it works)
Since MoveIt has no way of converting these things, I think it just
passes one of the joint angles (which one?) from the grasp_posture as a
gap size to the GripperCommand action.
If that's really how it works, using radians and meters interchangably
is a horrible hack. I hope I'm wrong. :-)
If I'm not wrong, you should just make up your mind whether you'll want
to interpret the whole thing as meters or radians, and stick with it.
In either case, you can just use the set_joint_value_target() function.
Just keep in mind that what it really does is call the GripperCommand
action with that value. And you're right that set_pose_target() and
set_position_target() can't be used with a gripper, obviously.
Cheers,
Martin