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

Detailed Description

Quaternion expression mapping a constant 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
Inheritance diagram for Eigen::Map< const Quaternion< _Scalar >, _Options >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef _Scalar Scalar
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

Public Member Functions

EIGEN_STRONG_INLINE Map (const Scalar *coeffs)
 Constructs a Mapped Quaternion object from the pointer coeffs.
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 ()
internal::traits< Derived >
::Coefficients
coeffs ()
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
Derived & setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b)
EIGEN_STRONG_INLINE Quaternion
< Scalar
operator* (const QuaternionBase< OtherDerived > &q) const
EIGEN_STRONG_INLINE Derived & 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
internal::cast_return_type
< Derived, Quaternion
< NewScalarType > >::type 
cast () const

Static Public Member Functions

static Quaternion< ScalarIdentity ()

Protected Attributes

const Coefficients m_coeffs

Private Types

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

Member Typedef Documentation

the equivalent angle-axis type

Definition at line 63 of file Geometry.

typedef QuaternionBase<Map<const Quaternion<_Scalar>, _Options> > Eigen::Map< const Quaternion< _Scalar >, _Options >::Base [private]
typedef internal::traits<Map>::Coefficients Eigen::Map< const Quaternion< _Scalar >, _Options >::Coefficients
typedef Matrix<Scalar,3,3> Eigen::QuaternionBase::Matrix3 [inherited]

the equivalent rotation matrix type

Definition at line 61 of file Geometry.

Definition at line 51 of file Geometry.

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

the type of a 3D vector

Definition at line 59 of file Geometry.


Member Enumeration Documentation

anonymous enum [inherited]

Definition at line 53 of file Geometry.


Constructor & Destructor Documentation

EIGEN_STRONG_INLINE Eigen::Map< const Quaternion< _Scalar >, _Options >::Map ( const 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 362 of file Geometry.


Member Function Documentation

EIGEN_STRONG_INLINE Vector3 Eigen::QuaternionBase::_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
Scalar Eigen::QuaternionBase::angularDistance ( const QuaternionBase< OtherDerived > &  other) const [inherited]
Returns:
the angle (in radian) between two rotations
See also:
dot()
internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type Eigen::QuaternionBase::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.

internal::traits<Derived>::Coefficients& Eigen::QuaternionBase::coeffs ( ) [inline, inherited]
Returns:
a vector expression of the coefficients (x,y,z,w)

Definition at line 95 of file Geometry.

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

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

Definition at line 364 of file Geometry.

Quaternion<Scalar> Eigen::QuaternionBase::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()
Scalar Eigen::QuaternionBase::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::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::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()
bool Eigen::QuaternionBase::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.

Scalar Eigen::QuaternionBase::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::normalize ( void  ) [inline, inherited]

Normalizes the quaternion *this.

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

Definition at line 131 of file Geometry.

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

Definition at line 134 of file Geometry.

EIGEN_STRONG_INLINE Quaternion<Scalar> Eigen::QuaternionBase::operator* ( const QuaternionBase< OtherDerived > &  q) const [inherited]
Returns:
the concatenation of two rotations as a quaternion-quaternion product
EIGEN_STRONG_INLINE Derived& Eigen::QuaternionBase::operator*= ( const QuaternionBase< OtherDerived > &  q) [inherited]
See also:
operator*(Quaternion)
Derived& Eigen::QuaternionBase::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::setIdentity ( ) [inline, inherited]
See also:
QuaternionBase::Identity(), MatrixBase::setIdentity()

Definition at line 117 of file Geometry.

Quaternion<Scalar> Eigen::QuaternionBase::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::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::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.

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

Definition at line 86 of file Geometry.

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

Definition at line 89 of file Geometry.

Scalar Eigen::QuaternionBase::w ( ) const [inline, inherited]
Returns:
the w coefficient

Definition at line 74 of file Geometry.

Scalar& Eigen::QuaternionBase::w ( ) [inline, inherited]
Returns:
a reference to the w coefficient

Definition at line 83 of file Geometry.

Scalar Eigen::QuaternionBase::x ( ) const [inline, inherited]
Returns:
the x coefficient

Definition at line 68 of file Geometry.

Scalar& Eigen::QuaternionBase::x ( ) [inline, inherited]
Returns:
a reference to the x coefficient

Definition at line 77 of file Geometry.

Scalar Eigen::QuaternionBase::y ( ) const [inline, inherited]
Returns:
the y coefficient

Definition at line 70 of file Geometry.

Scalar& Eigen::QuaternionBase::y ( ) [inline, inherited]
Returns:
a reference to the y coefficient

Definition at line 79 of file Geometry.

Scalar Eigen::QuaternionBase::z ( ) const [inline, inherited]
Returns:
the z coefficient

Definition at line 72 of file Geometry.

Scalar& Eigen::QuaternionBase::z ( ) [inline, inherited]
Returns:
a reference to the z coefficient

Definition at line 81 of file Geometry.


Member Data Documentation

const Coefficients Eigen::Map< const Quaternion< _Scalar >, _Options >::m_coeffs [protected]

Definition at line 367 of file Geometry.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011