stateObservation::kine::Orientation Class Reference

#include <state-observation/tools/rigid-body-kinematics.hpp>

Collaboration diagram for stateObservation::kine::Orientation:

Public Member Functions

 Orientation (bool initialize=true)
 
 Orientation (const Vector3 &v)
 this is the rotation vector and NOT Euler angles More...
 
 Orientation (const Quaternion &q)
 
 Orientation (const Matrix3 &m)
 
 Orientation (const AngleAxis &aa)
 
 Orientation (const Quaternion &q, const Matrix3 &m)
 
 Orientation (const double &roll, const double &pitch, const double &yaw)
 
 Orientation (const Orientation &multiplier1, const Orientation &multiplier2)
 
Orientationoperator= (const Vector3 &v)
 
Orientationoperator= (const Quaternion &q)
 
Orientationoperator= (const Matrix3 &m)
 
Orientationoperator= (const AngleAxis &aa)
 
OrientationsetValue (const Quaternion &q, const Matrix3 &m)
 
OrientationfromVector4 (const Vector4 &v)
 
OrientationsetRandom ()
 
template<typename t = Quaternion>
OrientationsetZeroRotation ()
 
const Matrix3toMatrix3 () const
 get a const reference on the matrix or the quaternion More...
 
const QuaterniontoQuaternion () const
 
 operator const Matrix3 & () const
 
 operator const Quaternion & () const
 
Vector4 toVector4 () const
 
Vector3 toRotationVector () const
 
Vector3 toRollPitchYaw () const
 
AngleAxis toAngleAxis () const
 
Orientation operator* (const Orientation &R2) const
 
const OrientationsetToProductNoAlias (const Orientation &R1, const Orientation &R2)
 Noalias versions of the operator*. More...
 
Orientation inverse () const
 
const Orientationintegrate (Vector3 dt_x_omega)
 
const OrientationintegrateRightSide (Vector3 dt_x_omega)
 
Vector3 differentiate (Orientation R_k1) const
 gives the log (rotation vector) of the "left-side" difference of orientation: log of R_k1*(*this).inverse(). More...
 
Vector3 differentiateRightSide (Orientation R_k1) const
 gives the log (rotation vector) of the "right-side" difference of orientation: log of (*this).inverse() * R_k1. More...
 
Vector3 operator* (const Vector3 &v) const
 Rotate a vector. More...
 
bool isSet () const
 checks that the orientation has been assigned a value. More...
 
void reset ()
 resets the Orientation object. More...
 
bool isMatrixSet () const
 checks that the matrix representation of the orientation has been assigned a value. More...
 
bool isQuaternionSet () const
 checks that the quaternion representation of the orientation has been assigned a value. More...
 
void setMatrix (bool b=true)
 
void setQuaternion (bool b=true)
 
CheckedMatrix3getMatrixRefUnsafe ()
 no checks are performed for these functions, use with caution More...
 
CheckedQuaterniongetQuaternionRefUnsafe ()
 get a reference to the quaternion representation of the orientation without calling the check functions. More...
 
void synchronize ()
 synchronizes the representations (quaternion and rotation matrix) More...
 

Static Public Member Functions

static Orientation zeroRotation ()
 retruns a zero rotation More...
 
static Orientation randomRotation ()
 Returns a uniformly distributed random rotation. More...
 

Protected Member Functions

void check_ () const
 
const Matrix3quaternionToMatrix_ () const
 
const QuaternionmatrixToQuaternion_ () const
 

Protected Attributes

CheckedQuaternion q_
 
CheckedMatrix3 m_
 

Constructor & Destructor Documentation

◆ Orientation() [1/8]

stateObservation::kine::Orientation::Orientation ( bool  initialize = true)
explicit

The parameter initialize should be set to true except when it is certain that the initial value will not be used And that the first operation would be to set its value

◆ Orientation() [2/8]

stateObservation::kine::Orientation::Orientation ( const Vector3 v)
explicit

this is the rotation vector and NOT Euler angles

◆ Orientation() [3/8]

stateObservation::kine::Orientation::Orientation ( const Quaternion q)
explicit

◆ Orientation() [4/8]

stateObservation::kine::Orientation::Orientation ( const Matrix3 m)
explicit

◆ Orientation() [5/8]

stateObservation::kine::Orientation::Orientation ( const AngleAxis aa)
explicit

◆ Orientation() [6/8]

stateObservation::kine::Orientation::Orientation ( const Quaternion q,
const Matrix3 m 
)

◆ Orientation() [7/8]

stateObservation::kine::Orientation::Orientation ( const double &  roll,
const double &  pitch,
const double &  yaw 
)

◆ Orientation() [8/8]

stateObservation::kine::Orientation::Orientation ( const Orientation multiplier1,
const Orientation multiplier2 
)

Member Function Documentation

◆ check_()

void stateObservation::kine::Orientation::check_ ( ) const
protected

◆ differentiate()

Vector3 stateObservation::kine::Orientation::differentiate ( Orientation  R_k1) const
inline

gives the log (rotation vector) of the "left-side" difference of orientation: log of R_k1*(*this).inverse().

This function is also used to differentiate two Orientations expressed in the same frame at the same time k, even for the LocalKinematics (the integration of the orientation is different and therefore the associated differentiation also is, but the difference remains the same)

Parameters
R_k1the other orientation with which we compute the difference.
Returns
Vector3

◆ differentiateRightSide()

Vector3 stateObservation::kine::Orientation::differentiateRightSide ( Orientation  R_k1) const
inline

gives the log (rotation vector) of the "right-side" difference of orientation: log of (*this).inverse() * R_k1.

This function is also used to differentiate two Orientations expressed in the same frame at the same time k, even for the LocalKinematics (the integration of the orientation is different and therefore the associated differentiation also is, but the difference remains the same)

Parameters
R_k1the other orientation with which we compute the difference.
Returns
Vector3

◆ fromVector4()

Orientation& stateObservation::kine::Orientation::fromVector4 ( const Vector4 v)
inline

◆ getMatrixRefUnsafe()

CheckedMatrix3& stateObservation::kine::Orientation::getMatrixRefUnsafe ( )
inline

no checks are performed for these functions, use with caution

get a reference to the matrix representation of the orientation without calling the check functions.

Has to be used with care as this function doesn't check that the matrix has been assigned values.

Returns
CheckedMatrix3

◆ getQuaternionRefUnsafe()

CheckedQuaternion& stateObservation::kine::Orientation::getQuaternionRefUnsafe ( )
inline

get a reference to the quaternion representation of the orientation without calling the check functions.

Has to be used with care as this function doesn't check that the quaternion has been assigned values.

Returns
CheckedQuaternion

◆ integrate()

const Orientation& stateObservation::kine::Orientation::integrate ( Vector3  dt_x_omega)
inline

uses the vector dt_x_omega as the increment of rotation expressed in the world frame. Which gives R_{k+1}=\exp(S(dtxomega))R_k. This function is also used to sum two Orientations expressed in the same frame at the same time k, even for the LocalKinematics (the integration of the orientation is different but not the sum)

◆ integrateRightSide()

const Orientation& stateObservation::kine::Orientation::integrateRightSide ( Vector3  dt_x_omega)
inline

use the vector dt_x_omega as the increment of rotation expressed in the local frame. Which gives R_{k+1}=R_k*exp(S(dtxomega))

◆ inverse()

Orientation stateObservation::kine::Orientation::inverse ( ) const
inline

◆ isMatrixSet()

bool stateObservation::kine::Orientation::isMatrixSet ( ) const
inline

checks that the matrix representation of the orientation has been assigned a value.

Returns
bool

◆ isQuaternionSet()

bool stateObservation::kine::Orientation::isQuaternionSet ( ) const
inline

checks that the quaternion representation of the orientation has been assigned a value.

Returns
bool

◆ isSet()

bool stateObservation::kine::Orientation::isSet ( ) const
inline

checks that the orientation has been assigned a value.

Returns
bool

◆ matrixToQuaternion_()

const Quaternion& stateObservation::kine::Orientation::matrixToQuaternion_ ( ) const
inlineprotected

◆ operator const Matrix3 &()

stateObservation::kine::Orientation::operator const Matrix3 & ( ) const
inline

◆ operator const Quaternion &()

stateObservation::kine::Orientation::operator const Quaternion & ( ) const
inline

◆ operator*() [1/2]

Orientation stateObservation::kine::Orientation::operator* ( const Orientation R2) const
inline

Multiply the rotation (orientation) by another rotation R2 the non const versions allow to use more optimized methods

◆ operator*() [2/2]

Vector3 stateObservation::kine::Orientation::operator* ( const Vector3 v) const
inline

Rotate a vector.

◆ operator=() [1/4]

Orientation& stateObservation::kine::Orientation::operator= ( const AngleAxis aa)
inline

◆ operator=() [2/4]

Orientation& stateObservation::kine::Orientation::operator= ( const Matrix3 m)
inline

◆ operator=() [3/4]

Orientation& stateObservation::kine::Orientation::operator= ( const Quaternion q)
inline

◆ operator=() [4/4]

Orientation& stateObservation::kine::Orientation::operator= ( const Vector3 v)
inline

◆ quaternionToMatrix_()

const Matrix3& stateObservation::kine::Orientation::quaternionToMatrix_ ( ) const
inlineprotected

◆ randomRotation()

static Orientation stateObservation::kine::Orientation::randomRotation ( )
inlinestatic

Returns a uniformly distributed random rotation.

◆ reset()

void stateObservation::kine::Orientation::reset ( )
inline

resets the Orientation object.

The orientation is then considered as outdated and cannot be used until it is assigned a value.

◆ setMatrix()

void stateObservation::kine::Orientation::setMatrix ( bool  b = true)
inline

switch the state of the Matrix or quaternion to set or not this can be used for forward initialization

◆ setQuaternion()

void stateObservation::kine::Orientation::setQuaternion ( bool  b = true)
inline

◆ setRandom()

Orientation& stateObservation::kine::Orientation::setRandom ( )
inline

◆ setToProductNoAlias()

const Orientation& stateObservation::kine::Orientation::setToProductNoAlias ( const Orientation R1,
const Orientation R2 
)
inline

Noalias versions of the operator*.

◆ setValue()

Orientation& stateObservation::kine::Orientation::setValue ( const Quaternion q,
const Matrix3 m 
)
inline

◆ setZeroRotation()

template<typename t = Quaternion>
Orientation& stateObservation::kine::Orientation::setZeroRotation ( )
inline

◆ synchronize()

void stateObservation::kine::Orientation::synchronize ( )
inline

synchronizes the representations (quaternion and rotation matrix)

◆ toAngleAxis()

AngleAxis stateObservation::kine::Orientation::toAngleAxis ( ) const
inline

◆ toMatrix3()

const Matrix3& stateObservation::kine::Orientation::toMatrix3 ( ) const
inline

get a const reference on the matrix or the quaternion

◆ toQuaternion()

const Quaternion& stateObservation::kine::Orientation::toQuaternion ( ) const
inline

◆ toRollPitchYaw()

Vector3 stateObservation::kine::Orientation::toRollPitchYaw ( ) const
inline

◆ toRotationVector()

Vector3 stateObservation::kine::Orientation::toRotationVector ( ) const
inline

◆ toVector4()

Vector4 stateObservation::kine::Orientation::toVector4 ( ) const
inline

◆ zeroRotation()

static Orientation stateObservation::kine::Orientation::zeroRotation ( )
inlinestatic

retruns a zero rotation

Member Data Documentation

◆ m_

CheckedMatrix3 stateObservation::kine::Orientation::m_
mutableprotected

◆ q_

CheckedQuaternion stateObservation::kine::Orientation::q_
mutableprotected

The documentation for this class was generated from the following file: