OpenRAVE Documentation

convexdecomposition Module

Convex decomposition of the link geometry of the robot.

../../_images/convexdecomposition.jpg

[source]

Running the Generator

openrave.py --database convexdecomposition --robot=robots/barrettsegway.robot.xml

Showing the Decomposition

openrave.py --database convexdecomposition --robot=robots/barrettsegway.robot.xml --show

Usage

Dynamically load the convex hulls for a robot:

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

Description

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

../../_images/convexdecomposition_wamenv.jpg

Command-line

Usage: openrave.py --database convexdecomposition [options]

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

Options:
  -h, --help            show this help message and exit
  --skinWidth=SKINWIDTH
                        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)
  --decompositionDepth=DECOMPOSITIONDEPTH
                        recursion depth for convex decomposition (default=8)
  --maxHullVertices=MAXHULLVERTICES
                        maximum number of vertices in output convex hulls
                        (default=64)
  --concavityThresholdPercent=CONCAVITYTHRESHOLDPERCENT
                        The percentage of concavity allowed without causing a
                        split to occur (default=5.0).
  --mergeThresholdPercent=MERGETHRESHOLDPERCENT
                        The percentage of volume difference allowed to merge
                        two convex hulls (default=30.0).
  --volumeSplitThresholdPercent=VOLUMESPLITTHRESHOLDPERCENT
                        The percentage of the total volume of the object above
                        which splits will still occur (default=5.0).
  --useInitialIslandGeneration=USEINITIALISLANDGENERATION
                        whether or not to perform initial island generation on
                        the input mesh (default=1).
  --useIslandGeneration=USEISLANDGENERATION
                        Whether or not to perform island generation at each
                        split.  Currently disabled due to bug in
                        RemoveTjunctions (default=0).

  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)
    --testmode          if set, will run the program in a finite amount of
                        time and spend computation time validating results.
                        Used for testing

  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)
    --numthreads=NUMTHREADS
                        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 PadMesh(vertices, indices, padding)[source]
static RunFromParser(Model=None, parser=None, **kwargs)[source]

Executes the ConvexDecompositionModel database generation

autogenerate(options=None)[source]
clone(envother)[source]
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]
getfilename(read=False)[source]
getversion()[source]
has()[source]
load()[source]
save()[source]
setrobot()[source]
show(options=None)[source]
testPointsInside(points)[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.

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.databases.convexdecomposition.run(*args, **kwargs)[source]

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

Questions/Feedback

Having problems with OpenRAVE?