Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Friends
mrpt::math::CQuaternion< T > Class Template Reference

Detailed Description

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

A quaternion, which can represent a 3D rotation as pair $ (r,\mathbf{u}) $, with a real part "r" and a 3D vector $ \mathbf{u} = (x,y,z) $, or alternatively, q = r + ix + jy + kz.

The elements of the quaternion can be accessed by either:

Users will usually employ the typedef "CQuaternionDouble" instead of this template.

For more information about quaternions, see:

See also:
mrpt::poses::CPose3D

Definition at line 61 of file CQuaternion.h.

#include <mrpt/math/CQuaternion.h>

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

List of all members.

Public Types

enum  
enum  
typedef Base::PlainObject PlainObject
enum  
enum  
typedef internal::traits
< Matrix< T, _Rows, _Cols,
_Options, _MaxRows, _MaxCols >
>::StorageKind 
StorageKind
typedef internal::traits
< Matrix< T, _Rows, _Cols,
_Options, _MaxRows, _MaxCols >
>::Index 
Index
typedef internal::traits
< Matrix< T, _Rows, _Cols,
_Options, _MaxRows, _MaxCols >
>::Scalar 
Scalar
typedef
internal::packet_traits
< Scalar >::type 
PacketScalar
typedef NumTraits< Scalar >::Real RealScalar
typedef Matrix< T, _Rows,
_Cols, _Options, _MaxRows,
_MaxCols > 
DenseType
typedef Eigen::Map< Matrix< T,
_Rows, _Cols, _Options,
_MaxRows, _MaxCols >
, Unaligned > 
MapType
typedef const Eigen::Map
< const Matrix< T, _Rows,
_Cols, _Options, _MaxRows,
_MaxCols >, Unaligned > 
ConstMapType
typedef Eigen::Map< Matrix< T,
_Rows, _Cols, _Options,
_MaxRows, _MaxCols >, Aligned > 
AlignedMapType
typedef const Eigen::Map
< const Matrix< T, _Rows,
_Cols, _Options, _MaxRows,
_MaxCols >, Aligned > 
ConstAlignedMapType

Public Member Functions

void crossProduct (const CQuaternion &q1, const CQuaternion &q2)
 Calculate the "cross" product (or "composed rotation") of two quaternion: this = q1 x q2 After the operation, "this" will represent the composed rotations of q1 and q2 (q2 applied "after" q1).
void rotatePoint (const double lx, const double ly, const double lz, double &gx, double &gy, double &gz) const
 Rotate a 3D point (lx,ly,lz) -> (gx,gy,gz) as described by this quaternion.
void inverseRotatePoint (const double lx, const double ly, const double lz, double &gx, double &gy, double &gz) const
 Rotate a 3D point (lx,ly,lz) -> (gx,gy,gz) as described by the inverse (conjugate) of this quaternion.
double normSqr () const
 Return the squared norm of the quaternion.
void normalize ()
 Normalize this quaternion, so its norm becomes the unitity.
template<class MATRIXLIKE >
void normalizationJacobian (MATRIXLIKE &J) const
 Calculate the 4x4 Jacobian of the normalization operation of this quaternion.
template<class MATRIXLIKE >
void rotationJacobian (MATRIXLIKE &J) const
 Compute the Jacobian of the rotation composition operation $ p = f(\cdot) = q_{this} \times r $, that is the 4x4 matrix $ \frac{\partial f}{\partial q_{this} } $.
template<class MATRIXLIKE >
void rotationMatrix (MATRIXLIKE &M) const
 Calculate the 3x3 rotation matrix associated to this quaternion:

\[ \mathbf{R} = \left( \begin{array}{ccc} q_r^2+q_x^2-q_y^2-q_z^2 & 2(q_x q_y - q_r q_z) & 2(q_z q_x+q_r q_y) \\ 2(q_x q_y+q_r q_z) & q_r^2-q_x^2+q_y^2-q_z^2 & 2(q_y q_z-q_r q_x) \\ 2(q_z q_x-q_r q_y) & 2(q_y q_z+q_r q_x) & q_r^2- q_x^2 - q_y^2 + q_z^2 \end{array} \right)\]

.

template<class MATRIXLIKE >
void rotationMatrixNoResize (MATRIXLIKE &M) const
 Fill out the top-left 3x3 block of the given matrix with the rotation matrix associated to this quaternion (does not resize the matrix, for that, see rotationMatrix).
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.
template<class MATRIXLIKE >
void rpy_and_jacobian (T &roll, T &pitch, T &yaw, MATRIXLIKE *out_dr_dq=NULL, bool resize_out_dr_dq_to3x4=true) const
 Return the yaw, pitch & roll angles associated to quaternion, and (optionally) the 3x4 Jacobian of the transformation.
CQuaternion operator* (const T &factor)
void swap (MatrixBase< OtherDerived > const &other)
Index innerStride () const
Index outerStride () const
Basebase ()
const Basebase () const
EIGEN_STRONG_INLINE Index rows () const
EIGEN_STRONG_INLINE Index cols () const
EIGEN_STRONG_INLINE const Scalarcoeff (Index row, Index col) const
EIGEN_STRONG_INLINE const Scalarcoeff (Index index) const
EIGEN_STRONG_INLINE ScalarcoeffRef (Index row, Index col)
EIGEN_STRONG_INLINE ScalarcoeffRef (Index index)
EIGEN_STRONG_INLINE const ScalarcoeffRef (Index row, Index col) const
EIGEN_STRONG_INLINE const ScalarcoeffRef (Index index) const
EIGEN_STRONG_INLINE PacketScalar packet (Index row, Index col) const
EIGEN_STRONG_INLINE PacketScalar packet (Index index) const
EIGEN_STRONG_INLINE void writePacket (Index row, Index col, const PacketScalar &x)
EIGEN_STRONG_INLINE void writePacket (Index index, const PacketScalar &x)
EIGEN_STRONG_INLINE const Scalardata () const
EIGEN_STRONG_INLINE Scalardata ()
EIGEN_STRONG_INLINE void resize (Index rows, Index cols)
 Resizes *this to a rows x cols matrix.
void resize (Index size)
 Resizes *this to a vector of length size.
void resize (NoChange_t, Index cols)
 Resizes the matrix, changing only the number of columns.
void resize (Index rows, NoChange_t)
 Resizes the matrix, changing only the number of rows.
EIGEN_STRONG_INLINE void resizeLike (const EigenBase< OtherDerived > &_other)
 Resizes *this to have the same dimensions as other.
EIGEN_STRONG_INLINE void conservativeResize (Index rows, Index cols)
 Resizes the matrix to rows x cols while leaving old values untouched.
EIGEN_STRONG_INLINE void conservativeResize (Index rows, NoChange_t)
 Resizes the matrix to rows x cols while leaving old values untouched.
EIGEN_STRONG_INLINE void conservativeResize (NoChange_t, Index cols)
 Resizes the matrix to rows x cols while leaving old values untouched.
EIGEN_STRONG_INLINE void conservativeResize (Index size)
 Resizes the vector to size while retaining old values.
EIGEN_STRONG_INLINE void conservativeResizeLike (const DenseBase< OtherDerived > &other)
 Resizes the matrix to rows x cols of other, while leaving old values untouched.
EIGEN_STRONG_INLINE Matrix< T,
_Rows, _Cols, _Options,
_MaxRows, _MaxCols > & 
lazyAssign (const DenseBase< OtherDerived > &other)
Matrix< T, _Rows, _Cols,
_Options, _MaxRows, _MaxCols > & 
setConstant (Index size, const Scalar &value)
Matrix< T, _Rows, _Cols,
_Options, _MaxRows, _MaxCols > & 
setConstant (Index rows, Index cols, const Scalar &value)
Matrix< T, _Rows, _Cols,
_Options, _MaxRows, _MaxCols > & 
setZero (Index size)
Matrix< T, _Rows, _Cols,
_Options, _MaxRows, _MaxCols > & 
setZero (Index rows, Index cols)
Matrix< T, _Rows, _Cols,
_Options, _MaxRows, _MaxCols > & 
setOnes (Index size)
Matrix< T, _Rows, _Cols,
_Options, _MaxRows, _MaxCols > & 
setOnes (Index rows, Index cols)
Matrix< T, _Rows, _Cols,
_Options, _MaxRows, _MaxCols > & 
setRandom (Index size)
Matrix< T, _Rows, _Cols,
_Options, _MaxRows, _MaxCols > & 
setRandom (Index rows, Index cols)
 CQuaternion (TConstructorFlags_Quaternions constructor_dummy_param)
 Can be used with UNINITIALIZED_QUATERNION as argument, does not initialize the 4 elements of the quaternion (use this constructor when speed is critical).
 CQuaternion ()
 Default constructor: construct a (1, (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.
r () const
 Return r coordinate of the quaternion.
x () const
 Return x coordinate of the quaternion.
y () const
 Return y coordinate of the quaternion.
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 ARRAYLIKE3 >
void fromRodriguesVector (const ARRAYLIKE3 &v)
 Set this quaternion to the rotation described by a 3D (Rodrigues) rotation vector $ \mathbf{v} $: If $ \mathbf{v}=0 $, then the quaternion is $ \mathbf{q} = [1 ~ 0 ~ 0 ~ 0]^\top $, otherwise:

\[ \mathbf{q} = \left[ \begin{array}{c} \cos(\frac{\theta}{2}) \\ v_x \frac{\sin(\frac{\theta}{2})}{\theta} \\ v_y \frac{\sin(\frac{\theta}{2})}{\theta} \\ v_z \frac{\sin(\frac{\theta}{2})}{\theta} \end{array} \right] \]

where $ \theta = |\mathbf{v}| = \sqrt{v_x^2+v_y^2+v_z^2} $.

Static Public Member Functions

Map

These are convenience functions returning Map objects.

The Map() static functions return unaligned Map objects, while the AlignedMap() functions return aligned Map objects and thus should be called only with 16-byte-aligned data pointers.

These methods do not allow to specify strides. If you need to specify strides, you have to use the Map class directly.

See also:
class Map
static ConstMapType Map (const Scalar *data)
static MapType Map (Scalar *data)
static ConstMapType Map (const Scalar *data, Index size)
static MapType Map (Scalar *data, Index size)
static ConstMapType Map (const Scalar *data, Index rows, Index cols)
static MapType Map (Scalar *data, Index rows, Index cols)
static StridedConstMapType
< Stride< Outer, Inner >
>::type 
Map (const Scalar *data, const Stride< Outer, Inner > &stride)
static StridedMapType< Stride
< Outer, Inner > >::type 
Map (Scalar *data, const Stride< Outer, Inner > &stride)
static StridedConstMapType
< Stride< Outer, Inner >
>::type 
Map (const Scalar *data, Index size, const Stride< Outer, Inner > &stride)
static StridedMapType< Stride
< Outer, Inner > >::type 
Map (Scalar *data, Index size, const Stride< Outer, Inner > &stride)
static StridedConstMapType
< Stride< Outer, Inner >
>::type 
Map (const Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)
static StridedMapType< Stride
< Outer, Inner > >::type 
Map (Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)
static ConstAlignedMapType MapAligned (const Scalar *data)
static AlignedMapType MapAligned (Scalar *data)
static ConstAlignedMapType MapAligned (const Scalar *data, Index size)
static AlignedMapType MapAligned (Scalar *data, Index size)
static ConstAlignedMapType MapAligned (const Scalar *data, Index rows, Index cols)
static AlignedMapType MapAligned (Scalar *data, Index rows, Index cols)
static
StridedConstAlignedMapType
< Stride< Outer, Inner >
>::type 
MapAligned (const Scalar *data, const Stride< Outer, Inner > &stride)
static StridedAlignedMapType
< Stride< Outer, Inner >
>::type 
MapAligned (Scalar *data, const Stride< Outer, Inner > &stride)
static
StridedConstAlignedMapType
< Stride< Outer, Inner >
>::type 
MapAligned (const Scalar *data, Index size, const Stride< Outer, Inner > &stride)
static StridedAlignedMapType
< Stride< Outer, Inner >
>::type 
MapAligned (Scalar *data, Index size, const Stride< Outer, Inner > &stride)
static
StridedConstAlignedMapType
< Stride< Outer, Inner >
>::type 
MapAligned (const Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)
static StridedAlignedMapType
< Stride< Outer, Inner >
>::type 
MapAligned (Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)

Protected Member Functions

EIGEN_STRONG_INLINE void _resize_to_match (const EigenBase< OtherDerived > &other)
EIGEN_STRONG_INLINE Matrix< T,
_Rows, _Cols, _Options,
_MaxRows, _MaxCols > & 
_set (const DenseBase< OtherDerived > &other)
 Copies the value of the expression other into *this with automatic resizing.
EIGEN_STRONG_INLINE void _set_selector (const OtherDerived &other, const internal::true_type &)
EIGEN_STRONG_INLINE void _set_selector (const OtherDerived &other, const internal::false_type &)
EIGEN_STRONG_INLINE Matrix< T,
_Rows, _Cols, _Options,
_MaxRows, _MaxCols > & 
_set_noalias (const DenseBase< OtherDerived > &other)
EIGEN_STRONG_INLINE void _init2 (Index rows, Index cols, typename internal::enable_if< Base::SizeAtCompileTime!=2, T0 >::type *=0)
EIGEN_STRONG_INLINE void _init2 (const Scalar &x, const Scalar &y, typename internal::enable_if< Base::SizeAtCompileTime==2, T0 >::type *=0)
void _swap (DenseBase< OtherDerived > const &other)

Protected Attributes

DenseStorage< Scalar,
Base::MaxSizeAtCompileTime,
Base::RowsAtCompileTime,
Base::ColsAtCompileTime,
Options > 
m_storage

Private Types

typedef CArrayNumeric< T, 4 > Base
 Base class typedef.

Friends

struct internal::conservative_resize_like_impl
class Eigen::Map
class Eigen::Map< Derived, Unaligned >
class Eigen::Map< const Derived, Unaligned >
class Eigen::Map< Derived, Aligned >
class Eigen::Map< const Derived, Aligned >
struct internal::matrix_swap_impl

Lie Algebra methods

template<class ARRAYLIKE3 >
void ln (ARRAYLIKE3 &out_ln) const
 Logarithm of the 3x3 matrix defined by this pose, generating the corresponding vector in the SO(3) Lie Algebra, which coincides with the so-called "rotation vector" (I don't have space here for the proof ;-).
template<class ARRAYLIKE3 >
ARRAYLIKE3 ln () const
template<class ARRAYLIKE3 >
void ln_noresize (ARRAYLIKE3 &out_ln) const
 Like ln() but does not try to resize the output vector.
template<class ARRAYLIKE3 >
static CQuaternion< T > exp (const ARRAYLIKE3 &v)
 Exponential map from the SO(3) Lie Algebra to unit quaternions.
template<class ARRAYLIKE3 >
static void exp (const ARRAYLIKE3 &v, CQuaternion< T > &out_quat)

Member Typedef Documentation

typedef Eigen::Map<Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > , Aligned> Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::AlignedMapType [inherited]

Definition at line 81 of file Core.

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

Base class typedef.

See also:
PlainObjectBase

Reimplemented from mrpt::math::CArrayNumeric< T, 4 >.

Definition at line 63 of file CQuaternion.h.

typedef const Eigen::Map<const Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > , Aligned> Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::ConstAlignedMapType [inherited]

Definition at line 83 of file Core.

typedef const Eigen::Map<const Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > , Unaligned> Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::ConstMapType [inherited]

Definition at line 79 of file Core.

typedef Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::DenseType [inherited]

Definition at line 64 of file Core.

typedef internal::traits<Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Index Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Index [inherited]

Definition at line 60 of file Core.

typedef Eigen::Map<Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > , Unaligned> Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapType [inherited]

Definition at line 77 of file Core.

typedef internal::packet_traits<Scalar>::type Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::PacketScalar [inherited]

Definition at line 62 of file Core.

typedef Base::PlainObject Eigen::Matrix< T , _Rows, _Cols, _Options, _MaxRows, _MaxCols >::PlainObject [inherited]

Definition at line 155 of file Core.

typedef NumTraits<Scalar>::Real Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::RealScalar [inherited]

Definition at line 63 of file Core.

typedef internal::traits<Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Scalar Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Scalar [inherited]

Definition at line 61 of file Core.

typedef internal::traits<Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::StorageKind Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::StorageKind [inherited]

Definition at line 59 of file Core.


Member Enumeration Documentation

anonymous enum [inherited]

Definition at line 56 of file Core.

anonymous enum [inherited]

Definition at line 94 of file Core.

anonymous enum [inherited]

Definition at line 151 of file Core.

anonymous enum [inherited]

Definition at line 157 of file Core.


Constructor & Destructor Documentation

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

Can be used with UNINITIALIZED_QUATERNION as argument, does not initialize the 4 elements of the quaternion (use this constructor when speed is critical).

Definition at line 69 of file CQuaternion.h.

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

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

Definition at line 72 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]

Member Function Documentation

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init2 ( Index  rows,
Index  cols,
typename internal::enable_if< Base::SizeAtCompileTime!=2, T0 >::type = 0 
) [inline, protected, inherited]

Definition at line 584 of file Core.

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init2 ( const Scalar x,
const Scalar y,
typename internal::enable_if< Base::SizeAtCompileTime==2, T0 >::type = 0 
) [inline, protected, inherited]

Definition at line 592 of file Core.

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_resize_to_match ( const EigenBase< OtherDerived > &  other) [inline, protected, inherited]

Definition at line 529 of file Core.

EIGEN_STRONG_INLINE Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_set ( const DenseBase< OtherDerived > &  other) [inline, protected, inherited]

Copies the value of the expression other into *this with automatic resizing.

*this might be resized to match the dimensions of other. If *this was a null matrix (not already initialized), it will be initialized.

Note that copying a row-vector into a vector (and conversely) is allowed. The resizing, if any, is then done in the appropriate way so that row-vectors remain row-vectors and vectors remain vectors.

See also:
operator=(const MatrixBase<OtherDerived>&), _set_noalias()

Definition at line 555 of file Core.

EIGEN_STRONG_INLINE Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_set_noalias ( const DenseBase< OtherDerived > &  other) [inline, protected, inherited]

Definition at line 573 of file Core.

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_set_selector ( const OtherDerived &  other,
const internal::true_type  
) [inline, protected, inherited]

Definition at line 562 of file Core.

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_set_selector ( const OtherDerived &  other,
const internal::false_type  
) [inline, protected, inherited]

Definition at line 565 of file Core.

void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_swap ( DenseBase< OtherDerived > const &  other) [inline, protected, inherited]

Definition at line 606 of file Core.

Base& Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::base ( ) [inline, inherited]

Definition at line 98 of file Core.

const Base& Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::base ( ) const [inline, inherited]

Definition at line 99 of file Core.

EIGEN_STRONG_INLINE const Scalar& Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::coeff ( Index  row,
Index  col 
) const [inline, inherited]

Definition at line 104 of file Core.

EIGEN_STRONG_INLINE const Scalar& Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::coeff ( Index  index) const [inline, inherited]

Definition at line 112 of file Core.

EIGEN_STRONG_INLINE Scalar& Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::coeffRef ( Index  row,
Index  col 
) [inline, inherited]

Definition at line 117 of file Core.

EIGEN_STRONG_INLINE Scalar& Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::coeffRef ( Index  index) [inline, inherited]

Definition at line 125 of file Core.

EIGEN_STRONG_INLINE const Scalar& Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::coeffRef ( Index  index) const [inline, inherited]

Definition at line 138 of file Core.

EIGEN_STRONG_INLINE const Scalar& Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::coeffRef ( Index  row,
Index  col 
) const [inline, inherited]

Definition at line 130 of file Core.

EIGEN_STRONG_INLINE Index Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::cols ( void  ) const [inline, inherited]

Definition at line 102 of file Core.

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 323 of file CQuaternion.h.

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::conservativeResize ( Index  rows,
Index  cols 
) [inline, inherited]

Resizes the matrix to rows x cols while leaving old values untouched.

The method is intended for matrices of dynamic size. If you only want to change the number of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or conservativeResize(Index, NoChange_t).

Matrices are resized relative to the top-left element. In case values need to be appended to the matrix they will be uninitialized.

Definition at line 300 of file Core.

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::conservativeResize ( Index  rows,
NoChange_t   
) [inline, inherited]

Resizes the matrix to rows x cols while leaving old values untouched.

As opposed to conservativeResize(Index rows, Index cols), this version leaves the number of columns unchanged.

In case the matrix is growing, new rows will be uninitialized.

Definition at line 312 of file Core.

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::conservativeResize ( NoChange_t  ,
Index  cols 
) [inline, inherited]

Resizes the matrix to rows x cols while leaving old values untouched.

As opposed to conservativeResize(Index rows, Index cols), this version leaves the number of rows unchanged.

In case the matrix is growing, new columns will be uninitialized.

Definition at line 325 of file Core.

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::conservativeResize ( Index  size) [inline, inherited]

Resizes the vector to size while retaining old values.

. This method does not work for partially dynamic matrices when the static dimension is anything other than 1. For example it will not work with Matrix<double, 2, Dynamic>.

When values are appended, they will be uninitialized.

Definition at line 339 of file Core.

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::conservativeResizeLike ( const DenseBase< OtherDerived > &  other) [inline, inherited]

Resizes the matrix to rows x cols of other, while leaving old values untouched.

The method is intended for matrices of dynamic size. If you only want to change the number of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or conservativeResize(Index, NoChange_t).

Matrices are resized relative to the top-left element. In case values need to be appended to the matrix they will copied from other.

Definition at line 354 of file Core.

template<class T>
void mrpt::math::CQuaternion< T >::crossProduct ( const CQuaternion< T > &  q1,
const CQuaternion< T > &  q2 
) [inline]

Calculate the "cross" product (or "composed rotation") of two quaternion: this = q1 x q2 After the operation, "this" will represent the composed rotations of q1 and q2 (q2 applied "after" q1).

Definition at line 198 of file CQuaternion.h.

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

EIGEN_STRONG_INLINE const Scalar* Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::data ( ) const [inline, inherited]
Returns:
a const pointer to the data array of this matrix

Definition at line 178 of file Core.

EIGEN_STRONG_INLINE Scalar* Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::data ( ) [inline, inherited]
Returns:
a pointer to the data array of this matrix

Definition at line 182 of file Core.

template<class T>
template<class ARRAYLIKE3 >
static CQuaternion<T> mrpt::math::CQuaternion< T >::exp ( const ARRAYLIKE3 &  v) [inline, static]

Exponential map from the SO(3) Lie Algebra to unit quaternions.

See also:
ln, mrpt::poses::SE_traits

Definition at line 179 of file CQuaternion.h.

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

template<class T>
template<class ARRAYLIKE3 >
static void mrpt::math::CQuaternion< T >::exp ( const ARRAYLIKE3 &  v,
CQuaternion< T > &  out_quat 
) [inline, static]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 187 of file CQuaternion.h.

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

template<class T>
template<class ARRAYLIKE3 >
void mrpt::math::CQuaternion< T >::fromRodriguesVector ( const ARRAYLIKE3 &  v) [inline]

Set this quaternion to the rotation described by a 3D (Rodrigues) rotation vector $ \mathbf{v} $: If $ \mathbf{v}=0 $, then the quaternion is $ \mathbf{q} = [1 ~ 0 ~ 0 ~ 0]^\top $, otherwise:

\[ \mathbf{q} = \left[ \begin{array}{c} \cos(\frac{\theta}{2}) \\ v_x \frac{\sin(\frac{\theta}{2})}{\theta} \\ v_y \frac{\sin(\frac{\theta}{2})}{\theta} \\ v_z \frac{\sin(\frac{\theta}{2})}{\theta} \end{array} \right] \]

where $ \theta = |\mathbf{v}| = \sqrt{v_x^2+v_y^2+v_z^2} $.

See also:
"Representing Attitude: Euler Angles, Unit Quaternions, and Rotation Vectors (2006)", James Diebel.

Definition at line 115 of file CQuaternion.h.

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

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

Index Eigen::Matrix< T , _Rows, _Cols, _Options, _MaxRows, _MaxCols >::innerStride ( ) const [inline, inherited]

Definition at line 339 of file Core.

template<class T>
void mrpt::math::CQuaternion< T >::inverseRotatePoint ( const double  lx,
const double  ly,
const double  lz,
double &  gx,
double &  gy,
double &  gz 
) const [inline]

Rotate a 3D point (lx,ly,lz) -> (gx,gy,gz) as described by the inverse (conjugate) of this quaternion.

Definition at line 220 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().

EIGEN_STRONG_INLINE Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::lazyAssign ( const DenseBase< OtherDerived > &  other) [inline, inherited]
See also:
MatrixBase::lazyAssign()

Definition at line 369 of file Core.

template<class T>
template<class ARRAYLIKE3 >
void mrpt::math::CQuaternion< T >::ln ( ARRAYLIKE3 &  out_ln) const [inline]

Logarithm of the 3x3 matrix defined by this pose, generating the corresponding vector in the SO(3) Lie Algebra, which coincides with the so-called "rotation vector" (I don't have space here for the proof ;-).

Parameters:
[out]out_lnThe target vector, which can be: std::vector<>, or mrpt::vector_double or any row or column Eigen::Matrix<>.
See also:
exp, mrpt::poses::SE_traits

Definition at line 151 of file CQuaternion.h.

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

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 158 of file CQuaternion.h.

template<class T>
template<class ARRAYLIKE3 >
void mrpt::math::CQuaternion< T >::ln_noresize ( ARRAYLIKE3 &  out_ln) const [inline]
static ConstMapType Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( const Scalar data,
Index  rows,
Index  cols 
) [inline, static, inherited]

Definition at line 443 of file Core.

static MapType Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( Scalar data,
Index  rows,
Index  cols 
) [inline, static, inherited]

Definition at line 445 of file Core.

static StridedConstMapType<Stride<Outer, Inner> >::type Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( const Scalar data,
const Stride< Outer, Inner > &  stride 
) [inline, static, inherited]

Definition at line 462 of file Core.

static StridedMapType<Stride<Outer, Inner> >::type Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( Scalar data,
const Stride< Outer, Inner > &  stride 
) [inline, static, inherited]

Definition at line 465 of file Core.

static StridedConstMapType<Stride<Outer, Inner> >::type Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( const Scalar data,
Index  size,
const Stride< Outer, Inner > &  stride 
) [inline, static, inherited]

Definition at line 468 of file Core.

static StridedMapType<Stride<Outer, Inner> >::type Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( Scalar data,
Index  size,
const Stride< Outer, Inner > &  stride 
) [inline, static, inherited]

Definition at line 471 of file Core.

static StridedConstMapType<Stride<Outer, Inner> >::type Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( const Scalar data,
Index  rows,
Index  cols,
const Stride< Outer, Inner > &  stride 
) [inline, static, inherited]

Definition at line 474 of file Core.

static StridedMapType<Stride<Outer, Inner> >::type Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( Scalar data,
Index  rows,
Index  cols,
const Stride< Outer, Inner > &  stride 
) [inline, static, inherited]

Definition at line 477 of file Core.

static ConstMapType Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( const Scalar data) [inline, static, inherited]

Definition at line 435 of file Core.

static MapType Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( Scalar data) [inline, static, inherited]

Definition at line 437 of file Core.

static ConstMapType Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( const Scalar data,
Index  size 
) [inline, static, inherited]

Definition at line 439 of file Core.

static MapType Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( Scalar data,
Index  size 
) [inline, static, inherited]

Definition at line 441 of file Core.

static AlignedMapType Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( Scalar data) [inline, static, inherited]

Definition at line 450 of file Core.

static ConstAlignedMapType Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( const Scalar data,
Index  size 
) [inline, static, inherited]

Definition at line 452 of file Core.

static AlignedMapType Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( Scalar data,
Index  size 
) [inline, static, inherited]

Definition at line 454 of file Core.

static AlignedMapType Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( Scalar data,
Index  rows,
Index  cols 
) [inline, static, inherited]

Definition at line 458 of file Core.

static StridedConstAlignedMapType<Stride<Outer, Inner> >::type Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( const Scalar data,
const Stride< Outer, Inner > &  stride 
) [inline, static, inherited]

Definition at line 481 of file Core.

static StridedAlignedMapType<Stride<Outer, Inner> >::type Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( Scalar data,
const Stride< Outer, Inner > &  stride 
) [inline, static, inherited]

Definition at line 484 of file Core.

static StridedAlignedMapType<Stride<Outer, Inner> >::type Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( Scalar data,
Index  size,
const Stride< Outer, Inner > &  stride 
) [inline, static, inherited]

Definition at line 490 of file Core.

static StridedConstAlignedMapType<Stride<Outer, Inner> >::type Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( const Scalar data,
Index  rows,
Index  cols,
const Stride< Outer, Inner > &  stride 
) [inline, static, inherited]

Definition at line 493 of file Core.

static StridedAlignedMapType<Stride<Outer, Inner> >::type Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( Scalar data,
Index  rows,
Index  cols,
const Stride< Outer, Inner > &  stride 
) [inline, static, inherited]

Definition at line 496 of file Core.

static ConstAlignedMapType Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( const Scalar data,
Index  rows,
Index  cols 
) [inline, static, inherited]

Definition at line 456 of file Core.

static StridedConstAlignedMapType<Stride<Outer, Inner> >::type Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( const Scalar data,
Index  size,
const Stride< Outer, Inner > &  stride 
) [inline, static, inherited]

Definition at line 487 of file Core.

static ConstAlignedMapType Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( const Scalar data) [inline, static, inherited]

Definition at line 448 of file Core.

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

Calculate the 4x4 Jacobian of the normalization operation of this quaternion.

The output matrix can be a dynamic or fixed size (4x4) matrix.

Definition at line 248 of file CQuaternion.h.

References mrpt::math::CQuaternion< T >::normSqr(), 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 >::normalize ( ) [inline]

Normalize this quaternion, so its norm becomes the unitity.

Definition at line 237 of file CQuaternion.h.

References mrpt::math::CQuaternion< T >::normSqr(), and Eigen::internal::sqrt().

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

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

Definition at line 415 of file CQuaternion.h.

Index Eigen::Matrix< T , _Rows, _Cols, _Options, _MaxRows, _MaxCols >::outerStride ( ) const [inline, inherited]

Definition at line 340 of file Core.

EIGEN_STRONG_INLINE PacketScalar Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::packet ( Index  index) const [inline, inherited]

Definition at line 155 of file Core.

EIGEN_STRONG_INLINE PacketScalar Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::packet ( Index  row,
Index  col 
) const [inline, inherited]

Definition at line 145 of file Core.

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

Set r coordinate of the quaternion.

Definition at line 98 of file CQuaternion.h.

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

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

template<class T>
T mrpt::math::CQuaternion< T >::r ( ) const [inline]
void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::resize ( Index  size) [inline, inherited]

Resizes *this to a vector of length size.

. This method does not work for partially dynamic matrices when the static dimension is anything other than 1. For example it will not work with Matrix<double, 2, Dynamic>.

Example:

Output:

See also:
resize(Index,Index), resize(NoChange_t, Index), resize(Index, NoChange_t)

Definition at line 224 of file Core.

void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::resize ( Index  rows,
NoChange_t   
) [inline, inherited]

Resizes the matrix, changing only the number of rows.

For the parameter of type NoChange_t, just pass the special value NoChange as in the example below.

Example:

Output:

See also:
resize(Index,Index)

Definition at line 261 of file Core.

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::resize ( Index  rows,
Index  cols 
) [inline, inherited]

Resizes *this to a rows x cols matrix.

This method is intended for dynamic-size matrices, although it is legal to call it on any matrix as long as fixed dimensions are left unchanged. If you only want to change the number of rows and/or of columns, you can use resize(NoChange_t, Index), resize(Index, NoChange_t).

If the current number of coefficients of *this exactly matches the product rows * cols, then no memory allocation is performed and the current values are left unchanged. In all other cases, including shrinking, the data is reallocated and all previous values are lost.

Example:

Output:

See also:
resize(Index) for vectors, resize(NoChange_t, Index), resize(Index, NoChange_t)

Definition at line 201 of file Core.

void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::resize ( NoChange_t  ,
Index  cols 
) [inline, inherited]

Resizes the matrix, changing only the number of columns.

For the parameter of type NoChange_t, just pass the special value NoChange as in the example below.

Example:

Output:

See also:
resize(Index,Index)

Definition at line 248 of file Core.

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::resizeLike ( const EigenBase< OtherDerived > &  _other) [inline, inherited]

Resizes *this to have the same dimensions as other.

Takes care of doing all the checking that's needed.

Note that copying a row-vector into a vector (and conversely) is allowed. The resizing, if any, is then done in the appropriate way so that row-vectors remain row-vectors and vectors remain vectors.

Definition at line 274 of file Core.

template<class T>
void mrpt::math::CQuaternion< T >::rotatePoint ( const double  lx,
const double  ly,
const double  lz,
double &  gx,
double &  gy,
double &  gz 
) const [inline]

Rotate a 3D point (lx,ly,lz) -> (gx,gy,gz) as described by this 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>
template<class MATRIXLIKE >
void mrpt::math::CQuaternion< T >::rotationJacobian ( MATRIXLIKE &  J) const [inline]

Compute the Jacobian of the rotation composition operation $ p = f(\cdot) = q_{this} \times r $, that is the 4x4 matrix $ \frac{\partial f}{\partial q_{this} } $.

The output matrix can be a dynamic or fixed size (4x4) matrix.

Definition at line 278 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>
template<class MATRIXLIKE >
void mrpt::math::CQuaternion< T >::rotationMatrix ( MATRIXLIKE &  M) const [inline]

Calculate the 3x3 rotation matrix associated to this quaternion:

\[ \mathbf{R} = \left( \begin{array}{ccc} q_r^2+q_x^2-q_y^2-q_z^2 & 2(q_x q_y - q_r q_z) & 2(q_z q_x+q_r q_y) \\ 2(q_x q_y+q_r q_z) & q_r^2-q_x^2+q_y^2-q_z^2 & 2(q_y q_z-q_r q_x) \\ 2(q_z q_x-q_r q_y) & 2(q_y q_z+q_r q_x) & q_r^2- q_x^2 - q_y^2 + q_z^2 \end{array} \right)\]

.

Definition at line 297 of file CQuaternion.h.

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

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

Fill out the top-left 3x3 block of the given matrix with the rotation matrix associated to this quaternion (does not resize the matrix, for that, see rotationMatrix).

Definition at line 305 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().

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

EIGEN_STRONG_INLINE Index Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::rows ( void  ) const [inline, inherited]

Definition at line 101 of file Core.

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.

See also:
For the equations, see The MRPT Book, or see http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/Quaternions.pdf
rpy_and_jacobian

Definition at line 334 of file CQuaternion.h.

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

template<class T>
template<class MATRIXLIKE >
void mrpt::math::CQuaternion< T >::rpy_and_jacobian ( T &  roll,
T &  pitch,
T &  yaw,
MATRIXLIKE *  out_dr_dq = NULL,
bool  resize_out_dr_dq_to3x4 = true 
) const [inline]

Return the yaw, pitch & roll angles associated to quaternion, and (optionally) the 3x4 Jacobian of the transformation.

Note that both the angles and the Jacobian have one set of normal equations, plus other special formulas for the degenerated cases of |pitch|=90 degrees.

See also:
For the equations, see The MRPT Book, or http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/Quaternions.pdf
rpy

Definition at line 345 of file CQuaternion.h.

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

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

Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setConstant ( Index  size,
const Scalar value 
) [inherited]

Resizes to the given size, and sets all coefficients in this expression to the given value.

Example:

Output:

See also:
MatrixBase::setConstant(const Scalar&), setConstant(Index,Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&)
Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setConstant ( Index  rows,
Index  cols,
const Scalar value 
) [inherited]

Resizes to the given size, and sets all coefficients in this expression to the given value.

Parameters:
rowsthe new number of rows
colsthe new number of columns
valuethe value to which all coefficients are set

Example:

Output:

See also:
MatrixBase::setConstant(const Scalar&), setConstant(Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&)
Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setOnes ( Index  size) [inherited]

Resizes to the given size, and sets all coefficients in this expression to one.

Example:

Output:

See also:
MatrixBase::setOnes(), setOnes(Index,Index), class CwiseNullaryOp, MatrixBase::Ones()
Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setOnes ( Index  rows,
Index  cols 
) [inherited]

Resizes to the given size, and sets all coefficients in this expression to one.

Parameters:
rowsthe new number of rows
colsthe new number of columns

Example:

Output:

See also:
MatrixBase::setOnes(), setOnes(Index), class CwiseNullaryOp, MatrixBase::Ones()
Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setRandom ( Index  size) [inherited]

Resizes to the given size, and sets all coefficients in this expression to random values.

Example:

Output:

See also:
MatrixBase::setRandom(), setRandom(Index,Index), class CwiseNullaryOp, MatrixBase::Random()
Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setRandom ( Index  rows,
Index  cols 
) [inherited]

Resizes to the given size, and sets all coefficients in this expression to random values.

Parameters:
rowsthe new number of rows
colsthe new number of columns

Example:

Output:

See also:
MatrixBase::setRandom(), setRandom(Index), class CwiseNullaryOp, MatrixBase::Random()
Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setZero ( Index  size) [inherited]

Resizes to the given size, and sets all coefficients in this expression to zero.

Example:

Output:

See also:
DenseBase::setZero(), setZero(Index,Index), class CwiseNullaryOp, DenseBase::Zero()
Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setZero ( Index  rows,
Index  cols 
) [inherited]

Resizes to the given size, and sets all coefficients in this expression to zero.

Parameters:
rowsthe new number of rows
colsthe new number of columns

Example:

Output:

See also:
DenseBase::setZero(), setZero(Index), class CwiseNullaryOp, DenseBase::Zero()
void Eigen::Matrix< T , _Rows, _Cols, _Options, _MaxRows, _MaxCols >::swap ( MatrixBase< OtherDerived > const &  other) [inline, inherited]

Definition at line 336 of file Core.

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::writePacket ( Index  index,
const PacketScalar x 
) [inline, inherited]

Definition at line 172 of file Core.

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::writePacket ( Index  row,
Index  col,
const PacketScalar x 
) [inline, inherited]

Definition at line 162 of file Core.

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

Set x coordinate of the quaternion.

Definition at line 99 of file CQuaternion.h.

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

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

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

Set y coordinate of the quaternion.

Definition at line 100 of file CQuaternion.h.

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

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

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

Set z coordinate of the quaternion.

Definition at line 101 of file CQuaternion.h.

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

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

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

Friends And Related Function Documentation

friend class Eigen::Map [friend, inherited]

Definition at line 75 of file Core.

friend class Eigen::Map< const Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > , Aligned > [friend, inherited]

Definition at line 82 of file Core.

friend class Eigen::Map< const Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > , Unaligned > [friend, inherited]

Definition at line 78 of file Core.

friend class Eigen::Map< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > , Aligned > [friend, inherited]

Definition at line 80 of file Core.

friend class Eigen::Map< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > , Unaligned > [friend, inherited]

Definition at line 76 of file Core.

friend struct internal::conservative_resize_like_impl [friend, inherited]

Definition at line 363 of file Core.

friend struct internal::matrix_swap_impl [friend, inherited]

Definition at line 600 of file Core.


Member Data Documentation

DenseStorage<Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Options> Eigen::PlainObjectBase< Matrix< T, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::m_storage [protected, inherited]

Definition at line 91 of file Core.




Page generated by Doxygen 1.7.4 for MRPT 0.9.5 SVN:2717 at Sun Oct 16 16:08:03 PDT 2011 Hosted on:
SourceForge.net Logo