Several ROS services are provided to access the code in the C++ API. They all run from within the GraspItServices class (find API in the docs folder).
On this wiki page you can find a tutorial on how to use the ROS service. It includes instructions on how to set up a GraspIt! database and run the planner on models in it, using the example Jaco hand.
About the provided ROS services
Following ROS services are provided for accessing GraspIt!:
- add objects to the database with grasp_planning_graspit_msgs/AddToDatabase.srv
- to load them to the current GraspIt world with grasp_planning_graspit_msgs/LoadDatabaseModel.srv.
- to save the currently loaded GraspIt world, with the service type grasp_planning_graspit_msgs/SaveWorld.srv.
- accepts grasp planning requests with the service type manipulation_msgs/GraspPlanning.srv.
The class GraspIt::EigenGraspPlanner is used for the planning. At this stage, the GraspIt::EigenGraspPlanner implementation supports only simulated annealing.
About the grasp planning request:
- The service calls the GraspIt! planner assuming that all object and robot poses are specified in the global frame (the graspit world origin).
- The frame id used in the geometry_msgs::PoseStamped objects have to be either "0" (pose not used) or "1" (pose object used in global frame). No tf transforms are supported yet.
About the results of a grasp planning request:
- The resulting manipulation_msgs::Grasp messages return the grasp pose relative to the object.
- Grasp quality values returned are the energy of the simulated annealing process.
- Pre-grasp joint states (see manipulation_msgs::Grasp::pre_grasp_posture) are not supported yet. It is assumed that the hand is plain open in pre-grasp stage for now.
- No joint velocities and efforts in the resulting sensor_msgs::JointState objects are provided.
- The provided services and clients are only examples and are meant to help you get started.