This class provides conversion services between Euler angles in any of the 24 conventions and corresponding quaternions and orthogonal 3x3 matrices.
More...
|
| EulerAngles (const agx::Vec3 &angles, EulerConvention::Convention C=EulerConvention::DEFAULT_CONVENTION) |
| Explicit constructor.
|
|
| EulerAngles (const EulerAngles &e)=default |
| Convention is set to C and angles are set to 0.
|
|
template<typename T > |
| EulerAngles (const Matrix3x3T< T > &m, EulerConvention::Convention C=EulerConvention::DEFAULT_CONVENTION) |
| Construct from 3x3 Matrix in given convention.
|
|
template<typename T > |
| EulerAngles (const Matrix4x4T< T > &m, EulerConvention::Convention C=EulerConvention::DEFAULT_CONVENTION) |
| Construct from 4x4 matrix in given convention.
|
|
| EulerAngles (const OrthoMatrix3x3 &m, EulerConvention::Convention C=EulerConvention::DEFAULT_CONVENTION) |
|
| EulerAngles (const Quat &q, EulerConvention::Convention C=EulerConvention::DEFAULT_CONVENTION) |
| Construct from quaternion in given convention.
|
|
| EulerAngles (EulerConvention::Convention C=EulerConvention::DEFAULT_CONVENTION) |
| Default constructor.
|
|
| EulerAngles (Real a, Real b, Real c, EulerConvention::Convention C=EulerConvention::DEFAULT_CONVENTION) |
| Explicit constructor.
|
|
| EulerAngles (Real a, Real b, Real c, int C) |
| Explicit constructor.
|
|
template<typename T > |
bool | get (Matrix3x3T< T > &m) const |
| Compute the value of matrix m that corresponds to current angles in current convention.
|
|
template<typename T > |
bool | get (Matrix4x4T< T > &m) const |
| Compute the value of matrix m that corresponds to current angles in current convention.
|
|
bool | get (OrthoMatrix3x3 &m) const |
|
bool | get (Quat &q) const |
| Compute the value of quaternion q that corresponds to current angles in current convention.
|
|
EulerAngles::EulerOrder & | getOrder () |
| Get the convention.
|
|
const EulerAngles::EulerOrder & | getOrder () const |
| Get or set the convention.
|
|
EulerAngles & | operator= (const EulerAngles &e)=default |
| Assignment operator.
|
|
Real & | operator[] (size_t i) |
| Get an element by index as a reference.
|
|
Real | operator[] (size_t i) const |
| Get an element by index.
|
|
Real * | ptr () |
|
const Real * | ptr () const |
|
template<typename T > |
EulerAngles & | set (const Matrix3x3T< T > &m, EulerConvention::Convention C=EulerConvention::BAD) |
| Set the angles to correspond to matrix m in given convention.
|
|
template<typename T > |
EulerAngles & | set (const Matrix4x4T< T > &m, EulerConvention::Convention c=EulerConvention::BAD) |
| Compute Jacobian matrix between angular velocity in body coordinates and rate of change of angles.
|
|
EulerAngles & | set (const OrthoMatrix3x3 &m, EulerConvention::Convention C=EulerConvention::BAD) |
|
EulerAngles & | set (const Quat &q, EulerConvention::Convention C=EulerConvention::BAD) |
| Set the angles to correspond to quaternion q in given convention.
|
|
void | set (const Vec3 &angles) |
| Set the three angles in one call.
|
|
void | set (Real x, Real y, Real z) |
| Set the three angles in one call.
|
|
Real & | x () |
| Get or set the first angle.
|
|
Real | x () const |
| Get the first angle.
|
|
Real & | y () |
| Get or set the second angle.
|
|
Real | y () const |
| Get the second angle.
|
|
Real & | z () |
| Get or set the third angle.
|
|
Real | z () const |
| Get the third angle.
|
|
This class provides conversion services between Euler angles in any of the 24 conventions and corresponding quaternions and orthogonal 3x3 matrices.
There are 24 distinct Euler angles conventions which can be used to parameterize \(SO(3)\). Each of them has a singularity line in which only the sum of two of the angles is relevant to the final rotation matrix (or quaternion). Euler angles are defined as three successive rotations along three successive axes, no two successive ones being identical. This results in 12 different choice of axis sequence. Given that we can choose the reference axes or the rotated ones, this leads to 12 choices with co-rotated axes, 12 choices for fixed axes.
The different conventions are labeled so that it is easy to extract the Real nature of each of them. Following Shoemake, the last bit is used to indicate whether we are using the static or rotated frame for the coordinate axes. The next bit indicates whether the first axis is repeated as the last. The next bit is the parity of the axis sequence. The next 3 bits indicate the first axis which is either 0, 1 or 2. That information is then used to reduce the number of conventions to just two: repeated axes or non-repeated axes. Computations are made using permutations so only two computations are needed. The distinction between static axes and moving axes corresponds to an inversion of the permutation. Negative parities just negate all the angles. These last two operations are easily performed at the end of a computation.
When computing a transform matrix from a given EulerAngles, the resulting matrix transforms the coordinates of a given vector from the body frame to the world frame. However, in accordance to the OpenGL convention, the matrix is to be multiplied from the left which amounts to transposing.
Definition at line 69 of file EulerAngles.h.