openrave.org

目次

Questions? Suggestions?

Join the openrave-users mailing list

Digest:

Trac: Report bugs/request features

Reference

Core C++ API

Python API

Developers Guide

このページ

linkstatistics Module

Computes statistics on body links like swept volumes.

../_images/linkstatistics.jpg

[source]

Running the Generator

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

Showing the Swept Volumes

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

Command-line

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

Computes statistics about the link geometry

Options:
  -h, --help            show this help message and exit
  --samplingdelta=SAMPLINGDELTA
                        Skin width on the convex hulls generated
                        (default=0.02)

  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)

Description

When using link statics, it is possible to set the joints weights and resolutions so that planning is fastest. The xyzdelta parameter specifies the smallest object that can be found in the environment, this becomes the new discretization factor when checking collision. Higher values mean faster planning.

lmodel = databases.linkstatistics.LinkStatisticsModel(robot)
if not lmodel.load():
    lmodel.autogenerate()
lmodel.setRobotWeights()
lmodel.setRobotResolutions(xyzdelta=0.01)
print 'robot resolutions: ',repr(robot.GetDOFResolutions())
print 'robot weights: ',repr(robot.GetDOFWeights())

Class Definitions

class openravepy.databases.linkstatistics.LinkStatisticsModel(robot)[ソース]

ベースクラス: openravepy.databases.DatabaseGenerator

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

ComputeGeometryStatistics(hulls)[ソース]
static ComputeSweptVolume(volumepoints, axis, minangle, maxangle, samplingdelta)[ソース]

Compute the swept volume and mesh of volumepoints around rotated around an axis

static CreateOptionParser()[ソース]
LoadHDF5()[ソース]
LoadPickle()[ソース]
static PrunePointsKDTree(points, thresh2, neighsize, k=20)[ソース]

Prunes the poses so that every pose has at most neighsize neighbors within sqrt(thresh2) distance. In order to successfully compute the nearest neighbors, each pose’s quaternion is also negated. Input: thresh2 - squared threshold

static RunFromParser(Model=None, parser=None, **kwargs)[ソース]
SaveHDF5()[ソース]
SavePickle()[ソース]
static TransformJointPoints(joint, points, translation=array([ 0., 0., 0.]))[ソース]
autogenerate(options=None)[ソース]
generate(samplingdelta=None, **kwargs)[ソース]
getfilename(read=False)[ソース]
getversion()[ソース]
has()[ソース]
load()[ソース]
save()[ソース]
setRobotResolutions(xyzdelta=0.0050000000000000001)[ソース]

sets the robot resolution xyzdelta is the maxdistance allowed to be swept.

setRobotWeights(weightexp=0.33329999999999999, type=0, weightmult=10.0)[ソース]

sets the weights for the robot. weightexp is the exponent for the final weights to help reduce the max:min (default is 1/3 which results in 50:1) Weights should be proportional so that equal distances displace the same volume on average.

show(options=None)[ソース]
openravepy.databases.linkstatistics.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.linkstatistics.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.linkstatistics.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.databases.linkstatistics.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.databases.linkstatistics.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.databases.linkstatistics.run(*args, **kwargs)[ソース]

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