OpenRAVE Documentation

Command Line Tools

openrave.py

The openrave.py script is an attempt to make the command line parameters for openrave much simpler to use. It is a superset of the functions provided by the original openrave program, except it supports many other interesting features and provides a window to all openravepy functions. It can also automatically add openravepy to the PYTHONPATH making it simpler for users. Here are some features it supports:

  • Opening files with the -i option will now drop into the ipython interpreter after loading the particular files specified. For example:

    openrave.py -i data/lab1.env.xml

    Output:

    [openravepy_int.cpp:2679] viewer qtcoin successfully attached
    OpenRAVE Dropping into IPython
    In [1]:

    The first robot in the scene is automatically loaded into the ‘robot’ variable, so it can be immediately used for scripting operations:

    In [1]: robot.GetJoints()
    Out[1]:
    [<env.GetKinBody('BarrettWAM').GetJoint('Shoulder_Yaw')>,
     <env.GetKinBody('BarrettWAM').GetJoint('Shoulder_Pitch')>, ...]
    
  • Can start a database generation process:

    openrave.py --database inversekinematics --robot=robots/pa10.robot.xml
  • Can execute an example:

    openrave.py --example graspplanning
  • Can query all executable databases:

    openrave.py --listdatabases
    

    Output:

No module named DatabaseGenerator
No module named OpenRAVEGlobalArguments
convexdecomposition
No module named getenv
grasping
No module named h5py
inversekinematics
inversereachability
kinematicreachability
linkstatistics
No module named log
No module named logging
No module named makedirs
No module named metaclass
No module named openravepy_int
No module named os
No module named pickle
No module named time
No module named version_info
visibilitymodel
No module named with_statement

  • Can set custom collision, physics, and viewer:

    openrave.py --collision=pqp --viewer=qtcoin --physics=ode data/lab1.env.xml
  • Can set debug mode:

    openrave.py --level=verbose data/lab1.env.xml
  • Can execute arbitrary python code:

    openrave.py -p "print 'robot manipulators: ',robot.GetManipulators()" robots/pr2-beta-sim.robot.xml
  • Can execute arbitrary python code and step into the ipython interpreter:

    openrave.py -p "manip=robot.GetActiveManipulator()" -i robots/pr2-beta-sim.robot.xml
  • Can execute arbitrary python code and exit:

    openrave.py -p "print('links: '+str(robot.GetLinks())); sys.exit(0)" robots/pr2-beta-sim.robot.xml

Given that environment xml files can now contain tags for any interface, it is possible to setup all the used interfaces in the XML, open it with openrave.py -i, and immediately start introspecting on the state.

Command-line

Usage: openrave.py [options] [loadable openrave xml/robot files...]

OpenRAVE 0.9.0

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  --database            If specified, the next arguments will be used to call
                        a database generator from the openravepy.databases
                        module. The first argument is used to find the
                        database module. For example: openrave0.9.py
                        --database grasping --robot=robots/pr2-beta-
                        sim.robot.xml
  --example             If specified, the next arguments will be used to call
                        an example from the openravepy.examples module. The
                        first argument is used to find the example moduel. For
                        example: openrave0.9.py --example graspplanning
                        --scene=data/lab1.env.xml
  -i, --ipython         if true will drop into the ipython interpreter rather
                        than spin
  -p PYTHONCMD, --pythoncmd=PYTHONCMD
                        Execute a python command after all loading is done and
                        before the drop to interpreter check. The variables
                        available to use are: "env","robots","robot". It is
                        possible to quit the program after the command is
                        executed by adding a "sys.exit(0)" at the end of the
                        command.
  --listinterfaces=LISTINTERFACES
                        List the provided interfaces of a particular type from
                        all plugins. Possible values are: planner, robot,
                        sensorsystem, controller, module, iksolver, kinbody,
                        physicsengine, sensor, collisionchecker, trajectory,
                        viewer, spacesampler.
  --listplugins         List all plugins and the interfaces they provide.
  --listdatabases       Lists the available core database generators
  --listexamples        Lists the available examples.

  OpenRAVE Environment Options:
    --loadplugin=_LOADPLUGINS
                        List all plugins and the interfaces they provide.
    --collision=_COLLISION
                        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).
    --serverport=_SERVERPORT
                        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
                        (fatal,error,warn,info,debug,verbose,verifyplans)

openrave-robot.py

Queries information about OpenRAVE-loadable robots. Allows to query simple information for robot links, joints, manipulators, sensor as fast as possible.

For example, getting info of all the manipulators is as simple as:

openrave-robot.py robots/pr2-beta-static.zae --info manipulators

or can just get a list of the manipulator names:

openrave-robot.py robots/pr2-beta-static.zae --list manipulators

Each robot can hold several different types of hashes depending on the information being queried. Hashes are retrieved with the –hash option:

openrave-robot.py data/mug1.kinbody.xml --hash body
openrave-robot.py robots/barrettsegway.robot.xml --hash robot
openrave-robot.py robots/barrettsegway.robot.xml --manipname=arm --hash kinematics

Command-line

Usage: openrave-robot.py openrave-filename [options]

Queries information about OpenRAVE-loadable robots

Options:
  -h, --help            show this help message and exit
  --list=DOLIST         Lists the manipulators/sensors/links/joints names of
                        the robot.
  --info=DOINFO         Prints detailed information on
                        manipulators/sensors/links/joints information of a
                        robot.
  --hash=DOHASH         If set, will output hashes of the loaded body
                        depending if manipname or sensorname are set. Can be
                        one of (body,kinematics,robot)
  --manipname=MANIPNAME
                        if manipulator name is specified will return the
                        manipulator hash of the robot
  --sensorname=SENSORNAME
                        if manipulator name is specified will return the
                        sensor hash of the robot

openrave-createplugin.py

Sets up a project directory and initial files for creating OpenRAVE plugins and executables.

This command line will create a plugin that offers a MyNewModule ModuleBase:

openrave-createplugin.py myplugin --module MyNewModule

Command-line

Usage: openrave-createplugin.py pluginname [options] 

Sets up a project directory and initial files for creating OpenRAVE plugins
and executables.

Options:
  -h, --help            show this help message and exit
  --usecore             If set, will create an executable that links to the
                        core instead of creating a plugin.
  --planner=PLANNER     create a planner interface
  --robot=ROBOT         create a robot interface
  --sensorsystem=SENSORSYSTEM
                        create a sensorsystem interface
  --controller=CONTROLLER
                        create a controller interface
  --module=MODULE       create a module interface
  --iksolver=IKSOLVER   create a iksolver interface
  --kinbody=KINBODY     create a kinbody interface
  --physicsengine=PHYSICSENGINE
                        create a physicsengine interface
  --sensor=SENSOR       create a sensor interface
  --collisionchecker=COLLISIONCHECKER
                        create a collisionchecker interface
  --trajectory=TRAJECTORY
                        create a trajectory interface
  --viewer=VIEWER       create a viewer interface
  --spacesampler=SPACESAMPLER
                        create a spacesampler interface

openrave

Simple executable written in C++ that can start an OpenRAVE environment and load modules. It provides simple configuration of parameters for easy testing.

It is possible to save robots into

Command-line

[openrave.cpp:93] OpenRAVE Usage
--nogui             Run without a GUI (does not initialize the graphics engine nor communicate with any window manager)
--hidegui           Run with a hidden GUI, this allows 3D rendering and images to be captured
--listplugins       List all plugins and the interfaces they provide
--loadplugin [path] load a plugin at the following path
--serverport [port] start up the server on a specific port (default is 4765)
--collision [name]  Default collision checker to use
--viewer [name]     Default viewer to use
--server [name]     Default server to use
--physics [name]    Default physics engine to use
-d [debug-level]   start up OpenRAVE with the specified debug level (higher numbers print more).
                   Default level is 2 for release builds, and 4 for debug builds.
-wdims [width] [height] start up the GUI window with these dimensions
-wpos x y set the position of the GUI window
--module [modulename] [args] Start openrave with a module. If args involves spaces, surround it with double quotes. args is optional.
--version          Output the current openrave version

-f [scene]         Load a openrave environment file


openrave-config

Used to find the openrave installation directories, used libraries, headers, and shared files.

Command-line

Usage: openrave-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--libs-core] [--libs-only-l] [--libs-only-L] [--cflags-only-I] [--shared-libs] [--python-dir] [--octave-dir] [--matlab-dir] [--share-dir] [--usage | --help]

Questions/Feedback

Having problems with OpenRAVE?