OpenRAVE Documentation

openravepy Package

Library allows OpenRAVE to be used through Python.

Beginners should first check out Beginning with openravepy.

Internals

There is a __build_doc__ external variable that is set to True only when building docs. This allows package to clean their symbols and documentation.

openravepy.__init__.RaveClone((Interface)ref, (int)cloningoptions) → Interface :

boost::shared_ptr< T > RaveClone(boost::shared_ptr< T const > preference, int cloningoptions)

returned a fully cloned interface
openravepy.__init__.RaveCreateCollisionChecker((Environment)env, (str)name) → CollisionChecker :

OPENRAVE_API CollisionCheckerBasePtr RaveCreateCollisionChecker(EnvironmentBasePtr penv, const std::string & name)

openravepy.__init__.RaveCreateController((Environment)env, (str)name) → Controller :

OPENRAVE_API ControllerBasePtr RaveCreateController(EnvironmentBasePtr penv, const std::string & name)

openravepy.__init__.RaveCreateIkSolver((Environment)env, (str)name) → IkSolver :

OPENRAVE_API IkSolverBasePtr RaveCreateIkSolver(EnvironmentBasePtr penv, const std::string & name)

openravepy.__init__.RaveCreateInterface((Environment)env, (InterfaceType)type, (str)name) → Interface :

OPENRAVE_API InterfaceBasePtr RaveCreateInterface(EnvironmentBasePtr penv, InterfaceType type, const std::string & interfacename)

openravepy.__init__.RaveCreateKinBody((Environment)env, (str)name) → KinBody :

OPENRAVE_API KinBodyPtr RaveCreateKinBody(EnvironmentBasePtr penv, const std::string & name = “” )

openravepy.__init__.RaveCreateModule((Environment)env, (str)name) → Module :

OPENRAVE_API ModuleBasePtr RaveCreateModule(EnvironmentBasePtr penv, const std::string & name)

openravepy.__init__.RaveCreatePhysicsEngine((Environment)env, (str)name) → PhysicsEngine :

OPENRAVE_API PhysicsEngineBasePtr RaveCreatePhysicsEngine(EnvironmentBasePtr penv, const std::string & name)

openravepy.__init__.RaveCreatePlanner((Environment)env, (str)name) → Planner :

OPENRAVE_API PlannerBasePtr RaveCreatePlanner(EnvironmentBasePtr penv, const std::string & name)

openravepy.__init__.RaveCreateProblem((Environment)env, (str)name) → Module :

OPENRAVE_API ModuleBasePtr RaveCreateModule(EnvironmentBasePtr penv, const std::string & name)

openravepy.__init__.RaveCreateProblemInstance((Environment)env, (str)name) → Module :

OPENRAVE_API ModuleBasePtr RaveCreateModule(EnvironmentBasePtr penv, const std::string & name)

openravepy.__init__.RaveCreateRobot((Environment)env, (str)name) → Robot :

OPENRAVE_API RobotBasePtr RaveCreateRobot(EnvironmentBasePtr penv, const std::string & name = “” )

openravepy.__init__.RaveCreateSensor((Environment)env, (str)name) → Sensor :

OPENRAVE_API SensorBasePtr RaveCreateSensor(EnvironmentBasePtr penv, const std::string & name)

openravepy.__init__.RaveCreateSensorSystem((Environment)env, (str)name) → SensorSystem :

OPENRAVE_API SensorSystemBasePtr RaveCreateSensorSystem(EnvironmentBasePtr penv, const std::string & name)

openravepy.__init__.RaveCreateSpaceSampler((Environment)env, (str)name) → SpaceSampler :

OPENRAVE_API SpaceSamplerBasePtr RaveCreateSpaceSampler(EnvironmentBasePtr penv, const std::string & name)

openravepy.__init__.RaveCreateTrajectory((Environment)env, (str)name) → Trajectory :

OPENRAVE_API TrajectoryBasePtr RaveCreateTrajectory(EnvironmentBasePtr penv, const std::string & name = “” )

Return an empty trajectory instance.
openravepy.__init__.RaveCreateViewer((Environment)env, (str)name) → Viewer :

OPENRAVE_API ViewerBasePtr RaveCreateViewer(EnvironmentBasePtr penv, const std::string & name)

openravepy.__init__.RaveDestroy() → None :

OPENRAVE_API void RaveDestroy()

Destroys the entire OpenRAVE state and all loaded environments.

This functions should be always called before program shutdown in order to assure all resources are relased appropriately.

openravepy.__init__.RaveFindDatabaseFile((str)arg1, (bool)arg2) → str :

OPENRAVE_API std::string RaveFindDatabaseFile(const std::string & filename, bool bRead = true )

Searches for a filename in the database and returns a full path/URL to it.

Parameters
filename -
the relative filename in the database
bRead -
if true will only return a file if it exists. If false, will return the filename of the first valid database directory.
Return
a non-empty string if a file could be found.
openravepy.__init__.RaveFindLocalFile((str)filename[, (str)curdir]) → str
openravepy.__init__.RaveGetAffineConfigurationSpecification((int)affinedofs[, (KinBody)body[, (str)interpolation]]) → ConfigurationSpecification :

OPENRAVE_API ConfigurationSpecification RaveGetAffineConfigurationSpecification(int affinedofs, KinBodyConstPtr pbody = KinBodyConstPtr () , const std::string & interpolation = “” )

openravepy.__init__.RaveGetAffineDOF((int)affinedofs) → int :

OPENRAVE_API int RaveGetAffineDOF(int affinedofs)

Returns the degrees of freedom needed to represent all the values in the affine dof mask.

Exceptions
openrave_exception -
throws if
openravepy.__init__.RaveGetAffineDOFFromIndex((int)affinedofs, (int)index) → DOFAffine :

OPENRAVE_API DOFAffine RaveGetAffineDOFFromIndex(int affinedofs, int index)

Given a mask of affine dofs and an index into the array, returns the affine dof that is being referenced.

Parameters
affinedofs -
a mask of DOFAffine values
index -
an index into the affine dof array Exceptions
openrave_exception -
throws if dof if index is out of bounds
openravepy.__init__.RaveGetAffineDOFValuesFromTransform((object)transform, (int)affinedofs[, (object)rotationaxis]) → object :

OPENRAVE_API void RaveGetAffineDOFValuesFromTransform(std::vector< dReal >::iterator itvalues, const Transform & t, int affinedofs, const Vector & vActvAffineRotationAxis = Vector (0, 0, 1) )

Converts the transformation matrix into the specified affine values format.

Parameters
itvalues -
an iterator to the vector to write the values to. Will write exactly RaveGetAffineDOF(affinedofs) values.
the -
affine transformation to convert
affinedofs -
the affine format to output values in
vActvAffineRotationAxis -
optional rotation axis if affinedofs specified DOF_RotationAxis
openravepy.__init__.RaveGetDataAccess() → int :

OPENRAVE_API int RaveGetDataAccess()

Returns the acess options set.

See
RaveSetDataAccess
openravepy.__init__.RaveGetDebugLevel() → int :

OPENRAVE_API int RaveGetDebugLevel()

Returns the openrave debug level.
openravepy.__init__.RaveGetEnvironment((int)arg1) → Environment :

OPENRAVE_API EnvironmentBasePtr RaveGetEnvironment(int id)

get the environment from its unique id

Parameters
id -
the unique environment id returned by RaveGetEnvironmentId
openravepy.__init__.RaveGetEnvironmentId((Environment)arg1) → int :

OPENRAVE_API int RaveGetEnvironmentId(EnvironmentBasePtr penv)

return the environment’s unique id, returns 0 if environment could not be found or not registered
openravepy.__init__.RaveGetEnvironments() → object :

OPENRAVE_API void RaveGetEnvironments(std::list< EnvironmentBasePtr > & listenvironments)

Return all the created OpenRAVE environments.
openravepy.__init__.RaveGetHomeDirectory() → str :

OPENRAVE_API std::string RaveGetHomeDirectory()

Returns the openrave home directory where settings, cache, and other files are stored.

On Linux/Unix systems, this is usually $HOME/.openrave, on Windows this is $HOMEPATH/.openrave

openravepy.__init__.RaveGetIkTypeFromUniqueId((int)uniqueid) → IkParameterizationType :

OPENRAVE_API IkParameterizationType RaveGetIkTypeFromUniqueId(int uniqueid)

returns the IkParameterizationType given the unique id detmerined b IKP_UniqueIdMask
openravepy.__init__.RaveGetIndexFromAffineDOF((int)affinedofs, (DOFAffine)dof) → int :

OPENRAVE_API int RaveGetIndexFromAffineDOF(int affinedofs, DOFAffine dof)

Given a mask of affine dofs and a dof inside that mask, returns the index where the value could be found.

Parameters
affinedofs -
a mask of DOFAffine values
dof -
a set of values inside affinedofs, the index of the first value is returned Exceptions
openrave_exception -
throws if dof is not present in affinedofs
openravepy.__init__.RaveGetLoadedInterfaces() → object :

OPENRAVE_API void RaveGetLoadedInterfaces(std::map< InterfaceType, std::vector< std::string > > & interfacenames)

Get a list of all the loaded interfaces.
openravepy.__init__.RaveGetPluginInfo() → object :

OPENRAVE_API void RaveGetPluginInfo(std::list< std::pair< std::string, PLUGININFO > > & plugins)

Get all the loaded plugins and the interfaces they support.

Parameters
plugins -
A list of plugins. Each entry has the plugin name and the interfaces it supports
openravepy.__init__.RaveGlobalState() → UserData :

OPENRAVE_API UserDataPtr RaveGlobalState()

A pointer to the global openrave state.

Return
a managed pointer to the state.
openravepy.__init__.RaveHasInterface((InterfaceType)type, (str)name) → bool :

OPENRAVE_API bool RaveHasInterface(InterfaceType type, const std::string & interfacename)

Returns true if interface can be created, otherwise false.
openravepy.__init__.RaveInitialize([(bool)load_all_plugins[, (object)level]]) → int :

OPENRAVE_API int RaveInitialize(bool bLoadAllPlugins = true , int level = Level_Info )

Explicitly initializes the global OpenRAVE state (optional).

Parameters
bLoadAllPlugins -
If true will load all the openrave plugins automatically that can be found in the OPENRAVE_PLUGINS environment path Optional function to initialize openrave plugins, logging, and read OPENRAVE_* environment variables. Although environment creation will automatically make sure this function is called, users might want explicit control of when this happens. Will not do anything if OpenRAVE runtime is already initialized. If OPENRAVE_* environment variables must be re-read, first call RaveDestroy.
Return
0 if successful, otherwise an error code
openravepy.__init__.RaveLoadPlugin((str)filename) → bool
openravepy.__init__.RaveLog((str)log, (int)level) → None :

Send a log to the openrave system with excplicit level

openravepy.__init__.RaveLogDebug((str)log) → None :

Send a debug log to the openrave system

openravepy.__init__.RaveLogError((str)log) → None :

Send an error log to the openrave system

openravepy.__init__.RaveLogFatal((str)log) → None :

Send a fatal log to the openrave system

openravepy.__init__.RaveLogInfo((str)log) → None :

Send an info log to the openrave system

openravepy.__init__.RaveLogVerbose((str)log) → None :

Send a verbose log to the openrave system

openravepy.__init__.RaveLogWarn((str)log) → None :

Send a warn log to the openrave system

openravepy.__init__.RaveReloadPlugins() → None :

OPENRAVE_API void RaveReloadPlugins()

Reloads all the plugins.

The interfaces currently created remain will continue using the old plugins, so this function is safe in that plugins currently loaded remain loaded until the last interface that uses them is released.

openravepy.__init__.RaveSetDataAccess((object)accessoptions) → None :

OPENRAVE_API void RaveSetDataAccess(int accessoptions)

Sets the default data access options for cad resources/robot files.

Parameters
accessoptions -
  • if 1 will only allow resources inside directories specified from OPERNAVE_DATA environment variable. This allows reject of full paths from unsecure/unauthenticated resources. Controls how files are processed in functions like RaveFindLocalFile
openravepy.__init__.RaveSetDebugLevel((object)level) → None :

OPENRAVE_API void RaveSetDebugLevel(int level)

Sets the global openrave debug level. A combination of DebugLevel.
openravepy.__init__.axisAngleFromQuat((object)quat) → object :

RaveVector < T > axisAngleFromQuat(const RaveVector < T > & quat)

Converts a quaternion into the axis-angle representation.

Parameters
quat -
quaternion, (s,vx,vy,vz)
openravepy.__init__.axisAngleFromRotationMatrix((object)rotation) → object :

RaveVector < T > axisAngleFromMatrix(const RaveTransformMatrix < T > & rotation)

Converts the rotation of a matrix into axis-angle representation.

Parameters
rotation -
3x3 rotation matrix
openravepy.__init__.invertPoses((object)poses) → object :

Inverts a Nx7 array of poses where first 4 columns are the quaternion and last 3 are the translation components.

Parameters:poses – nx7 array
openravepy.__init__.matrixFromAxisAngle((object)axisangle) → object :

RaveTransformMatrix < T > matrixFromAxisAngle(const RaveVector < T > & axisangle)

Converts an axis-angle rotation to a 3x3 matrix.

Parameters
axis -
unit axis * rotation angle (radians), 3 values

matrixFromAxisAngle( (object)axis, (float)angle) -> object

openravepy.__init__.matrixFromPose((object)pose) → object :

Converts a 7 element quaterion+translation transform to a 4x4 matrix.

Parameters:pose – 7 values
openravepy.__init__.matrixFromPoses((object)poses) → object :

Converts a Nx7 element quaterion+translation array to a 4x4 matrices.

Parameters:poses – nx7 array
openravepy.__init__.matrixFromQuat((object)quat) → object :

Converts a quaternion to a 4x4 affine matrix.

Parameters:quat – 4 values
openravepy.__init__.matrixSerialization((object)transform) → str :

Serializes a transformation into a string representing a 3x4 matrix.

Parameters:transform – 3x4 or 4x4 array
openravepy.__init__.normalizeAxisRotation((object)axis, (object)quat) → object :

std::pair< T, RaveVector < T > > normalizeAxisRotation(const RaveVector < T > & axis, const RaveVector < T > & quat)

Find the rotation theta around axis such that rot(axis,theta) * q is closest to the identity rotation.

Parameters
axis -
axis to minimize rotation about
quat -
input
Return
The angle that minimizes the rotation along with the normalized rotation rot(axis,theta)*q
openravepy.__init__.openravepyCompilerVersion() → str :

Returns the compiler version that openravepy_int was compiled with

openravepy.__init__.poseFromMatrices((object)transforms) → object :

Converts an array/list of 4x4 matrices to a Nx7 array where each row is quaternion+translation representation.

Parameters:transforms – list of 3x4 or 4x4 affine matrices
openravepy.__init__.poseFromMatrix((object)transform) → object :

Converts a 4x4 matrix to a 7 element quaternion+translation representation.

Parameters:transform – 3x4 or 4x4 affine matrix
openravepy.__init__.poseMult((object)pose1, (object)pose2) → object :

multiplies two poses.

Parameters:
  • pose1 – 7 values
  • pose2 – 7 values
openravepy.__init__.poseSerialization((object)pose) → str :

Serializes a transformation into a string representing a quaternion with translation.

Parameters:pose – 7 values
openravepy.__init__.poseTransformPoints((object)pose, (object)points) → object :

left-transforms a set of points by a pose transformation.

Parameters:
  • pose – 7 values
  • points – Nx3 values
openravepy.__init__.quatFromAxisAngle((object)axisangle) → object :

RaveVector < T > quatFromAxisAngle(const RaveVector < T > & axisangle)

Converts an axis-angle rotation into a quaternion.

Parameters
axisangle -
unit axis * rotation angle (radians), 3 values

quatFromAxisAngle( (object)axis, (float)angle) -> object :

RaveVector < T > quatFromAxisAngle(const RaveVector < T > & axis, T angle)

Converts an axis-angle rotation into a quaternion.

Parameters
axis -
unit axis, 3 values
angle -
rotation angle (radians)
openravepy.__init__.quatFromRotationMatrix((object)rotation) → object :

RaveVector < T > quatFromMatrix(const RaveTransformMatrix < T > & rotation)

Converts the rotation of a matrix into a quaternion.

Parameters
t -
transform for extracting the 3x3 rotation.
openravepy.__init__.quatInverse((object)quat) → object :

RaveVector < T > quatInverse(const RaveVector < T > & quat)

Inverted a quaternion rotation.

Parameters
quat -
quaternion, (s,vx,vy,vz)
openravepy.__init__.quatMult((object)quat0, (object)quat1) → object :

RaveVector < T > quatMultiply(const RaveVector < T > & quat0, const RaveVector < T > & quat1)

Multiply two quaternions.

Parameters
quat0 -
quaternion, (s,vx,vy,vz)
quat1 -
quaternion, (s,vx,vy,vz)
openravepy.__init__.quatMultiply((object)quat0, (object)quat1) → object :

RaveVector < T > quatMultiply(const RaveVector < T > & quat0, const RaveVector < T > & quat1)

Multiply two quaternions.

Parameters
quat0 -
quaternion, (s,vx,vy,vz)
quat1 -
quaternion, (s,vx,vy,vz)
openravepy.__init__.quatRotateDirection((object)arg1, (object)sourcedir, targetdir) → object :

RaveVector < T > quatRotateDirection(const RaveVector < T > & sourcedir, const RaveVector < T > & targetdir)

Return the minimal quaternion that orients sourcedir to targetdir.

Parameters
sourcedir -
direction of the original vector, 3 values
targetdir -
new direction, 3 values
openravepy.__init__.quatSlerp((object)quat0, (object)quat1, (float)t) → object :

RaveVector < T > quatSlerp(const RaveVector < T > & quat0, const RaveVector < T > & quat1, T t)

Sphereical linear interpolation between two quaternions.

Parameters
quat0 -
quaternion, (s,vx,vy,vz)
quat1 -
quaternion, (s,vx,vy,vz)
t -
real value in [0,1]. 0 returns quat1, 1 returns quat2
openravepy.__init__.raveGetDebugLevel() → int :

OPENRAVE_API int RaveGetDebugLevel()

Returns the openrave debug level.
openravepy.__init__.raveLog((str)log, (int)level) → None :

Send a log to the openrave system with excplicit level

openravepy.__init__.raveLogDebug((str)log) → None :

Send a debug log to the openrave system

openravepy.__init__.raveLogError((str)log) → None :

Send an error log to the openrave system

openravepy.__init__.raveLogFatal((str)log) → None :

Send a fatal log to the openrave system

openravepy.__init__.raveLogInfo((str)log) → None :

Send an info log to the openrave system

openravepy.__init__.raveLogVerbose((str)log) → None :

Send a verbose log to the openrave system

openravepy.__init__.raveLogWarn((str)log) → None :

Send a warn log to the openrave system

openravepy.__init__.raveSetDebugLevel((object)level) → None :

OPENRAVE_API void RaveSetDebugLevel(int level)

Sets the global openrave debug level. A combination of DebugLevel.
openravepy.__init__.rotationMatrixFromAxisAngle((object)axisangle) → object :

RaveTransformMatrix < T > matrixFromAxisAngle(const RaveVector < T > & axisangle)

Converts an axis-angle rotation to a 3x3 matrix.

Parameters
axis -
unit axis * rotation angle (radians), 3 values

rotationMatrixFromAxisAngle( (object)axis, (float)angle) -> object

openravepy.__init__.rotationMatrixFromQArray((object)quatarray) → object :

Converts an array of quaternions to a list of 3x3 rotation matrices.

Parameters:quatarray – nx4 array
openravepy.__init__.rotationMatrixFromQuat((object)quat) → object :

RaveTransformMatrix < T > matrixFromQuat(const RaveVector < T > & quat)

Converts a quaternion to a 3x3 matrix.

Parameters
quat -
quaternion, (s,vx,vy,vz)
openravepy.__init__.transformLookat((object)lookat, (object)camerapos, (object)cameraup) → object :

Returns a camera matrix that looks along a ray with a desired up vector.

Parameters:
  • lookat – unit axis, 3 values
  • camerapos – 3 values
  • cameraup – unit axis, 3 values

Questions/Feedback

Having problems with OpenRAVE?