MRPT logo
Private Types

mrpt::math::CQuaternion< T > Class Template Reference

General functions for quaternion. More...

#include <mrpt/math/CQuaternion.h>

Inheritance diagram for mrpt::math::CQuaternion< T >:
Inheritance graph
[legend]
Collaboration diagram for mrpt::math::CQuaternion< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CQuaternion ()
 Default constructor: construct a (0,0,0,0) quaternion representing no rotation.
 CQuaternion (const T r, const T x, const T y, const T z)
 Construct a quaternion from its parameters 'r', 'x', 'y', 'z', with q = r + ix + jy + kz.
template<class ARRAYLIKE >
 CQuaternion (const ARRAYLIKE &in)
 Construct a quaternion from a 3D input vector (Rodrigues rotation 3-vector).
T r () const
 Return r coordinate of the quaternion.
T x () const
 Return x coordinate of the quaternion.
T y () const
 Return y coordinate of the quaternion.
T z () const
 Return z coordinate of the quaternion.
void r (const T r)
 Set r coordinate of the quaternion.
void x (const T x)
 Set x coordinate of the quaternion.
void y (const T y)
 Set y coordinate of the quaternion.
void z (const T z)
 Set z coordinate of the quaternion.
template<class ARRAYLIKE >
void fromRodriguesVector (const ARRAYLIKE &in)
 Set this quaternion to the rotation described by a 3D Rodrigues rotation vector.
void crossProduct (const CQuaternion &qin1, const CQuaternion &qin2)
 Calculate the cross product of two quaternion: this = qin1 x qin2.
void normalize ()
 Normalize this quaternion.
template<class MATRIXLIKE >
void normalizedJacobian (MATRIXLIKE &J) const
 Calculate the normalized 4x4 Jacobian of a quaternion The output matrix can be a dynamic or fixed size (4x4) matrix.
template<class MATRIXLIKE >
void rotationMatrix (MATRIXLIKE &M) const
 Calculate the 3x3 rotation matrix associated to this quaternion.
void conj (CQuaternion &q_out) const
 Return the conjugate quaternion.
CQuaternion conj () const
 Return the conjugate quaternion.
void rpy (T &roll, T &pitch, T &yaw) const
 Return the yaw, pitch & roll angles associated to quaternion.
CQuaternion operator* (const T &factor)

Private Types

typedef CArrayNumeric< T, 4 > BASE

Detailed Description

template<class T>
class mrpt::math::CQuaternion< T >

General functions for quaternion.

This quaternion class represents a 3D rotation as a complex vector with 3 imaginary parts x, y, z and 1 real part r. Where q = r + ix + jy + kz.

For more information about quaternions, see:

Definition at line 47 of file CQuaternion.h.


Member Typedef Documentation

template<class T >
typedef CArrayNumeric<T,4> mrpt::math::CQuaternion< T >::BASE [private]

Definition at line 49 of file CQuaternion.h.


Constructor & Destructor Documentation

template<class T >
mrpt::math::CQuaternion< T >::CQuaternion (  )  [inline]

Default constructor: construct a (0,0,0,0) quaternion representing no rotation.

Definition at line 55 of file CQuaternion.h.

template<class T >
mrpt::math::CQuaternion< T >::CQuaternion ( const T  r,
const T  x,
const T  y,
const T  z 
) [inline]

Construct a quaternion from its parameters 'r', 'x', 'y', 'z', with q = r + ix + jy + kz.

Definition at line 58 of file CQuaternion.h.

template<class T >
template<class ARRAYLIKE >
mrpt::math::CQuaternion< T >::CQuaternion ( const ARRAYLIKE &  in  )  [inline]

Construct a quaternion from a 3D input vector (Rodrigues rotation 3-vector).

Definition at line 69 of file CQuaternion.h.

References mrpt::math::CQuaternion< T >::fromRodriguesVector().


Member Function Documentation

template<class T >
void mrpt::math::CQuaternion< T >::conj ( CQuaternion< T > &  q_out  )  const [inline]
template<class T >
CQuaternion mrpt::math::CQuaternion< T >::conj (  )  const [inline]

Return the conjugate quaternion.

Definition at line 200 of file CQuaternion.h.

template<class T >
void mrpt::math::CQuaternion< T >::crossProduct ( const CQuaternion< T > &  qin1,
const CQuaternion< T > &  qin2 
) [inline]
template<class T >
template<class ARRAYLIKE >
void mrpt::math::CQuaternion< T >::fromRodriguesVector ( const ARRAYLIKE &  in  )  [inline]

Set this quaternion to the rotation described by a 3D Rodrigues rotation vector.

Definition at line 90 of file CQuaternion.h.

References THROW_EXCEPTION, mrpt::math::CQuaternion< T >::x(), mrpt::math::CQuaternion< T >::y(), and mrpt::math::CQuaternion< T >::z().

Referenced by mrpt::math::CQuaternion< T >::CQuaternion().

template<class T >
void mrpt::math::CQuaternion< T >::normalize (  )  [inline]
template<class T >
template<class MATRIXLIKE >
void mrpt::math::CQuaternion< T >::normalizedJacobian ( MATRIXLIKE &  J  )  const [inline]

Calculate the normalized 4x4 Jacobian of a quaternion The output matrix can be a dynamic or fixed size (4x4) matrix.

JL: TODO: Document, the jacobian of what wrt what!?!?

Definition at line 152 of file CQuaternion.h.

References mrpt::math::CQuaternion< T >::r(), mrpt::utils::square(), mrpt::math::CQuaternion< T >::x(), mrpt::math::CQuaternion< T >::y(), and mrpt::math::CQuaternion< T >::z().

template<class T >
CQuaternion mrpt::math::CQuaternion< T >::operator* ( const T &  factor  )  [inline]

Definition at line 218 of file CQuaternion.h.

template<class T >
void mrpt::math::CQuaternion< T >::r ( const T  r  )  [inline]

Set r coordinate of the quaternion.

Definition at line 82 of file CQuaternion.h.

template<class T >
T mrpt::math::CQuaternion< T >::r (  )  const [inline]
template<class T >
template<class MATRIXLIKE >
void mrpt::math::CQuaternion< T >::rotationMatrix ( MATRIXLIKE &  M  )  const [inline]

Calculate the 3x3 rotation matrix associated to this quaternion.

Definition at line 182 of file CQuaternion.h.

References mrpt::math::CQuaternion< T >::r(), mrpt::math::CQuaternion< T >::x(), mrpt::math::CQuaternion< T >::y(), and mrpt::math::CQuaternion< T >::z().

template<class T >
void mrpt::math::CQuaternion< T >::rpy ( T &  roll,
T &  pitch,
T &  yaw 
) const [inline]

Return the yaw, pitch & roll angles associated to quaternion.

Definition at line 209 of file CQuaternion.h.

References mrpt::math::CQuaternion< T >::r(), mrpt::math::CQuaternion< T >::x(), mrpt::math::CQuaternion< T >::y(), and mrpt::math::CQuaternion< T >::z().

template<class T >
T mrpt::math::CQuaternion< T >::x (  )  const [inline]
template<class T >
void mrpt::math::CQuaternion< T >::x ( const T  x  )  [inline]

Set x coordinate of the quaternion.

Definition at line 83 of file CQuaternion.h.

template<class T >
T mrpt::math::CQuaternion< T >::y (  )  const [inline]
template<class T >
void mrpt::math::CQuaternion< T >::y ( const T  y  )  [inline]

Set y coordinate of the quaternion.

Definition at line 84 of file CQuaternion.h.

template<class T >
T mrpt::math::CQuaternion< T >::z (  )  const [inline]
template<class T >
void mrpt::math::CQuaternion< T >::z ( const T  z  )  [inline]

Set z coordinate of the quaternion.

Definition at line 85 of file CQuaternion.h.




Page generated by Doxygen 1.7.1 for MRPT 0.8.1 SVN:exported at Sun Sep 19 14:53:45 UTC 2010