Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Types | Friends
Eigen::Map< Quaternion< _Scalar >, _Options > Class Template Reference

Detailed Description

template<typename _Scalar, int _Options>
class Eigen::Map< Quaternion< _Scalar >, _Options >

Expression of a quaternion from a memory buffer.

Parameters:
_Scalarthe type of the Quaternion coefficients
_Optionssee class Map

This is a specialization of class Map for Quaternion. This class allows to view a 4 scalar memory buffer as an Eigen's Quaternion object.

See also:
class Map, class Quaternion, class QuaternionBase

Definition at line 381 of file Geometry.

Inheritance diagram for Eigen::Map< Quaternion< _Scalar >, _Options >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef _Scalar Scalar
 the scalar type of the coefficients
typedef internal::traits< Map >
::Coefficients 
Coefficients
enum  
typedef NumTraits< Scalar >::Real RealScalar
typedef Matrix< Scalar, 3, 1 > Vector3
 the type of a 3D vector
typedef Matrix< Scalar, 3, 3 > Matrix3
 the equivalent rotation matrix type
typedef AngleAxis< ScalarAngleAxisType
 the equivalent angle-axis type
enum  
typedef Matrix< Scalar, Dim, Dim > RotationMatrixType
 corresponding linear transformation matrix type
typedef Matrix< Scalar, Dim, 1 > VectorType

Public Member Functions

EIGEN_STRONG_INLINE Map (Scalar *coeffs)
 Constructs a Mapped Quaternion object from the pointer coeffs.
Coefficientscoeffs ()
const Coefficientscoeffs () const
Scalar x () const
Scalarx ()
Scalar y () const
Scalary ()
Scalar z () const
Scalarz ()
Scalar w () const
Scalarw ()
const VectorBlock< const
Coefficients, 3 > 
vec () const
VectorBlock< Coefficients, 3 > vec ()
QuaternionBasesetIdentity ()
Scalar squaredNorm () const
Scalar norm () const
void normalize ()
 Normalizes the quaternion *this.
Quaternion< Scalarnormalized () const
Scalar dot (const QuaternionBase< OtherDerived > &other) const
Scalar angularDistance (const QuaternionBase< OtherDerived > &other) const
Matrix3 toRotationMatrix () const
Map< Quaternion< _Scalar >
, _Options > & 
setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b)
EIGEN_STRONG_INLINE Quaternion
< Scalar
operator* (const QuaternionBase< OtherDerived > &q) const
Transform< Scalar, Dim, Isometry > operator* (const Translation< Scalar, Dim > &t) const
RotationMatrixType operator* (const UniformScaling< Scalar > &s) const
EIGEN_STRONG_INLINE
internal::rotation_base_generic_product_selector
< Map< Quaternion< _Scalar >
, _Options >, OtherDerived,
OtherDerived::IsVectorAtCompileTime >
::ReturnType 
operator* (const EigenBase< OtherDerived > &e) const
Transform< Scalar, Dim, Mode > operator* (const Transform< Scalar, Dim, Mode, Options > &t) const
EIGEN_STRONG_INLINE Map
< Quaternion< _Scalar >
, _Options > & 
operator*= (const QuaternionBase< OtherDerived > &q)
Quaternion< Scalarinverse () const
Quaternion< Scalarconjugate () const
Quaternion< Scalarslerp (Scalar t, const QuaternionBase< OtherDerived > &other) const
bool isApprox (const QuaternionBase< OtherDerived > &other, RealScalar prec=NumTraits< Scalar >::dummy_precision()) const
EIGEN_STRONG_INLINE Vector3 _transformVector (Vector3 v) const
 return the result vector of v through the rotation
VectorType _transformVector (const OtherVectorType &v) const
internal::cast_return_type
< Map< Quaternion< _Scalar >
, _Options >, Quaternion
< NewScalarType > >::type 
cast () const
const Map< Quaternion< _Scalar >
, _Options > & 
derived () const
Map< Quaternion< _Scalar >
, _Options > & 
derived ()
RotationMatrixType matrix () const

Static Public Member Functions

static Quaternion< ScalarIdentity ()

Protected Attributes

Coefficients m_coeffs

Private Types

typedef QuaternionBase< Map
< Quaternion< _Scalar >
, _Options > > 
Base

Friends

RotationMatrixType operator* (const EigenBase< OtherDerived > &l, const Map< Quaternion< _Scalar >, _Options > &r)
Transform< Scalar, Dim, Affine > operator* (const DiagonalMatrix< Scalar, Dim > &l, const Map< Quaternion< _Scalar >, _Options > &r)

Member Typedef Documentation

typedef AngleAxis<Scalar> Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::AngleAxisType [inherited]

the equivalent angle-axis type

Definition at line 63 of file Geometry.

template<typename _Scalar , int _Options>
typedef QuaternionBase<Map<Quaternion<_Scalar>, _Options> > Eigen::Map< Quaternion< _Scalar >, _Options >::Base [private]

Reimplemented from Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >.

Definition at line 384 of file Geometry.

template<typename _Scalar , int _Options>
typedef internal::traits<Map>::Coefficients Eigen::Map< Quaternion< _Scalar >, _Options >::Coefficients

Reimplemented from Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >.

Definition at line 388 of file Geometry.

typedef Matrix<Scalar,3,3> Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::Matrix3 [inherited]

the equivalent rotation matrix type

Definition at line 61 of file Geometry.

typedef NumTraits<Scalar>::Real Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::RealScalar [inherited]

Definition at line 51 of file Geometry.

typedef Matrix<Scalar,Dim,Dim> Eigen::RotationBase< Map< Quaternion< _Scalar >, _Options > , _Dim >::RotationMatrixType [inherited]

corresponding linear transformation matrix type

Definition at line 51 of file Geometry.

template<typename _Scalar , int _Options>
typedef _Scalar Eigen::Map< Quaternion< _Scalar >, _Options >::Scalar

the scalar type of the coefficients

Reimplemented from Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >.

Definition at line 387 of file Geometry.

typedef Matrix<Scalar,3,1> Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::Vector3 [inherited]

the type of a 3D vector

Definition at line 59 of file Geometry.

typedef Matrix<Scalar,Dim,1> Eigen::RotationBase< Map< Quaternion< _Scalar >, _Options > , _Dim >::VectorType [inherited]

Definition at line 52 of file Geometry.


Member Enumeration Documentation

anonymous enum [inherited]

Definition at line 46 of file Geometry.

anonymous enum [inherited]

Definition at line 53 of file Geometry.


Constructor & Destructor Documentation

template<typename _Scalar , int _Options>
EIGEN_STRONG_INLINE Eigen::Map< Quaternion< _Scalar >, _Options >::Map ( Scalar coeffs) [inline]

Constructs a Mapped Quaternion object from the pointer coeffs.

The pointer coeffs must reference the four coeffecients of Quaternion in the following order:

 *coeffs == {x, y, z, w} 

If the template parameter _Options is set to Aligned, then the pointer coeffs must be aligned.

Definition at line 398 of file Geometry.


Member Function Documentation

EIGEN_STRONG_INLINE Vector3 Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::_transformVector ( Vector3  v) const [inherited]

return the result vector of v through the rotation

Rotation of a vector by a quaternion.

Remarks:
If the quaternion is used to rotate several points (>1) then it is much more efficient to first convert it to a 3x3 Matrix. Comparison of the operation cost for n transformations:
  • Quaternion2: 30n
  • Via a Matrix3: 24 + 15n
VectorType Eigen::RotationBase< Map< Quaternion< _Scalar >, _Options > , _Dim >::_transformVector ( const OtherVectorType &  v) const [inline, inherited]

Definition at line 107 of file Geometry.

Scalar Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::angularDistance ( const QuaternionBase< OtherDerived > &  other) const [inherited]
Returns:
the angle (in radian) between two rotations
See also:
dot()
internal::cast_return_type<Map< Quaternion< _Scalar >, _Options > ,Quaternion<NewScalarType> >::type Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::cast ( ) const [inline, inherited]
Returns:
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

Definition at line 184 of file Geometry.

template<typename _Scalar , int _Options>
Coefficients& Eigen::Map< Quaternion< _Scalar >, _Options >::coeffs ( ) [inline]
Returns:
a vector expression of the coefficients (x,y,z,w)

Reimplemented from Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >.

Definition at line 400 of file Geometry.

template<typename _Scalar , int _Options>
const Coefficients& Eigen::Map< Quaternion< _Scalar >, _Options >::coeffs ( ) const [inline]
Returns:
a read-only vector expression of the coefficients (x,y,z,w)

Reimplemented from Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >.

Definition at line 401 of file Geometry.

Quaternion<Scalar> Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::conjugate ( ) const [inherited]
Returns:
the conjugated quaternion
the conjugate of the *this which is equal to the multiplicative inverse if the quaternion is normalized. The conjugate of a quaternion represents the opposite rotation.
See also:
Quaternion2::inverse()
const Map< Quaternion< _Scalar >, _Options > & Eigen::RotationBase< Map< Quaternion< _Scalar >, _Options > , _Dim >::derived ( ) const [inline, inherited]

Definition at line 55 of file Geometry.

Map< Quaternion< _Scalar >, _Options > & Eigen::RotationBase< Map< Quaternion< _Scalar >, _Options > , _Dim >::derived ( ) [inline, inherited]

Definition at line 56 of file Geometry.

Scalar Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::dot ( const QuaternionBase< OtherDerived > &  other) const [inline, inherited]
Returns:
the dot product of *this and other Geometrically speaking, the dot product of two unit quaternions corresponds to the cosine of half the angle between the two rotations.
See also:
angularDistance()

Definition at line 141 of file Geometry.

static Quaternion<Scalar> Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::Identity ( ) [inline, static, inherited]
Returns:
a quaternion representing an identity rotation
See also:
MatrixBase::Identity()

Definition at line 113 of file Geometry.

Quaternion<Scalar> Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::inverse ( ) const [inherited]
Returns:
the quaternion describing the inverse rotation
the multiplicative inverse of *this Note that in most cases, i.e., if you simply want the opposite rotation, and/or the quaternion is normalized, then it is enough to use the conjugate.
See also:
QuaternionBase::conjugate()

Reimplemented from Eigen::RotationBase< Map< Quaternion< _Scalar >, _Options >, 3 >.

bool Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::isApprox ( const QuaternionBase< OtherDerived > &  other,
RealScalar  prec = NumTraits<Scalar>::dummy_precision() 
) const [inline, inherited]
Returns:
true if *this is approximately equal to other, within the precision determined by prec.
See also:
MatrixBase::isApprox()

Definition at line 172 of file Geometry.

RotationMatrixType Eigen::RotationBase< Map< Quaternion< _Scalar >, _Options > , _Dim >::matrix ( ) const [inline, inherited]
Returns:
an equivalent rotation matrix This function is added to be conform with the Transform class' naming scheme.

Definition at line 64 of file Geometry.

Scalar Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::norm ( ) const [inline, inherited]
Returns:
the norm of the quaternion's coefficients
See also:
QuaternionBase::squaredNorm(), MatrixBase::norm()

Definition at line 127 of file Geometry.

void Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::normalize ( void  ) [inline, inherited]

Normalizes the quaternion *this.

See also:
normalized(), MatrixBase::normalize()

Definition at line 131 of file Geometry.

Quaternion<Scalar> Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::normalized ( ) const [inline, inherited]
Returns:
a normalized copy of *this
See also:
normalize(), MatrixBase::normalized()

Definition at line 134 of file Geometry.

Transform<Scalar,Dim,Mode> Eigen::RotationBase< Map< Quaternion< _Scalar >, _Options > , _Dim >::operator* ( const Transform< Scalar, Dim, Mode, Options > &  t) const [inline, inherited]
Returns:
the concatenation of the rotation *this with a transformation t

Definition at line 103 of file Geometry.

EIGEN_STRONG_INLINE Quaternion<Scalar> Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::operator* ( const QuaternionBase< OtherDerived > &  q) const [inherited]
Returns:
the concatenation of two rotations as a quaternion-quaternion product
Transform<Scalar,Dim,Isometry> Eigen::RotationBase< Map< Quaternion< _Scalar >, _Options > , _Dim >::operator* ( const Translation< Scalar, Dim > &  t) const [inline, inherited]
Returns:
the concatenation of the rotation *this with a translation t

Definition at line 70 of file Geometry.

RotationMatrixType Eigen::RotationBase< Map< Quaternion< _Scalar >, _Options > , _Dim >::operator* ( const UniformScaling< Scalar > &  s) const [inline, inherited]
Returns:
the concatenation of the rotation *this with a uniform scaling s

Definition at line 74 of file Geometry.

EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector<Map< Quaternion< _Scalar >, _Options > ,OtherDerived,OtherDerived::IsVectorAtCompileTime>::ReturnType Eigen::RotationBase< Map< Quaternion< _Scalar >, _Options > , _Dim >::operator* ( const EigenBase< OtherDerived > &  e) const [inline, inherited]
Returns:
the concatenation of the rotation *this with a generic expression e e can be:
  • a DimxDim linear transformation matrix
  • a DimxDim diagonal matrix (axis aligned scaling)
  • a vector of size Dim

Definition at line 85 of file Geometry.

EIGEN_STRONG_INLINE Map< Quaternion< _Scalar >, _Options > & Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::operator*= ( const QuaternionBase< OtherDerived > &  q) [inherited]
See also:
operator*(Quaternion)
Map< Quaternion< _Scalar >, _Options > & Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::setFromTwoVectors ( const MatrixBase< Derived1 > &  a,
const MatrixBase< Derived2 > &  b 
) [inherited]

Sets *this to be a quaternion representing a rotation between the two arbitrary vectors a and b.

Returns:
the quaternion which transform a into b through a rotation

In other words, the built rotation represent a rotation sending the line of direction a to the line of direction b, both lines passing through the origin.

Returns:
a reference to *this.

Note that the two input vectors do not have to be normalized, and do not need to have the same norm.

QuaternionBase& Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::setIdentity ( ) [inline, inherited]
See also:
QuaternionBase::Identity(), MatrixBase::setIdentity()

Definition at line 117 of file Geometry.

Quaternion<Scalar> Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::slerp ( Scalar  t,
const QuaternionBase< OtherDerived > &  other 
) const [inherited]
Returns:
an interpolation for a constant motion between other and *this t in [0;1] see http://en.wikipedia.org/wiki/Slerp
the spherical linear interpolation between the two quaternions *this and other at the parameter t
Scalar Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::squaredNorm ( ) const [inline, inherited]
Returns:
the squared norm of the quaternion's coefficients
See also:
QuaternionBase::norm(), MatrixBase::squaredNorm()

Definition at line 122 of file Geometry.

Matrix3 Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::toRotationMatrix ( ) const [inherited]

Convert the quaternion to a 3x3 rotation matrix.

Returns:
an equivalent 3x3 rotation matrix

The quaternion is required to be normalized, otherwise the result is undefined.

Reimplemented from Eigen::RotationBase< Map< Quaternion< _Scalar >, _Options >, 3 >.

VectorBlock<Coefficients,3> Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::vec ( ) [inline, inherited]
Returns:
a vector expression of the imaginary part (x,y,z)

Definition at line 89 of file Geometry.

const VectorBlock<const Coefficients,3> Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::vec ( ) const [inline, inherited]
Returns:
a read-only vector expression of the imaginary part (x,y,z)

Definition at line 86 of file Geometry.

Scalar& Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::w ( ) [inline, inherited]
Returns:
a reference to the w coefficient

Definition at line 83 of file Geometry.

Scalar Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::w ( ) const [inline, inherited]
Returns:
the w coefficient

Definition at line 74 of file Geometry.

Scalar Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::x ( ) const [inline, inherited]
Returns:
the x coefficient

Definition at line 68 of file Geometry.

Scalar& Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::x ( ) [inline, inherited]
Returns:
a reference to the x coefficient

Definition at line 77 of file Geometry.

Scalar Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::y ( ) const [inline, inherited]
Returns:
the y coefficient

Definition at line 70 of file Geometry.

Scalar& Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::y ( ) [inline, inherited]
Returns:
a reference to the y coefficient

Definition at line 79 of file Geometry.

Scalar Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::z ( ) const [inline, inherited]
Returns:
the z coefficient

Definition at line 72 of file Geometry.

Scalar& Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::z ( ) [inline, inherited]
Returns:
a reference to the z coefficient

Definition at line 81 of file Geometry.


Friends And Related Function Documentation

RotationMatrixType operator* ( const EigenBase< OtherDerived > &  l,
const Map< Quaternion< _Scalar >, _Options > &  r 
) [friend, inherited]
Returns:
the concatenation of a linear transformation l with the rotation r

Definition at line 90 of file Geometry.

Transform<Scalar,Dim,Affine> operator* ( const DiagonalMatrix< Scalar, Dim > &  l,
const Map< Quaternion< _Scalar >, _Options > &  r 
) [friend, inherited]
Returns:
the concatenation of a scaling l with the rotation r

Definition at line 94 of file Geometry.


Member Data Documentation

template<typename _Scalar , int _Options>
Coefficients Eigen::Map< Quaternion< _Scalar >, _Options >::m_coeffs [protected]

Definition at line 404 of file Geometry.




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