openrave.org

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions
Affine Math

Classes

class  OpenRAVE::geometry::RaveVector< T >
 Vector class containing 4 dimensions. More...
 
class  OpenRAVE::geometry::RaveTransform< T >
 Affine transformation parameterized with quaterions. More...
 
class  OpenRAVE::geometry::RaveTransformMatrix< T >
 Affine transformation parameterized with rotation matrices. Scales and shears are not supported. More...
 

Functions

template<typename T >
RaveVector< T > OpenRAVE::geometry::quatFromAxisAngle (const RaveVector< T > &axis, T angle)
 Converts an axis-angle rotation into a quaternion.
 
template<typename T >
RaveVector< T > OpenRAVE::geometry::quatFromAxisAngle (const RaveVector< T > &axisangle)
 Converts an axis-angle rotation into a quaternion.
 
template<typename T >
RaveVector< T > OpenRAVE::geometry::quatFromMatrix (const RaveTransformMatrix< T > &rotation)
 Converts the rotation of a matrix into a quaternion.
 
template<typename T >
RaveTransformMatrix< T > OpenRAVE::geometry::matrixFromQuat (const RaveVector< T > &quat)
 Converts a quaternion to a 3x3 matrix.
 
template<typename T >
void OpenRAVE::geometry::matrixFromQuat (RaveTransformMatrix< T > &rotation, const RaveVector< T > &quat)
 Converts a quaternion to a 3x3 matrix.
 
template<typename T >
RaveTransformMatrix< T > OpenRAVE::geometry::matrixFromAxisAngle (const RaveVector< T > &axis, T angle)
 Converts an axis-angle rotation to a 3x3 matrix.
 
template<typename T >
RaveTransformMatrix< T > OpenRAVE::geometry::matrixFromAxisAngle (const RaveVector< T > &axisangle)
 Converts an axis-angle rotation to a 3x3 matrix.
 
template<typename T >
RaveVector< T > OpenRAVE::geometry::quatMultiply (const RaveVector< T > &quat0, const RaveVector< T > &quat1)
 Multiply two quaternions.
 
template<typename T >
RaveVector< T > OpenRAVE::geometry::quatInverse (const RaveVector< T > &quat)
 Inverted a quaternion rotation.
 
template<typename T >
RaveVector< T > OpenRAVE::geometry::quatSlerp (const RaveVector< T > &quat0, const RaveVector< T > &quat1, T t)
 Sphereical linear interpolation between two quaternions.
 
template<typename T >
RaveVector< T > OpenRAVE::geometry::quatRotate (const RaveVector< T > &q, const RaveVector< T > &t)
 transform a vector by a quaternion
 
template<typename T >
RaveVector< T > OpenRAVE::geometry::quatRotateDirection (const RaveVector< T > &sourcedir, const RaveVector< T > &targetdir)
 Return the minimal quaternion that orients sourcedir to targetdir.
 
template<typename T >
std::pair< T, RaveVector< T > > OpenRAVE::geometry::normalizeAxisRotation (const RaveVector< T > &axis, const RaveVector< T > &quat)
 Find the rotation theta around axis such that rot(axis,theta) * q is closest to the identity rotation.
 
template<typename T >
RaveVector< T > OpenRAVE::geometry::axisAngleFromQuat (const RaveVector< T > &quat)
 Converts a quaternion into the axis-angle representation.
 
template<typename T >
RaveVector< T > OpenRAVE::geometry::axisAngleFromMatrix (const RaveTransformMatrix< T > &rotation)
 Converts the rotation of a matrix into axis-angle representation.
 
template<typename T >
RaveTransformMatrix< T > OpenRAVE::geometry::transformLookat (const RaveVector< T > &vlookat, const RaveVector< T > &vcamerapos, const RaveVector< T > &vcameraup)
 Returns a camera matrix that looks along a ray with a desired up vector.
 
OPENRAVE_API dReal OpenRAVE::RaveExp (dReal f)
 exponential
 
OPENRAVE_API dReal OpenRAVE::RaveLog (dReal f)
 logarithm
 
OPENRAVE_API dReal OpenRAVE::RaveCos (dReal f)
 cosine
 
OPENRAVE_API dReal OpenRAVE::RaveSin (dReal f)
 sine
 
OPENRAVE_API dReal OpenRAVE::RaveTan (dReal f)
 tangent
 
OPENRAVE_API dReal OpenRAVE::RaveLog2 (dReal f)
 base 2 logarithm
 
OPENRAVE_API dReal OpenRAVE::RaveLog10 (dReal f)
 base 10 logarithm
 
OPENRAVE_API dReal OpenRAVE::RaveAcos (dReal f)
 arccosine
 
OPENRAVE_API dReal OpenRAVE::RaveAsin (dReal f)
 arcsine
 
OPENRAVE_API dReal OpenRAVE::RaveAtan2 (dReal fy, dReal fx)
 arctangent2 covering entire circle
 
OPENRAVE_API dReal OpenRAVE::RavePow (dReal fx, dReal fy)
 power x^y
 
OPENRAVE_API dReal OpenRAVE::RaveSqrt (dReal f)
 square-root
 
OPENRAVE_API dReal OpenRAVE::RaveFabs (dReal f)
 absolute value
 

Detailed Description

A set of classes and functions that provide the basic affine math operations with vectors, matrices, and quaternions.

Function Documentation

template<typename T >
RaveVector<T> OpenRAVE::geometry::axisAngleFromMatrix ( const RaveTransformMatrix< T > &  rotation)

Converts the rotation of a matrix into axis-angle representation.

Parameters
rotation3x3 rotation matrix

Definition at line 1130 of file geometry.h.

template<typename T >
RaveVector<T> OpenRAVE::geometry::axisAngleFromQuat ( const RaveVector< T > &  quat)

Converts a quaternion into the axis-angle representation.

Parameters
quatquaternion, (s,vx,vy,vz)

Definition at line 1107 of file geometry.h.

template<typename T >
RaveTransformMatrix<T> OpenRAVE::geometry::matrixFromAxisAngle ( const RaveVector< T > &  axis,
angle 
)
inline

Converts an axis-angle rotation to a 3x3 matrix.

Parameters
axisunit axis, 3 values
anglerotation angle (radians)
Examples:
orpr2turnlever.cpp.

Definition at line 941 of file geometry.h.

template<typename T >
RaveTransformMatrix<T> OpenRAVE::geometry::matrixFromAxisAngle ( const RaveVector< T > &  axisangle)
inline

Converts an axis-angle rotation to a 3x3 matrix.

Parameters
axisunit axis * rotation angle (radians), 3 values

Definition at line 950 of file geometry.h.

template<typename T >
RaveTransformMatrix<T> OpenRAVE::geometry::matrixFromQuat ( const RaveVector< T > &  quat)
inline

Converts a quaternion to a 3x3 matrix.

Parameters
[in]quatquaternion, (s,vx,vy,vz)

Definition at line 883 of file geometry.h.

template<typename T >
void OpenRAVE::geometry::matrixFromQuat ( RaveTransformMatrix< T > &  rotation,
const RaveVector< T > &  quat 
)

Converts a quaternion to a 3x3 matrix.

Parameters
[out]rotation
[in]quatquaternion, (s,vx,vy,vz)

Definition at line 913 of file geometry.h.

template<typename T >
std::pair<T, RaveVector<T> > OpenRAVE::geometry::normalizeAxisRotation ( const RaveVector< T > &  axis,
const RaveVector< T > &  quat 
)

Find the rotation theta around axis such that rot(axis,theta) * q is closest to the identity rotation.

Parameters
[in]axisaxis to minimize rotation about
[in]quatinput
Returns
The angle that minimizes the rotation along with the normalized rotation rot(axis,theta)*q

Definition at line 1093 of file geometry.h.

template<typename T >
RaveVector<T> OpenRAVE::geometry::quatFromAxisAngle ( const RaveVector< T > &  axis,
angle 
)
inline

Converts an axis-angle rotation into a quaternion.

Parameters
axisunit axis, 3 values
anglerotation angle (radians)
Examples:
ikfastloader.cpp, ormultithreadedplanning.cpp, and orplanning_ik.cpp.

Definition at line 807 of file geometry.h.

template<typename T >
RaveVector<T> OpenRAVE::geometry::quatFromAxisAngle ( const RaveVector< T > &  axisangle)
inline

Converts an axis-angle rotation into a quaternion.

Parameters
axisangleunit axis * rotation angle (radians), 3 values

Definition at line 822 of file geometry.h.

template<typename T >
RaveVector<T> OpenRAVE::geometry::quatFromMatrix ( const RaveTransformMatrix< T > &  rotation)
inline

Converts the rotation of a matrix into a quaternion.

Parameters
ttransform for extracting the 3x3 rotation.

Definition at line 836 of file geometry.h.

template<typename T >
RaveVector<T> OpenRAVE::geometry::quatInverse ( const RaveVector< T > &  quat)
inline

Inverted a quaternion rotation.

Parameters
quatquaternion, (s,vx,vy,vz)

Definition at line 976 of file geometry.h.

template<typename T >
RaveVector<T> OpenRAVE::geometry::quatMultiply ( const RaveVector< T > &  quat0,
const RaveVector< T > &  quat1 
)
inline

Multiply two quaternions.

Parameters
quat0quaternion, (s,vx,vy,vz)
quat1quaternion, (s,vx,vy,vz)
Examples:
ormultithreadedplanning.cpp, and orplanning_ik.cpp.

Definition at line 961 of file geometry.h.

template<typename T >
RaveVector<T> OpenRAVE::geometry::quatRotate ( const RaveVector< T > &  q,
const RaveVector< T > &  t 
)

transform a vector by a quaternion

Parameters

Definition at line 1038 of file geometry.h.

template<typename T >
RaveVector<T> OpenRAVE::geometry::quatRotateDirection ( const RaveVector< T > &  sourcedir,
const RaveVector< T > &  targetdir 
)

Return the minimal quaternion that orients sourcedir to targetdir.

Parameters
sourcedirdirection of the original vector, 3 values
targetdirnew direction, 3 values

Definition at line 1063 of file geometry.h.

template<typename T >
RaveVector<T> OpenRAVE::geometry::quatSlerp ( const RaveVector< T > &  quat0,
const RaveVector< T > &  quat1,
t 
)
inline

Sphereical linear interpolation between two quaternions.

Parameters
quat0quaternion, (s,vx,vy,vz)
quat1quaternion, (s,vx,vy,vz)
treal value in [0,1]. 0 returns quat1, 1 returns quat2

Definition at line 988 of file geometry.h.

dReal OpenRAVE::RaveAcos ( dReal  f)

arccosine

Definition at line 232 of file libopenrave.cpp.

dReal OpenRAVE::RaveAsin ( dReal  f)

arcsine

Definition at line 235 of file libopenrave.cpp.

dReal OpenRAVE::RaveAtan2 ( dReal  fy,
dReal  fx 
)

arctangent2 covering entire circle

Definition at line 238 of file libopenrave.cpp.

dReal OpenRAVE::RaveCos ( dReal  f)

cosine

Definition at line 211 of file libopenrave.cpp.

dReal OpenRAVE::RaveExp ( dReal  f)

exponential

Wrappers of common basic math functions, allows OpenRAVE to control the precision requirements.

Definition at line 205 of file libopenrave.cpp.

dReal OpenRAVE::RaveFabs ( dReal  f)

absolute value

Definition at line 247 of file libopenrave.cpp.

dReal OpenRAVE::RaveLog ( dReal  f)

logarithm

Definition at line 208 of file libopenrave.cpp.

dReal OpenRAVE::RaveLog10 ( dReal  f)

base 10 logarithm

Definition at line 229 of file libopenrave.cpp.

dReal OpenRAVE::RaveLog2 ( dReal  f)

base 2 logarithm

Definition at line 225 of file libopenrave.cpp.

dReal OpenRAVE::RavePow ( dReal  fx,
dReal  fy 
)

power x^y

Definition at line 241 of file libopenrave.cpp.

dReal OpenRAVE::RaveSin ( dReal  f)

sine

Definition at line 214 of file libopenrave.cpp.

dReal OpenRAVE::RaveSqrt ( dReal  f)

square-root

Examples:
orplanning_door.cpp.

Definition at line 244 of file libopenrave.cpp.

dReal OpenRAVE::RaveTan ( dReal  f)

tangent

Definition at line 217 of file libopenrave.cpp.

template<typename T >
RaveTransformMatrix<T> OpenRAVE::geometry::transformLookat ( const RaveVector< T > &  vlookat,
const RaveVector< T > &  vcamerapos,
const RaveVector< T > &  vcameraup 
)

Returns a camera matrix that looks along a ray with a desired up vector.

Parameters
[in]vlookatthe point space to look at, the camera will rotation and zoom around this point
[in]vcamposthe position of the camera in space
[in]vcamupvector from the camera

Definition at line 1157 of file geometry.h.