OpenRAVE Documentation

graspplanning Module

Combine the power of grasp sets and randomized planners to get any robot arm picking up objects from a table and putting them in a dish rack.


Running the Example: --example graspplanning


The example uses the powerful TaskManipulation problem interface, which takes advantage of many OpenRAVE features. It performs:

  • Pick grasps and validate them with the grasper planner
  • Move to the appropriate grasp preshape while avoiding obstacles
  • Use an RRT and Jacobian-based gradient descent methods to safely move close to an obstacle
  • Use CloseFingers to grasp the object while checking for collisions with other unwanted objects
  • Use body grabbing to grasp the object and move it to its destination
  • Lower the object until collision and then release and move away from it.

The scene is randomized every run in order to show the powerful of the planners.


Gallery of runs.


By default, the grasp planner will choose a grasp that is also valid at a destination point. If running on custom environments, sometimes it is interesting to see if the robot can just grasp the object, without moving it to the destination. To test planning without destinations use: --example graspplanning --nodestinations

5D IK Grasp Planning

It is possible to perform grasp planning with 5D IK.

Neuronics Katana

First create the grasp set with: --database grasping --robot=robots/neuronics-katana.zae --manipname=arm --target=data/box_frootloops.kinbody.xml --manipulatordirection="0 1 0"

Then execute: --example graspplanning --scene=data/katanatable.env.xml

Kuka Youbot

Grasp set generation: --database grasping --robot=robots/kuka-youbot.zae --manipulatordirection="0 1 0" --target=thinbox.kinbody.xml

Then execute: --example graspplanning --scene=data/youbot1.env.xml
Usage: [options]

Autonomous grasp and manipulation planning example.

  -h, --help            show this help message and exit
  --scene=SCENE         Scene file to load (default=data/lab1.env.xml)
  --nodestinations      If set, will plan without destinations.
  --norandomize         If set, will not randomize the bodies and robot
                        position in the scene.
  --planner=PLANNER     the planner to use

  OpenRAVE Environment Options:
                        List all plugins and the interfaces they provide.
                        Default collision checker to use
    --physics=_PHYSICS  physics engine to use (default=none)
    --viewer=_VIEWER    viewer to use (default=qtcoin)
    --server=_SERVER    server to use (default=None).
                        port to load server on (default=4765).
    --module=_MODULES   module to load, can specify multiple modules. Two
                        arguments are required: "name" "args".
    -l _LEVEL, --level=_LEVEL, --log_level=_LEVEL
                        Debug level, one of
    --testmode          if set, will run the program in a finite amount of
                        time and spend computation time validating results.
                        Used for testing

Main Python Code
def main(env,options):
    "Main example code."
    robot = env.GetRobots()[0]
    time.sleep(0.1) # give time for environment to update
    self = GraspPlanning(robot,randomize=options.randomize,nodestinations=options.nodestinations,plannername=options.planner)
    self.performGraspPlanning(withreplacement=not options.testmode)
Class Definitions
class openravepy.examples.graspplanning.GraspPlanning(robot, randomize=True, dests=None, nodestinations=False, switchpatterns=None, plannername=None, minimumgoalpaths=1)[source]
graspAndPlaceObject(gmodel, dests, waitforkey=False, movehanddown=True, **kwargs)[source]

grasps an object and places it in one of the destinations. If no destination is specified, will just grasp it

performGraspPlanning(withreplacement=True, **kwargs)[source]
static setRandomDestinations(targets, table, transdelta=0.10000000000000001, zoffset=0.01, Trolls=None, randomize=False, preserverotation=True)[source]
viewDestinations(gmodel, Tdests, delay=0.5)[source]

busy wait for robot completion

openravepy.examples.graspplanning.main(env, options)[source]

Main example code.*args, **kwargs)[source]

Command-line execution of the example.

Parameters:args – arguments for script to parse, if not specified will use sys.argv


Having problems with OpenRAVE?