Skip to content

Setting up GraspIt

Jennifer Buehler edited this page Jul 19, 2018 · 10 revisions

If you want to use the original GraspIt! simulator, or if you want to load graspit world files, you will need to set up GraspIt!.

1. Create environment variable

You will need to create an environment variable called GRASPIT to point to the directory which contains your robot/object model files and the world files. You may find a set of ready-to use models in the graspit repository, if you have it. The package jaco_graspit_sample also has example files for the Jaco robot, so you may choose this directory for $GRASPIT.

In general, you will need to set $GRASPIT to the directory in which you can find the folders models and worlds, which can be any location of your choice.

echo "export GRASPIT=<your-directory-of-choice>" >> ~/.bashrc    
source ~/.bashrc

If you chose the directory graspit or jaco_graspit_sample, you will already have models and worlds directories. If you do not, first create the following directory structure:

cd $GRASPIT
mkdir -p models/robots
mkdir -p models/objects
mkdir worlds

You will still need to populate the directories with robot, object and world files, which is described in the next step.

2. Soft-link your robot files (if required)

If you already have all the robots you want to use in your $GRASPIT root, you can skip this step.

If you have other world/robot/object files elsewhere which you would like to use with GraspIt!, you will have to add them to your $GRASPIT root directory. The easiest way to do this is to create soft-links to your files.

Your graspit files should be organised in the same directory structure as the models/ and worlds/ directories in the $GRASPIT directory:

  • models/robots/YOUR_ROBOT
    • eigen: contains eigen.xml
    • iv: contains all inventor geometry folders
    • YOUR_ROBOT.xml
    • virtual: contains contacts.vgr
  • models/objects
    • ANY_OBJECT.iv
    • ANY_OBJECT.xml
  • models/obstacles
    • ANY_OBSTACLE.iv
    • ANY_OBSTACLE.xml
  • worlds
    • YOUR_ROBOT_world.xml

To add all files and directories in YOUR_ROBOT to $GRASPIT, you can create soft links to your entire robot directory models/robots/YOUR_ROBOT in the folder $GRASPIT/models/robots (same for your objects which belong into $GRASPIT/models/objects):

cd $GRASPIT/models/robots
ln -s <path-to: models/robots/YOUR\_ROBOT>
cd $GRASPIT/models/objects
ln -s <path-to: models/objects/YOUR\_OBJECT.xml>
ln -s <path-to: models/objects/YOUR\_OBJECT.iv>
cd $GRASPIT/worlds
ln -s <path-to: worlds/YOUR\_ROBOT\_world.xml>

Jaco example

For example, for the Jaco hand provided in jaco_graspit_sample (if you did not already choose this as $GRASPIT root), this would be:

cd $GRASPIT/models/robots/
ln -s <path-to-jaco_graspit_sample>/models/robots/jaco_robot/
cd $GRASPIT/models/objects/
ln -s <path-to-jaco_graspit_sample>/models/objects/small_cube.xml
ln -s <path-to-jaco_graspit_sample>/models/objects/small_cube.iv
cd $GRASPIT/worlds
ln -s <path-to-jaco_graspit_sample>/worlds/jaco_robot_world.xml

Or if you are using ROS, you may use rospack find and can then just copy&paste the commands below:

cd $GRASPIT/models/robots/
ln -s `rospack find jaco_graspit_sample`/models/robots/jaco_robot/
cd $GRASPIT/models/objects/
ln -s `rospack find jaco_graspit_sample`/models/objects/small_cube.xml
ln -s `rospack find jaco_graspit_sample`/models/objects/small_cube.iv
cd $GRASPIT/worlds
ln -s `rospack find jaco_graspit_sample`/worlds/jaco_robot_world.xml

Note: Additionally to linking small_cube, you may also want to link obstacles/table.iv and obstacles/table.xml into the obstacles directory. You may need the table to put the object on when grasp planning. This is a copy of the file in the original GraspIt! code, so only soft-link this one if you are not using the original GraspIt! source tree as root. For example, link the whole obstacles directory:

cd $GRASPIT/models
ln -s `rospack find jaco_graspit_sample`/models/obstacles/

3. Test your set-up

You may now want to try the original GraspIt! simulator. Check out this tutorial.