OpenRAVE Documentation

hanoi Module

Solves the hanoi problem using simple arm planning.


Running the Example: --example hanoi


This example solves the Hanoi Puzzle using the Puma arm. You can easily change the locations of the pegs, disks, or add obstacles in the environment files data/hanoi_complex.env.xml and data/hanoi.env.xml to make the problem harder. The default planner used is the rBiRRT, you can easily change it to a different planner by changing the arguments to the BaseManipulation problem.


Usage: --example hanoi [options]

Manipulation planning example solving the hanoi problem.

  -h, --help            show this help message and exit
  --scene=SCENE         Scene file to load
  --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."
    while True:
        hanoi = HanoiPuzzle(env,env.GetRobots()[0],plannername=options.planner)
        if options.testmode:

Class Definitions

class openravepy.examples.hanoi.HanoiPuzzle(env, robot, plannername=None)[source]
GetGrasp(Tdisk, radius, angles)[source]

returns the transform of the grasp given its orientation and the location/size of the disk

MoveToPosition(values, indices)[source]

uses a planner to safely move the hand to the preshape and returns the trajectory.

move the robot out of the way so it can complete a preshape

hanoimove(disk, srcpeg, destpeg, height)[source]

Moves the arm and manipulator to grasp a peg and place it on a different peg

hanoisolve(n, pegfrom, pegto, pegby)[source]
putblock(disk, srcpeg, destpeg, height)[source]

busy wait for robot completion

openravepy.examples.hanoi.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?