A configuration specification references values in the environment that then define a configuration-space which can be searched for. More...
#include <openrave.h>
Classes | |
class | Group |
A group referencing the values of one body in the environment. More... | |
class | Reader |
Public Types | |
typedef boost::function< void(const std::vector< dReal > &)> | SetConfigurationStateFn |
typedef boost::function< void(std::vector < dReal > &)> | GetConfigurationStateFn |
Public Member Functions | |
ConfigurationSpecification () | |
ConfigurationSpecification (const Group &g) | |
ConfigurationSpecification (const ConfigurationSpecification &c) | |
virtual | ~ConfigurationSpecification () |
virtual int | GetDOF () const |
return the dimension of the configuraiton space (degrees of freedom) | |
virtual bool | IsValid () const |
check if the groups form a continguous space | |
virtual void | Validate () const |
check if the groups form a continguous space | |
virtual bool | operator== (const ConfigurationSpecification &r) const |
virtual bool | operator!= (const ConfigurationSpecification &r) const |
virtual const Group & | GetGroupFromName (const std::string &name) const |
return the group whose name begins with a particular string. | |
virtual Group & | GetGroupFromName (const std::string &name) |
return the group whose name begins with a particular string. | |
virtual std::vector< Group > ::const_iterator | FindCompatibleGroup (const Group &g, bool exactmatch=false) const |
finds the most compatible group to the given group | |
virtual std::vector< Group > ::const_iterator | FindCompatibleGroup (const std::string &name, bool exactmatch=false) const |
finds the most compatible group to the given group | |
virtual std::vector< Group > ::const_iterator | FindTimeDerivativeGroup (const Group &g, bool exactmatch=false) const |
Return the most compatible group that represents the time-derivative data of the group. | |
virtual std::vector< Group > ::const_iterator | FindTimeDerivativeGroup (const std::string &name, bool exactmatch=false) const |
Return the most compatible group that represents the time-derivative data of the group. | |
virtual void | AddDerivativeGroups (int deriv, bool adddeltatime=false) |
adds velocity, acceleration, etc groups for every position group. | |
void | AddVelocityGroups (bool adddeltatime) RAVE_DEPRECATED |
virtual ConfigurationSpecification | ConvertToVelocitySpecification () const |
converts all the groups to the corresponding velocity groups and returns the specification | |
virtual ConfigurationSpecification | GetTimeDerivativeSpecification (int timederivative) const |
returns a new specification of just particular time-derivative groups. | |
virtual void | ResetGroupOffsets () |
set the offsets of each group in order to get a contiguous configuration space | |
virtual int | AddDeltaTimeGroup () |
adds the deltatime tag to the end if one doesn't exist and returns the index into the configuration space | |
virtual int | AddGroup (const std::string &name, int dof, const std::string &interpolation="") |
Adds a new group to the specification and returns its new offset. | |
virtual ConfigurationSpecification & | operator+= (const ConfigurationSpecification &r) |
Merges all the information from the input group into this group. | |
virtual ConfigurationSpecification | operator+ (const ConfigurationSpecification &r) const |
Return a new specification that holds the merged information from the current and input specification and the input parameter.. | |
virtual bool | ExtractTransform (Transform &t, std::vector< dReal >::const_iterator itdata, KinBodyConstPtr pbody, int timederivative=0) const |
extracts an affine transform given the start of a configuration space point | |
virtual bool | ExtractIkParameterization (IkParameterization &ikparam, std::vector< dReal >::const_iterator itdata, int timederivative=0) const |
extracts an ikparameterization given the start of a configuration space point | |
virtual bool | ExtractAffineValues (std::vector< dReal >::iterator itvalues, std::vector< dReal >::const_iterator itdata, KinBodyConstPtr pbody, int affinedofs, int timederivative=0) const |
extracts the affine values | |
virtual bool | ExtractJointValues (std::vector< dReal >::iterator itvalues, std::vector< dReal >::const_iterator itdata, KinBodyConstPtr pbody, const std::vector< int > &indices, int timederivative=0) const |
extracts a body's joint values given the start of a configuration space point | |
virtual bool | ExtractDeltaTime (dReal &deltatime, std::vector< dReal >::const_iterator itdata) const |
extracts the delta time from the configuration if one exists | |
virtual bool | InsertJointValues (std::vector< dReal >::iterator itdata, std::vector< dReal >::const_iterator itvalues, KinBodyConstPtr pbody, const std::vector< int > &indices, int timederivative=0) const |
inserts a set of joint values into a configuration space point | |
virtual bool | InsertDeltaTime (std::vector< dReal >::iterator itdata, dReal deltatime) const |
sets the deltatime field of the data if one exists | |
virtual int | AddGroup (const Group &g) |
Adds a new group to the specification and returns its new offset. | |
virtual boost::shared_ptr < SetConfigurationStateFn > | GetSetFn (EnvironmentBasePtr penv) const |
return a function to set the states of the configuration in the environment | |
virtual boost::shared_ptr < GetConfigurationStateFn > | GetGetFn (EnvironmentBasePtr penv) const |
return a function to get the states of the configuration in the environment | |
Static Public Member Functions | |
static void | ConvertGroupData (std::vector< dReal >::iterator ittargetdata, size_t targetstride, const Group >arget, std::vector< dReal >::const_iterator itsourcedata, size_t sourcestride, const Group &gsource, size_t numpoints, EnvironmentBaseConstPtr penv, bool filluninitialized=true) |
given two compatible groups, convers data represented in the source group to data represented in the target group | |
static void | ConvertData (std::vector< dReal >::iterator ittargetdata, const ConfigurationSpecification &targetspec, std::vector< dReal >::const_iterator itsourcedata, const ConfigurationSpecification &sourcespec, size_t numpoints, EnvironmentBaseConstPtr penv, bool filluninitialized=true) |
Converts from one specification to another. | |
static std::string | GetInterpolationDerivative (const std::string &interpolation, int deriv=1) |
gets the name of the interpolation that represents the derivative of the passed in interpolation. | |
Public Attributes | |
std::vector< Group > | _vgroups |
A configuration specification references values in the environment that then define a configuration-space which can be searched for.
It is composed of several groups targetting values for individual bodies. It is serialized into XML. The XML syntax is as follows:
Definition at line 940 of file openrave.h.
typedef boost::function<void (std::vector<dReal>&)> OpenRAVE::ConfigurationSpecification::GetConfigurationStateFn |
Definition at line 1207 of file openrave.h.
typedef boost::function<void (const std::vector<dReal>&)> OpenRAVE::ConfigurationSpecification::SetConfigurationStateFn |
Definition at line 1206 of file openrave.h.
OpenRAVE::ConfigurationSpecification::ConfigurationSpecification | ( | ) |
OpenRAVE::ConfigurationSpecification::ConfigurationSpecification | ( | const Group & | g | ) |
OpenRAVE::ConfigurationSpecification::ConfigurationSpecification | ( | const ConfigurationSpecification & | c | ) |
|
inlinevirtual |
Definition at line 1009 of file openrave.h.
|
virtual |
adds the deltatime tag to the end if one doesn't exist and returns the index into the configuration space
|
virtual |
adds velocity, acceleration, etc groups for every position group.
If the derivative groups already exist, they are checked for and/or modified. Note that the configuration space might be re-ordered as a result of this function call. If a new group is added, its interpolation will be the derivative of the position group as returned by GetInterpolationDerivative.
deriv | The position derivative to add, this must be greater than 0. If 2 is specified, only the acceleration groups of the alread present position groups will be added. |
adddeltatime | If true will add the 'deltatime' tag, which is necessary for trajectory sampling |
|
virtual |
Adds a new group to the specification and returns its new offset.
If the new group's semantic name does not exist in the current specification, adds it and returns the new offset. If the new group's semantic name exists in the current specification and it exactly matches, then function returns the old group's index. If the semantic names match, but parameters do not match, then an openrave_exception is thrown. This method is not responsible for merging semantic information
|
virtual |
Adds a new group to the specification and returns its new offset.
g | the group whose name, dof, and interpolation are extracted. If the new group's semantic name does not exist in the current specification, adds it and returns the new offset. If the new group's semantic name exists in the current specification and it exactly matches, then function returns the old group's index. If the semantic names match, but parameters do not match, then an openrave_exception is thrown. This method is not responsible for merging semantic information |
|
inline |
Definition at line 1085 of file openrave.h.
|
static |
Converts from one specification to another.
ittargetdata | iterator pointing to start of target group data that should be overwritten |
targetspec | the target configuration specification |
itsourcedata | iterator pointing to start of source group data that should be read |
sourcespec | the source configuration specification |
numpoints | the number of points to convert. The target and source strides are gtarget.dof and gsource.dof |
penv | [optional] The environment which might be needed to fill in unknown data. Assumes environment is locked. |
filluninitialized | If there exists target groups that cannot be initialized, then will set default values using the current environment. For example, the current joint values of the body will be used. |
|
static |
given two compatible groups, convers data represented in the source group to data represented in the target group
ittargetdata | iterator pointing to start of target group data that should be overwritten |
targetstride | the number of elements that to go from the next target point. Necessary if numpoints > 1. |
gtarget | the target configuration group |
itsourcedata | iterator pointing to start of source group data that should be read |
sourcestride | the number of elements that to go from the next source point. Necessary if numpoints > 1. |
gsource | the source configuration group |
numpoints | the number of points to convert. The target and source strides are gtarget.dof and gsource.dof |
penv | [optional] The environment which might be needed to fill in unknown data. Assumes environment is locked. |
filluninitialized | If there exists target groups that cannot be initialized, then will set default values using the current environment. For example, the current joint values of the body will be used. |
openrave_exception | throw f groups are incompatible |
|
virtual |
converts all the groups to the corresponding velocity groups and returns the specification
The velocity configuration space will have a one-to-one correspondence with the original configuration. The interpolation of each of the groups will correspondingly represent the derivative as returned by GetInterpolationDerivative. Only position specifications will be converted, any other groups will be left untouched.
|
virtual |
extracts the affine values
Looks for 'affine_X' groups. If pbody is not initialized, will choose the first affine_X found.
inout] | itvalues iterator to vector that holds the default values and will be overwritten with the new values. must be initialized | |
[in] | itdata | data in the format of this configuration specification. |
[in] | affinedofs | the format of the affine dofs requested |
[in] | timederivative | the time derivative of the data to extract |
|
virtual |
extracts the delta time from the configuration if one exists
|
virtual |
extracts an ikparameterization given the start of a configuration space point
Looks for 'ikparam' groups.
inout] | ikparam filled with ikparameterization (if found) | |
[in] | itdata | data in the format of this configuration specification |
[in] | timederivative | the time derivative of the data to extract |
|
virtual |
extracts a body's joint values given the start of a configuration space point
Looks for 'joint_X' groups. If pbody is not initialized, will choose the first joint_X found.
inout] | itvalues iterator to vector that holds the default values and will be overwritten with the new values. must be initialized | |
[in] | itdata | data in the format of this configuration specification. |
[in] | indices | the set of DOF indices of the body to extract and write into itvalues. |
[in] | timederivative | the time derivative of the data to extract |
|
virtual |
extracts an affine transform given the start of a configuration space point
Looks for 'affine_transform' groups. If pbody is not initialized, will choose the first affine_transform found.
inout] | t the transform holding the default values, which will be overwritten with the new values. | |
[in] | itdata | data in the format of this configuration specification. |
[in] | timederivative | the time derivative of the data to extract |
|
virtual |
finds the most compatible group to the given group
g | the group to query, only the Group::name and Group::dof values are used |
exactmatch | if true, will only return groups whose name exactly matches with g.name |
|
virtual |
finds the most compatible group to the given group
name | the name of the group to query |
exactmatch | if true, will only return groups whose name exactly matches with g.name |
|
virtual |
Return the most compatible group that represents the time-derivative data of the group.
For example given a 'joint_values' group, this will return the closest 'joint_velocities' group.
g | the group to query, only the Group::name and Group::dof values are used |
exactmatch | if true, will only return groups whose name exactly matches with g.name |
|
virtual |
Return the most compatible group that represents the time-derivative data of the group.
For example given a 'joint_values' group, this will return the closest 'joint_velocities' group.
name | the name of the group to query |
exactmatch | if true, will only return groups whose name exactly matches with g.name |
|
virtual |
return the dimension of the configuraiton space (degrees of freedom)
|
virtual |
return a function to get the states of the configuration in the environment
|
virtual |
return the group whose name begins with a particular string.
If multiple groups exist that begin with the same string, then the shortest one is returned.
openrave_exception | if a group is not found |
|
virtual |
return the group whose name begins with a particular string.
If multiple groups exist that begin with the same string, then the shortest one is returned.
openrave_exception | if a group is not found |
|
static |
gets the name of the interpolation that represents the derivative of the passed in interpolation.
For example GetInterpolationDerivative("quadratic") -> "linear"
interpolation | the interpolation to start at |
deriv | the number of derivatives to take, should be > 0 |
|
virtual |
return a function to set the states of the configuration in the environment
|
virtual |
returns a new specification of just particular time-derivative groups.
timederivative | the time derivative to query groups from. 0 is positions/joint values, 1 is velocities, 2 is accelerations, etc |
|
virtual |
sets the deltatime field of the data if one exists
inout] | itdata data in the format of this configuration specification. | |
[in] | deltatime | the delta time of the time stamp (from previous point) |
|
virtual |
inserts a set of joint values into a configuration space point
Looks for 'joint_X' groups. If pbody is not initialized, will use the first joint_X found.
inout] | itdata data in the format of this configuration specification. | |
[in] | itvalues | iterator to joint values to write |
[in] | indices | the set of DOF indices that itvalues represents. |
[in] | timederivative | the time derivative of the data to insert |
|
virtual |
check if the groups form a continguous space
If there are two or more groups with the same semantic names, will fail. Theese groups should be merged into one.
|
virtual |
|
virtual |
Return a new specification that holds the merged information from the current and input specification and the input parameter..
For groups that are merged, the interpolation either has to match for both groups, or one of the groups needs an empty interpolation.
openrave_exception | throws if groups do not contain enough information to be merged or interpolations do not match. |
|
virtual |
Merges all the information from the input group into this group.
For groups that are merged, the interpolation is overwritten if the source group has an empty string.
openrave_exception | throws if groups do not contain enough information to be merged or interpolations do not match. |
|
virtual |
|
virtual |
set the offsets of each group in order to get a contiguous configuration space
|
virtual |
check if the groups form a continguous space
If there are two or more groups with the same semantic names, will fail. Theese groups should be merged into one.
openrave_exception | if not valid |
std::vector<Group> OpenRAVE::ConfigurationSpecification::_vgroups |
Definition at line 1249 of file openrave.h.