openrave.org

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | Protected Attributes | Friends | List of all members
OpenRAVE::IkParameterization Class Reference

Parameterization of basic primitives for querying inverse-kinematics solutions. More...

#include <openrave.h>

Collaboration diagram for OpenRAVE::IkParameterization:
Collaboration graph
[legend]

Public Types

typedef IkParameterizationType Type RAVE_DEPRECATED
 

Public Member Functions

 IkParameterization ()
 
 IkParameterization (const Transform &t)
 sets a 6D transform parameterization
 
 IkParameterization (const RAY &r)
 sets a ray parameterization
 
 IkParameterization (const Transform &t, IkParameterizationType type)
 set a custom parameterization using a transform as the source of the data. Not all types are supported with this method.
 
IkParameterizationType GetType () const
 
const std::string & GetName () const
 returns a string version of GetType
 
int GetDOF () const
 Returns the minimum degree of freedoms required for the IK type. Does not count custom data.
 
int GetNumberOfValues () const
 Returns the number of values used to represent the parameterization ( >= dof ). Does not count custom data.
 
void SetTransform6D (const Transform &t)
 
void SetRotation3D (const Vector &quaternion)
 
void SetTranslation3D (const Vector &trans)
 
void SetDirection3D (const Vector &dir)
 
void SetRay4D (const RAY &ray)
 
void SetLookat3D (const Vector &trans)
 
void SetLookat3D (const RAY &ray)
 the ray direction is not used for IK, however it is needed in order to compute the error
 
void SetTranslationDirection5D (const RAY &ray)
 
void SetTranslationXY2D (const Vector &trans)
 
void SetTranslationXYOrientation3D (const Vector &trans)
 
void SetTranslationLocalGlobal6D (const Vector &localtrans, const Vector &trans)
 
void SetTranslationXAxisAngle4D (const Vector &trans, dReal angle)
 
void SetTranslationYAxisAngle4D (const Vector &trans, dReal angle)
 
void SetTranslationZAxisAngle4D (const Vector &trans, dReal angle)
 
void SetTranslationXAxisAngleZNorm4D (const Vector &trans, dReal angle)
 
void SetTranslationYAxisAngleXNorm4D (const Vector &trans, dReal angle)
 
void SetTranslationZAxisAngleYNorm4D (const Vector &trans, dReal angle)
 
const TransformGetTransform6D () const
 
const VectorGetRotation3D () const
 
const VectorGetTranslation3D () const
 
const VectorGetDirection3D () const
 
const RAY GetRay4D () const
 
const VectorGetLookat3D () const
 
const VectorGetLookat3DDirection () const
 
const RAY GetTranslationDirection5D () const
 
const VectorGetTranslationXY2D () const
 
const VectorGetTranslationXYOrientation3D () const
 
std::pair< Vector, VectorGetTranslationLocalGlobal6D () const
 
std::pair< Vector, dRealGetTranslationXAxisAngle4D () const
 
std::pair< Vector, dRealGetTranslationYAxisAngle4D () const
 
std::pair< Vector, dRealGetTranslationZAxisAngle4D () const
 
std::pair< Vector, dRealGetTranslationXAxisAngleZNorm4D () const
 
std::pair< Vector, dRealGetTranslationYAxisAngleXNorm4D () const
 
std::pair< Vector, dRealGetTranslationZAxisAngleYNorm4D () const
 
dReal ComputeDistanceSqr (const IkParameterization &ikparam) const
 Computes the distance squared between two IK parmaeterizations.
 
void GetValues (std::vector< dReal >::iterator itvalues) const
 fills the iterator with the serialized values of the ikparameterization.
 
void SetValues (std::vector< dReal >::const_iterator itvalues, IkParameterizationType iktype)
 sets a serialized set of values for the IkParameterization
 
void Set (std::vector< dReal >::const_iterator itvalues, IkParameterizationType iktype)
 
void SetCustomValues (const std::string &name, const std::vector< dReal > &values)
 sets named custom data in the ik parameterization
 
void SetCustomValue (const std::string &name, dReal value)
 sets named custom data in the ik parameterization (
 
bool GetCustomValues (const std::string &name, std::vector< dReal > &values) const
 gets custom data if it exists, returns false if it doesn't
 
const std::map< std::string,
std::vector< dReal > > & 
GetCustomDataMap () const
 returns a const reference of the custom data key/value pairs
 
size_t ClearCustomValues (const std::string &name=std::string())
 clears custom data
 
ConfigurationSpecification GetConfigurationSpecification (const std::string &interpolation="") const
 
IkParameterizationMultiplyTransform (const Transform &t)
 in-place left-transform into a new coordinate system. Equivalent to t * ikparam
 
IkParameterizationMultiplyTransformRight (const Transform &t)
 in-place right-transform into a new coordinate system. Equivalent to ikparam*t
 
IkParameterization operator* (const Transform &t) const
 

Static Public Member Functions

static int GetDOF (IkParameterizationType type)
 Returns the minimum degree of freedoms required for the IK type. Does not count custom data.
 
static int GetNumberOfValues (IkParameterizationType type)
 Returns the number of values used to represent the parameterization ( >= dof ). Does not count custom data.
 
static ConfigurationSpecification GetConfigurationSpecification (IkParameterizationType iktype, const std::string &interpolation="")
 

Static Public Attributes

static const
IkParameterizationType
Type_None 
RAVE_DEPRECATED = IKP_None
 
static const
IkParameterizationType
Type_Transform6D 
RAVE_DEPRECATED = IKP_Transform6D
 
static const
IkParameterizationType
Type_Rotation3D 
RAVE_DEPRECATED =IKP_Rotation3D
 
static const
IkParameterizationType
Type_Translation3D 
RAVE_DEPRECATED =IKP_Translation3D
 
static const
IkParameterizationType
Type_Direction3D 
RAVE_DEPRECATED = IKP_Direction3D
 
static const
IkParameterizationType
Type_Ray4D 
RAVE_DEPRECATED = IKP_Ray4D
 
static const
IkParameterizationType
Type_Lookat3D 
RAVE_DEPRECATED = IKP_Lookat3D
 
static const
IkParameterizationType
Type_TranslationDirection5D 
RAVE_DEPRECATED = IKP_TranslationDirection5D
 
static const
IkParameterizationType
Type_TranslationXY2D 
RAVE_DEPRECATED = IKP_TranslationXY2D
 
static const
IkParameterizationType
Type_TranslationXYOrientation3D 
RAVE_DEPRECATED = IKP_TranslationXYOrientation3D
 
static const
IkParameterizationType
Type_TranslationLocalGlobal6D 
RAVE_DEPRECATED = IKP_TranslationLocalGlobal6D
 
static const
IkParameterizationType
Type_NumberOfParameterizations 
RAVE_DEPRECATED = IKP_NumberOfParameterizations
 

Static Protected Member Functions

static bool _IsValidCharInName (char c)
 
static void _MultiplyTransform (const Transform &t, const std::string &name, std::vector< dReal > &values)
 
static void _MultiplyTransformRight (const Transform &t, const std::string &name, std::vector< dReal > &values)
 

Protected Attributes

Transform _transform
 
IkParameterizationType _type
 
std::map< std::string,
std::vector< dReal > > 
_mapCustomData
 

Friends

IkParameterization operator* (const Transform &t, const IkParameterization &ikparam)
 
OPENRAVE_API std::ostream & operator<< (std::ostream &O, const IkParameterization &ikparam)
 
OPENRAVE_API std::istream & operator>> (std::istream &I, IkParameterization &ikparam)
 

Detailed Description

Parameterization of basic primitives for querying inverse-kinematics solutions.

Holds the parameterization of a geometric primitive useful for autonomous manipulation scenarios like: 6D pose, 3D translation, 3D rotation, 3D look at direction, and ray look at direction.

Examples:
ikfastloader.cpp, orikfilter.cpp, orplanning_door.cpp, and orpr2turnlever.cpp.

Definition at line 1284 of file openrave.h.

Member Typedef Documentation

Deprecated:
(11/10/12)

Definition at line 1288 of file openrave.h.

Constructor & Destructor Documentation

OpenRAVE::IkParameterization::IkParameterization ( )
inline

Definition at line 1302 of file openrave.h.

OpenRAVE::IkParameterization::IkParameterization ( const Transform t)
inline

sets a 6D transform parameterization

Definition at line 1305 of file openrave.h.

OpenRAVE::IkParameterization::IkParameterization ( const RAY r)
inline

sets a ray parameterization

Definition at line 1309 of file openrave.h.

OpenRAVE::IkParameterization::IkParameterization ( const Transform t,
IkParameterizationType  type 
)
inline

set a custom parameterization using a transform as the source of the data. Not all types are supported with this method.

Definition at line 1313 of file openrave.h.

Member Function Documentation

static bool OpenRAVE::IkParameterization::_IsValidCharInName ( char  c)
inlinestaticprotected

Definition at line 2139 of file openrave.h.

static void OpenRAVE::IkParameterization::_MultiplyTransform ( const Transform t,
const std::string &  name,
std::vector< dReal > &  values 
)
inlinestaticprotected

Definition at line 2142 of file openrave.h.

static void OpenRAVE::IkParameterization::_MultiplyTransformRight ( const Transform t,
const std::string &  name,
std::vector< dReal > &  values 
)
inlinestaticprotected

Definition at line 2183 of file openrave.h.

size_t OpenRAVE::IkParameterization::ClearCustomValues ( const std::string &  name = std::string())
inline

clears custom data

Parameters
nameif name is empty, will clear all the data, otherwise will clear only the custom data with that name
Returns
number of elements erased

Definition at line 1806 of file openrave.h.

dReal OpenRAVE::IkParameterization::ComputeDistanceSqr ( const IkParameterization ikparam) const
inline

Computes the distance squared between two IK parmaeterizations.

Definition at line 1469 of file openrave.h.

ConfigurationSpecification OpenRAVE::IkParameterization::GetConfigurationSpecification ( IkParameterizationType  iktype,
const std::string &  interpolation = "" 
)
static
Examples:
orpr2turnlever.cpp.

Definition at line 1139 of file libopenrave.cpp.

ConfigurationSpecification OpenRAVE::IkParameterization::GetConfigurationSpecification ( const std::string &  interpolation = "") const
inline

Definition at line 1819 of file openrave.h.

const std::map<std::string, std::vector<dReal> >& OpenRAVE::IkParameterization::GetCustomDataMap ( ) const
inline

returns a const reference of the custom data key/value pairs

Definition at line 1797 of file openrave.h.

bool OpenRAVE::IkParameterization::GetCustomValues ( const std::string &  name,
std::vector< dReal > &  values 
) const
inline

gets custom data if it exists, returns false if it doesn't

Definition at line 1786 of file openrave.h.

const Vector& OpenRAVE::IkParameterization::GetDirection3D ( ) const
inline

Definition at line 1425 of file openrave.h.

static int OpenRAVE::IkParameterization::GetDOF ( IkParameterizationType  type)
inlinestatic

Returns the minimum degree of freedoms required for the IK type. Does not count custom data.

Definition at line 1333 of file openrave.h.

int OpenRAVE::IkParameterization::GetDOF ( ) const
inline

Returns the minimum degree of freedoms required for the IK type. Does not count custom data.

Definition at line 1337 of file openrave.h.

const Vector& OpenRAVE::IkParameterization::GetLookat3D ( ) const
inline

Definition at line 1431 of file openrave.h.

const Vector& OpenRAVE::IkParameterization::GetLookat3DDirection ( ) const
inline

Definition at line 1434 of file openrave.h.

const std::string & OpenRAVE::IkParameterization::GetName ( ) const
inline

returns a string version of GetType

Definition at line 2737 of file openrave.h.

static int OpenRAVE::IkParameterization::GetNumberOfValues ( IkParameterizationType  type)
inlinestatic

Returns the number of values used to represent the parameterization ( >= dof ). Does not count custom data.

Examples:
orpr2turnlever.cpp.

Definition at line 1342 of file openrave.h.

int OpenRAVE::IkParameterization::GetNumberOfValues ( ) const
inline

Returns the number of values used to represent the parameterization ( >= dof ). Does not count custom data.

Definition at line 1346 of file openrave.h.

const RAY OpenRAVE::IkParameterization::GetRay4D ( ) const
inline

Definition at line 1428 of file openrave.h.

const Vector& OpenRAVE::IkParameterization::GetRotation3D ( ) const
inline

Definition at line 1419 of file openrave.h.

const Transform& OpenRAVE::IkParameterization::GetTransform6D ( ) const
inline
Examples:
orplanning_door.cpp.

Definition at line 1416 of file openrave.h.

const Vector& OpenRAVE::IkParameterization::GetTranslation3D ( ) const
inline

Definition at line 1422 of file openrave.h.

const RAY OpenRAVE::IkParameterization::GetTranslationDirection5D ( ) const
inline

Definition at line 1437 of file openrave.h.

std::pair<Vector,Vector> OpenRAVE::IkParameterization::GetTranslationLocalGlobal6D ( ) const
inline

Definition at line 1446 of file openrave.h.

std::pair<Vector,dReal> OpenRAVE::IkParameterization::GetTranslationXAxisAngle4D ( ) const
inline

Definition at line 1449 of file openrave.h.

std::pair<Vector,dReal> OpenRAVE::IkParameterization::GetTranslationXAxisAngleZNorm4D ( ) const
inline

Definition at line 1458 of file openrave.h.

const Vector& OpenRAVE::IkParameterization::GetTranslationXY2D ( ) const
inline

Definition at line 1440 of file openrave.h.

const Vector& OpenRAVE::IkParameterization::GetTranslationXYOrientation3D ( ) const
inline

Definition at line 1443 of file openrave.h.

std::pair<Vector,dReal> OpenRAVE::IkParameterization::GetTranslationYAxisAngle4D ( ) const
inline

Definition at line 1452 of file openrave.h.

std::pair<Vector,dReal> OpenRAVE::IkParameterization::GetTranslationYAxisAngleXNorm4D ( ) const
inline

Definition at line 1461 of file openrave.h.

std::pair<Vector,dReal> OpenRAVE::IkParameterization::GetTranslationZAxisAngle4D ( ) const
inline

Definition at line 1455 of file openrave.h.

std::pair<Vector,dReal> OpenRAVE::IkParameterization::GetTranslationZAxisAngleYNorm4D ( ) const
inline

Definition at line 1464 of file openrave.h.

IkParameterizationType OpenRAVE::IkParameterization::GetType ( ) const
inline

Definition at line 1325 of file openrave.h.

void OpenRAVE::IkParameterization::GetValues ( std::vector< dReal >::iterator  itvalues) const
inline

fills the iterator with the serialized values of the ikparameterization.

The container the iterator points to needs to have GetNumberOfValues() available. Does not support custom data Don't normalize quaternions since it could hold velocity data.

Examples:
orpr2turnlever.cpp.

Definition at line 1582 of file openrave.h.

IkParameterization& OpenRAVE::IkParameterization::MultiplyTransform ( const Transform t)
inline

in-place left-transform into a new coordinate system. Equivalent to t * ikparam

Definition at line 1825 of file openrave.h.

IkParameterization& OpenRAVE::IkParameterization::MultiplyTransformRight ( const Transform t)
inline

in-place right-transform into a new coordinate system. Equivalent to ikparam*t

Note that depending on the ikparam type, some information from the passed in transform can get lost or misinterpreted. For example Translation3D types do not have a rotation, so assume identity.

For ik types that have 3D directions stored, the transformation is the following:

quatRotate(quatMultiply(quatRotateDirection(Vector(0,0,1),direction), t.rot), Vector(0,0,1))

Basically it is how the local z axis gets transformed and converting that back to world coordinates.

Definition at line 1981 of file openrave.h.

IkParameterization OpenRAVE::IkParameterization::operator* ( const Transform t) const
inline

Definition at line 2132 of file openrave.h.

void OpenRAVE::IkParameterization::Set ( std::vector< dReal >::const_iterator  itvalues,
IkParameterizationType  iktype 
)
inline

Definition at line 1750 of file openrave.h.

void OpenRAVE::IkParameterization::SetCustomValue ( const std::string &  name,
dReal  value 
)
inline

sets named custom data in the ik parameterization (

See Also
SetCustomValues)

Definition at line 1777 of file openrave.h.

void OpenRAVE::IkParameterization::SetCustomValues ( const std::string &  name,
const std::vector< dReal > &  values 
)
inline

sets named custom data in the ik parameterization

The custom data is serialized along with the rest of the parameters and can also be part of a configuration specification under the "ikparam_values" anotation. The custom data name can have meta-tags for the type of transformation the data undergos when MultiplyTransform is called. For example, if the user wants to have an extra 3 values that represent "direction", then the direction has to be rotated along with all the data or coordinate systems can get lost. The anotations are specified by putting:

transform=s

somewhere in the string. The s can be: direction, point, quat, ikparam

If ikparam, the first value is expected to be the unique id of the ik type (GetType()&IKP_UniqueIdMask). The other values can be computed from IkParameterization::GetValues

Parameters
nameDescribes the type of data, cannot contain spaces or new lines.
valuesthe values representing the data
Exceptions
openrave_exceptionthrows if the name is invalid

Definition at line 1769 of file openrave.h.

void OpenRAVE::IkParameterization::SetDirection3D ( const Vector dir)
inline

Definition at line 1359 of file openrave.h.

void OpenRAVE::IkParameterization::SetLookat3D ( const Vector trans)
inline

Definition at line 1365 of file openrave.h.

void OpenRAVE::IkParameterization::SetLookat3D ( const RAY ray)
inline

the ray direction is not used for IK, however it is needed in order to compute the error

Definition at line 1369 of file openrave.h.

void OpenRAVE::IkParameterization::SetRay4D ( const RAY ray)
inline

Definition at line 1362 of file openrave.h.

void OpenRAVE::IkParameterization::SetRotation3D ( const Vector quaternion)
inline

Definition at line 1353 of file openrave.h.

void OpenRAVE::IkParameterization::SetTransform6D ( const Transform t)
inline

Definition at line 1350 of file openrave.h.

void OpenRAVE::IkParameterization::SetTranslation3D ( const Vector trans)
inline

Definition at line 1356 of file openrave.h.

void OpenRAVE::IkParameterization::SetTranslationDirection5D ( const RAY ray)
inline

Definition at line 1372 of file openrave.h.

void OpenRAVE::IkParameterization::SetTranslationLocalGlobal6D ( const Vector localtrans,
const Vector trans 
)
inline

Definition at line 1381 of file openrave.h.

void OpenRAVE::IkParameterization::SetTranslationXAxisAngle4D ( const Vector trans,
dReal  angle 
)
inline

Definition at line 1384 of file openrave.h.

void OpenRAVE::IkParameterization::SetTranslationXAxisAngleZNorm4D ( const Vector trans,
dReal  angle 
)
inline

Definition at line 1400 of file openrave.h.

void OpenRAVE::IkParameterization::SetTranslationXY2D ( const Vector trans)
inline

Definition at line 1375 of file openrave.h.

void OpenRAVE::IkParameterization::SetTranslationXYOrientation3D ( const Vector trans)
inline

Definition at line 1378 of file openrave.h.

void OpenRAVE::IkParameterization::SetTranslationYAxisAngle4D ( const Vector trans,
dReal  angle 
)
inline

Definition at line 1389 of file openrave.h.

void OpenRAVE::IkParameterization::SetTranslationYAxisAngleXNorm4D ( const Vector trans,
dReal  angle 
)
inline

Definition at line 1405 of file openrave.h.

void OpenRAVE::IkParameterization::SetTranslationZAxisAngle4D ( const Vector trans,
dReal  angle 
)
inline

Definition at line 1394 of file openrave.h.

void OpenRAVE::IkParameterization::SetTranslationZAxisAngleYNorm4D ( const Vector trans,
dReal  angle 
)
inline

Definition at line 1410 of file openrave.h.

void OpenRAVE::IkParameterization::SetValues ( std::vector< dReal >::const_iterator  itvalues,
IkParameterizationType  iktype 
)
inline

sets a serialized set of values for the IkParameterization

Function does not handle custom data. Don't normalize quaternions since it could hold velocity data.

Definition at line 1667 of file openrave.h.

Friends And Related Function Documentation

IkParameterization operator* ( const Transform t,
const IkParameterization ikparam 
)
friend

Definition at line 2233 of file openrave.h.

OPENRAVE_API std::ostream& operator<< ( std::ostream &  O,
const IkParameterization ikparam 
)
friend
OPENRAVE_API std::istream& operator>> ( std::istream &  I,
IkParameterization ikparam 
)
friend

Member Data Documentation

std::map<std::string, std::vector<dReal> > OpenRAVE::IkParameterization::_mapCustomData
protected

Definition at line 2226 of file openrave.h.

Transform OpenRAVE::IkParameterization::_transform
protected

Definition at line 2224 of file openrave.h.

IkParameterizationType OpenRAVE::IkParameterization::_type
protected

Definition at line 2225 of file openrave.h.

Definition at line 1289 of file openrave.h.

Definition at line 1290 of file openrave.h.

Definition at line 1291 of file openrave.h.

Definition at line 1292 of file openrave.h.

Definition at line 1293 of file openrave.h.

Definition at line 1294 of file openrave.h.

Definition at line 1295 of file openrave.h.

Definition at line 1296 of file openrave.h.

Definition at line 1297 of file openrave.h.

Definition at line 1298 of file openrave.h.

Definition at line 1299 of file openrave.h.

Definition at line 1300 of file openrave.h.


The documentation for this class was generated from the following files: