OpenRAVE Documentation

convexdecomposition Module

Convex decomposition of the link geometry of the robot.



Running the Generator --database convexdecomposition --robot=robots/barrettsegway.robot.xml

Showing the Decomposition --database convexdecomposition --robot=robots/barrettsegway.robot.xml --show


Dynamically load the convex hulls for a robot:

cdmodel = openravepy.databases.convexdecomposition.ConvexDecompositionModel(robot)
if not cdmodel.load():


Approximates each of the links with a set of convex hulls using John Ratcliff’s convexdecomposition library.



Usage: --database convexdecomposition [options]

Computes the set of convex hulls for each triangle mesh geometry.using convexdecomposition

  -h, --help            show this help message and exit
                        Skin width on the convex hulls generated, convex decomposition side (default=0.0)
  --padding=PADDING     The distance to move the hull planes along their respective normals (default=0.005)
                        recursion depth for convex decomposition (default=8)
                        maximum number of vertices in output convex hulls (default=64)
                        The percentage of concavity allowed without causing a split to occur (default=5.0).
                        The percentage of volume difference allowed to merge two convex hulls (default=30.0).
                        The percentage of the total volume of the object above which splits will still occur (default=5.0).
                        whether or not to perform initial island generation on the input mesh (default=1).
                        Whether or not to perform island generation at each split.  Currently disabled due to bug in RemoveTjunctions

  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 (fatal,error,warn,info,debug,verbose,verifyplans)
    --testmode          if set, will run the program in a finite amount of time and spend computation time validating results. Used for

  OpenRAVE Database Generator General Options:
    --show              Graphically shows the built model
    --getfilename       If set, will return the final database filename where all data is stored
    --gethas            If set, will exit with 0 if datafile is generated and up to date, otherwise will return a 1. This will require
                        loading the model and checking versions, so might be a little slow.
    --robot=ROBOT       OpenRAVE robot to load (default=robots/barrettsegway.robot.xml)
                        number of threads to compute the database with (default=1)

Class Definitions

class openravepy.databases.convexdecomposition.ConvexDecompositionModel(robot)[source]

Bases: openravepy.databases.DatabaseGenerator

Computes the convex decomposition of all of the robot’s links

static CreateOptionParser()[source]
static RunFromParser(Model=None, parser=None, **kwargs)[source]

Executes the ConvexDecompositionModel database generation

static computeHullPlanes(hull, thresh=0.99999000000000005)[source]

The computed planes point outside of the mesh. Therefore a point is inside only if the distance to all planes is negative.

generate(padding=None, **kwargs)[source]
static generateTrimeshFromHulls(hulls)[source]
static padMesh(vertices, indices, padding)[source]

tests if a point is inside the convex mesh of the robot.

Returns an array the same length as points that specifies whether the point is in or not. This method is not meant to be optimized (use C++ for that).

static transformHull(T, hull)[source]

hull can be (vertices,indices) or (vertices,indices,planes)

openravepy.databases.convexdecomposition.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.databases.convexdecomposition.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.

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.
a non-empty string if a file could be found.*args, **kwargs)[source]

Command-line execution of the example. args specifies a list of the arguments to the script.


Having problems with OpenRAVE?