Rigid Body Dynamics Library
Quaternion Class Reference

Quaternion that are used for singularity free joints. More...

+ Inheritance diagram for Quaternion:

Public Member Functions

 Quaternion ()
 
 Quaternion (const Vector4d &vec4)
 
 Quaternion (double x, double y, double z, double w)
 
Quaternion operator* (const double &s) const
 
Quaternion operator* (const Quaternion &q) const
 
Quaternionoperator*= (const Quaternion &q)
 
Quaternion slerp (double alpha, const Quaternion &quat) const
 
Matrix3d toMatrix () const
 
Quaternion conjugate () const
 
Quaternion timeStep (const Vector3d &omega, double dt)
 
Vector3d rotate (const Vector3d &vec) const
 
Vector4d omegaToQDot (const Vector3d &omega) const
 Converts a 3d angular velocity vector into a 4d derivative of the components of the quaternion. More...
 
- Public Member Functions inherited from Vector4_t
template<typename OtherDerived >
 Vector4_t (const Eigen::MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
Vector4_toperator= (const Eigen::MatrixBase< OtherDerived > &other)
 
EIGEN_STRONG_INLINE Vector4_t ()
 
EIGEN_STRONG_INLINE Vector4_t (const double &v0, const double &v1, const double &v2, const double &v3)
 
void set (const double &v0, const double &v1, const double &v2, const double &v3)
 

Static Public Member Functions

static Quaternion fromGLRotate (double angle, double x, double y, double z)
 
static Quaternion fromAxisAngle (const Vector3d &axis, double angle_rad)
 
static Quaternion fromMatrix (const Matrix3d &mat)
 
static Quaternion fromZYXAngles (const Vector3d &zyx_angles)
 
static Quaternion fromYXZAngles (const Vector3d &yxz_angles)
 
static Quaternion fromXYZAngles (const Vector3d &xyz_angles)
 

Additional Inherited Members

- Public Types inherited from Vector4_t
typedef Eigen::Vector4d Base
 

Detailed Description

Quaternion that are used for singularity free joints.

order: x,y,z,w

Definition at line 21 of file Quaternion.h.

Constructor & Destructor Documentation

◆ Quaternion() [1/3]

Quaternion ( )
inline

Definition at line 23 of file Quaternion.h.

◆ Quaternion() [2/3]

Quaternion ( const Vector4d vec4)
inline

Definition at line 26 of file Quaternion.h.

◆ Quaternion() [3/3]

Quaternion ( double  x,
double  y,
double  z,
double  w 
)
inline

Definition at line 29 of file Quaternion.h.

Member Function Documentation

◆ conjugate()

Quaternion conjugate ( ) const
inline

Definition at line 164 of file Quaternion.h.

References Quaternion::Quaternion().

◆ fromAxisAngle()

static Quaternion fromAxisAngle ( const Vector3d axis,
double  angle_rad 
)
inlinestatic

Definition at line 92 of file Quaternion.h.

References Quaternion::Quaternion().

◆ fromGLRotate()

static Quaternion fromGLRotate ( double  angle,
double  x,
double  y,
double  z 
)
inlinestatic

Definition at line 59 of file Quaternion.h.

References Quaternion::Quaternion().

◆ fromMatrix()

static Quaternion fromMatrix ( const Matrix3d mat)
inlinestatic

Definition at line 103 of file Quaternion.h.

References Quaternion::Quaternion().

◆ fromXYZAngles()

static Quaternion fromXYZAngles ( const Vector3d xyz_angles)
inlinestatic

Definition at line 124 of file Quaternion.h.

References Quaternion::fromAxisAngle().

◆ fromYXZAngles()

static Quaternion fromYXZAngles ( const Vector3d yxz_angles)
inlinestatic

Definition at line 118 of file Quaternion.h.

References Quaternion::fromAxisAngle().

◆ fromZYXAngles()

static Quaternion fromZYXAngles ( const Vector3d zyx_angles)
inlinestatic

Definition at line 112 of file Quaternion.h.

References Quaternion::fromAxisAngle().

◆ omegaToQDot()

Vector4d omegaToQDot ( const Vector3d omega) const
inline

Converts a 3d angular velocity vector into a 4d derivative of the components of the quaternion.

Parameters
omegathe angular velocity.
Returns
a 4d vector containing the derivatives of the 4 components of the quaternion corresponding to omega.

Definition at line 196 of file Quaternion.h.

References Quaternion::Quaternion().

◆ operator*() [1/2]

Quaternion operator* ( const double &  s) const
inline

Definition at line 32 of file Quaternion.h.

References Quaternion::Quaternion().

◆ operator*() [2/2]

Quaternion operator* ( const Quaternion q) const
inline

This function is equivalent to multiplicate their corresponding rotation matrices

Definition at line 41 of file Quaternion.h.

References Quaternion::Quaternion().

◆ operator*=()

Quaternion& operator*= ( const Quaternion q)
inline

Definition at line 49 of file Quaternion.h.

◆ rotate()

Vector3d rotate ( const Vector3d vec) const
inline

Definition at line 177 of file Quaternion.h.

References Quaternion::conjugate().

◆ slerp()

Quaternion slerp ( double  alpha,
const Quaternion quat 
) const
inline

Definition at line 69 of file Quaternion.h.

References Quaternion::Quaternion().

◆ timeStep()

Quaternion timeStep ( const Vector3d omega,
double  dt 
)
inline

Definition at line 172 of file Quaternion.h.

References Quaternion::fromAxisAngle().

◆ toMatrix()

Matrix3d toMatrix ( ) const
inline

Definition at line 130 of file Quaternion.h.


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