Computes statistics on body links like swept volumes.
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
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)
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())
Bases: openravepy.databases.DatabaseGenerator
Computes the convex decomposition of all of the robot’s links
Compute the swept volume and mesh of volumepoints around rotated around an axis
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
sets the robot resolution xyzdelta is the maxdistance allowed to be swept.
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.
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.
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.
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
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
RaveTransformMatrix < T > matrixFromQuat(const RaveVector < T > & quat)
Converts a quaternion to a 3x3 matrix.
- Parameters
- quat -
- quaternion, (s,vx,vy,vz)