OpenRAVE Documentation

testupdatingbodies Module

Manually call the simulation loop to update the bodies while environment is locked.


Running the Example: --example testupdatingbodies


Usage: [options]

test physics

  -h, --help            show this help message and exit

  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):
    robot = env.GetRobots()[0]
    manipprob = interfaces.BaseManipulation(robot)
    Tcamera = array(((0.84028,  -0.14715,   0.52179,0.930986),
                     (0.52639,   0.45182,  -0.72026,-1.233453),
                     (-0.12976,   0.87989,   0.45711,2.412977)))
    print 'Stopping the environment loop from updating the simulation'
    print 'Locking environment and starting to plan'
    with env:
        res = manipprob.MoveManipulator(goal=[-0.75,1.24,-0.064,2.33,-1.16,-1.548,1.19])
        print 'Calling the simulation loop internally to python'
        while not robot.GetController().IsDone():
            env.UpdatePublishedBodies() # used to publish body information while environment is locked
    raw_input('press any key to exit: ')

Class Definitions

openravepy.examples.testupdatingbodies.main(env, options)[source]*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?