How to use the Grasp message?

1,913 views
Skip to first unread message

atp

unread,
Jan 6, 2014, 10:35:06 PM1/6/14
to moveit...@googlegroups.com
There is a grasp message within moveit_msgs (http://docs.ros.org/api/moveit_msgs/html/msg/Grasp.html). But I can't find any tutorial that shows how to use this message to perform actual grasping using MoveIt. How would this message be used to do this (in C++) ?

Sam Pfeiffer

unread,
Jan 7, 2014, 7:37:44 AM1/7/14
to moveit...@googlegroups.com
Hello atp,

I found the same lack of information while trying to play with the grasping (pick and place) pipeline. I'm still figuring things out but you can give a look at my playing around code, for example in this file: https://github.com/awesomebytes/moveit_grasping_testing/blob/master/scripts/pick_as_moveit.py
Won't work out of the box I'm sure!

For learning I took a look at baxter pick and place: https://github.com/davetcoleman/baxter_cpp/tree/hydro-devel/baxter_pick_place
And his block grasp generator: https://github.com/davetcoleman/block_grasp_generator --> https://github.com/bmagyar/block_grasp_generator here you can find a version with an action server and a file for our robot to generate the grasps.

The grasp message is part of the list of possible_grasps you give to a pick actionserver call. I'm still not very clear how these grasps are evaluated by the pipeline. (If someone could give a hint on this I would gladly read it!)

What I can tell you from it's fields (other than it's descriptions on the message):

string id
trajectory_msgs/JointTrajectory pre_grasp_posture
These JointTrajectory contain JointTrajectoryPoint which contains time_from_start field. This field time will be added to a default time for the opening and closing of the gripper. I reported/asked about this issue here: https://github.com/ros-planning/moveit_ros/pull/391/files#r8637952 (It's 7 seconds by default and I think it's a lot if this must exist in this way).
The frame_id I'm using for this PoseStamped is my base_link of my robot. 

float64 grasp_quality
moveit_msgs/GripperTranslation pre_grasp_approach
moveit_msgs/GripperTranslation post_grasp_retreat
moveit_msgs/GripperTranslation post_place_retreat
float32 max_contact_force
string[] allowed_touch_objects
The allowed objects here can touch the gripper link in the approach and closing the gripper moments I think (as of my empirical tests in simulation). This is bad in my case as I'm crashing a finger of my gripper (a hand) sometimes when approaching the object... but this seems correct as I'm allowing explicitly to touch! Here is where I would like to know how this is evaluated by the pipeline.


Sorry about this bunch of random information but it may be useful for someone (or someone may correct me).

atp

unread,
Jan 7, 2014, 11:08:14 AM1/7/14
to moveit...@googlegroups.com
Thank you! That gives me a good basis to work from.

atp

unread,
Jan 7, 2014, 4:19:18 PM1/7/14
to moveit...@googlegroups.com
I've one question after looking a bit at Dave's code: How does MoveIt know when to close/open the gripper given a grasp message? Or does the gripper need to be controlled from somewhere else? 

Sam Pfeiffer

unread,
Jan 7, 2014, 4:35:38 PM1/7/14
to atp, moveit...@googlegroups.com
This is used in a pick message.
When asking for a pick, you say what object of the environment you want to pick and you give possible grasps for it. The pipeline tries the approaches of the grasps until finds one that works. (If there is autocollision, collision with the environment, no solution of IK, etc the grasps dont work). Then executes that full plan, pregrasp pose, pregrasp gripper position, approach to the grasping pose, now at the grasping pose grasp gripper position, then retreat from the grasping pose.

The gripper is controled using the info you submited in the Grasp message (in my case I give the joints that  correspond to our fingers of our hand as you can see). It sends to the controller of the gripper (which should be known by MoveIt! in your config files like it should know the controllers of the arm) the values you said for the joints you said in the Grasp message.

I hope that made sense!


2014/1/7 atp <andreas...@gmail.com>
Reply all
Reply to author
Forward
0 new messages