OpenRAVE Documentation

misc Module

Misc openravepy functions. Need to explicitly import to use them.

openravepy.misc.CompareBodies(body0, body1, comparegeometries=True, comparesensors=True, comparemanipulators=True, comparegrabbed=True, comparephysics=True, epsilon=1e-10)[source]

Compares that two bodies are structurally and positionally equivalent without hashes, used for debug checking.

openravepy.misc.CompareEnvironments(env, env2, options=openravepy.openravepy_int.CloningOptions.Bodies, epsilon=1e-10)[source]

compares two state of two environments and raises exceptions if anything is different, used for debugging.

Structural information of bodies is compared with hashes.


Computes a box mesh

openravepy.misc.ComputeCylinderYMesh(radius, height, angledelta=0.10000000000000001)[source]

Computes a mesh of a cylinder oriented towards y-axis

openravepy.misc.ComputeGeodesicSphereMesh(radius=1.0, level=2)[source]

Computes a geodesic sphere to a specified level. Returns the vertices and triangle indices

openravepy.misc.DrawAxes(env, target, dist=1.0, linewidth=1)[source]

draws xyz coordinate system around target.

Parameters:target – can be a 7 element pose, 4x4 matrix, or the name of a kinbody in the environment
openravepy.misc.DrawIkparam(env, ikparam, dist=1.0, linewidth=1)[source]

draws an IkParameterization


Sets the python logging openravepy scope to the same debug level as OpenRAVE and initializes handles if they are not present

openravepy.misc.LoadTrajectoryFromFile(env, trajfile, trajtype='')[source]
class openravepy.misc.MultiManipIKSolver(manips)[source]

Finds the simultaneous IK solutions of all disjoint manipulators (no manipulators share a joint).

The class is extremely useful in dual-manipulation IK solutions. It also handled grabbed bodies correctly.

findMultiIKSolution(Tgrasps, filteroptions=openravepy.openravepy_int.IkFilterOptions.CheckEnvCollisions, dooptimize=False)[source]

Return one set collision-free ik solutions for all manipulators.

Method always checks self-collisions.

  • Tgrasps – a list of all the end effector transforms of each of the manipualtors
  • filteroptions – a bitmask of IkFilterOptions
class openravepy.misc.OpenRAVEGlobalArguments[source]

manages a global set of command-line options applicable to all openrave environments

static addOptions(parser, testmode=True)[source]
static parseAndCreate(options, createenv=<class 'openravepy.openravepy_int.Environment'>, returnviewer=False, **kwargs)[source]

Parse all options and create the global Environment. The left over arguments are passed to the parse functions. If returnviewer is False, the viewer is created in a separate thread, so this method will not work for MacOSX if this is the main executing thread.

static parseAndCreateThreadedUser(options, userfn, createenv=<class 'openravepy.openravepy_int.Environment'>, returnviewer=True, **kwargs)[source]

Parse all options and create the global Environment. The left over arguments are passed to the parse functions. If a viewer is requested, it is created in this thread, and another thread is executed with the user function. This is required for OSes that require viewer thread to be in main thread (Mac OSX) :param userfn: Call with userfn(env,options) :return: nothing

static parseEnvironment(options, env, defaultviewer=False, returnviewer=False, **kwargs)[source]

Parses all options that affect the environment. If returnviewer is set, will return the viewer to set instead of setting it

static parseGlobal(options, **kwargs)[source]

Parses all global options independent of the environment

openravepy.misc.SetViewerUserThread(env, viewername, userfn)[source]

Adds a viewer to the environment if one doesn’t exist yet and starts it on this thread. Then creates a new thread to call the user-defined function to continue computation. This function will return when the viewer and uesrfn exits. If userfn exits first, then will quit the viewer

class openravepy.misc.SpaceSamplerExtra[source]
static computeSepration(qarray)[source]

used to test separation of a set of quaternions

static hopf2quat(hopfarray)[source]

convert hopf rotation coordinates to quaternion

static sampleR3(averagedist, boxdims)[source]

low-discrepancy sampling using primes. The samples are evenly distributed with an average distance of averagedist inside the box with dimensions boxdims. Algorithim from “Geometric Discrepancy: An Illustrated Guide” by Jiri Matousek

static sampleR3lattice(averagedist, boxdims)[source]

low-discrepancy lattice sampling in using the roots of x^3-3x+1. The samples are evenly distributed with an average distance of averagedist inside the box with extents boxextents. Algorithim from “Geometric Discrepancy: An Illustrated Guide” by Jiri Matousek

sampleS2(level=0, angledelta=None)[source]

uses healpix algorithm with ordering from Yershova et. al. 2009 journal paper

sampleSO3(level=0, quatdelta=None)[source]

Uniformly Sample 3D Rotations. If quatdelta is specified, will compute the best level aiming for that average quaternion distance. Algorithm From A. Yershova, S. Jain, S. LaValle, J. Mitchell “Generating Uniform Incremental Grids on SO(3) Using the Hopf Fibration”, International Journal of Robotics Research, Nov 13, 2009.

openravepy.misc.TSP(solutions, distfn)[source]

solution to travelling salesman problem. orders the set of solutions such that visiting them one after another is fast.


iterates through the cross product of all items in the sequences


Having problems with OpenRAVE?