Rigid Body Dynamics Library
Quaternion Class Reference

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

#include <Quaternion.h>

+ Inheritance diagram for Quaternion:

Public Member Functions

 Quaternion ()
 
 Quaternion (const Vector4d &vec4)
 
 Quaternion (Scalar x, Scalar y, Scalar z, Scalar 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, Scalar 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 22 of file Quaternion.h.

Constructor & Destructor Documentation

◆ Quaternion() [1/3]

Quaternion ( )
inline

Definition at line 24 of file Quaternion.h.

◆ Quaternion() [2/3]

Quaternion ( const Vector4d vec4)
inline

Definition at line 27 of file Quaternion.h.

◆ Quaternion() [3/3]

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

Definition at line 30 of file Quaternion.h.

Member Function Documentation

◆ conjugate()

Quaternion conjugate ( ) const
inline

Definition at line 176 of file Quaternion.h.

References Quaternion::Quaternion().

◆ fromAxisAngle()

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

Definition at line 104 of file Quaternion.h.

References Quaternion::Quaternion(), std::cos(), and std::sin().

◆ fromGLRotate()

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

Definition at line 60 of file Quaternion.h.

References Quaternion::Quaternion(), std::cos(), and std::sin().

◆ fromMatrix()

static Quaternion fromMatrix ( const Matrix3d mat)
inlinestatic

Definition at line 115 of file Quaternion.h.

References Quaternion::Quaternion(), and std::sqrt().

◆ fromXYZAngles()

static Quaternion fromXYZAngles ( const Vector3d xyz_angles)
inlinestatic

Definition at line 136 of file Quaternion.h.

References Quaternion::fromAxisAngle().

◆ fromYXZAngles()

static Quaternion fromYXZAngles ( const Vector3d yxz_angles)
inlinestatic

Definition at line 130 of file Quaternion.h.

References Quaternion::fromAxisAngle().

◆ fromZYXAngles()

static Quaternion fromZYXAngles ( const Vector3d zyx_angles)
inlinestatic

Definition at line 124 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 208 of file Quaternion.h.

References Quaternion::Quaternion().

◆ operator*() [1/2]

Quaternion operator* ( const double &  s) const
inline

Definition at line 33 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 42 of file Quaternion.h.

References Quaternion::Quaternion().

◆ operator*=()

Quaternion & operator*= ( const Quaternion q)
inline

Definition at line 50 of file Quaternion.h.

References Vector4_t::set().

◆ rotate()

Vector3d rotate ( const Vector3d vec) const
inline

Definition at line 189 of file Quaternion.h.

References Quaternion::conjugate().

◆ slerp()

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

Definition at line 70 of file Quaternion.h.

References Quaternion::Quaternion(), std::acos(), std::isnan(), std::sin(), and std::sqrt().

◆ timeStep()

Quaternion timeStep ( const Vector3d omega,
double  dt 
)
inline

Definition at line 184 of file Quaternion.h.

References Quaternion::fromAxisAngle().

◆ toMatrix()

Matrix3d toMatrix ( ) const
inline

Definition at line 142 of file Quaternion.h.


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