This class implements an euler rotation with angles: yaw, pitch and roll.
More...
|
typedef T | Type |
| Definition of the used data type. More...
|
|
|
static void | decomposeRotationMatrixToYXZ (const SquareMatrixT3< T > &matrix, T &yAngle, T &xAngle, T &zAngle) |
| Decomposes a 3x3 rotation matrix to the corresponding yaw, pitch and roll angles as defined by the euler class. More...
|
|
static void | decomposeRotationMatrixToXYZ (const SquareMatrixT3< T > &matrix, T &xAngle, T &yAngle, T &zAngle) |
| Decomposes a 3x3 rotation matrix to the corresponding x, y and z angles. More...
|
|
static void | adjustAngles (T &yaw, T &pitch, T &roll) |
| Adjusts euler angles with arbitrary value (e.g., outside the valid value range) to euler angles within the value range of a valid Euler object. More...
|
|
template<typename T>
class Ocean::EulerT< T >
This class implements an euler rotation with angles: yaw, pitch and roll.
The yaw angle is defined about the positive y-axis with range [-Pi, Pi].
The pitch angle is defined about the positive x-axis with range [-Pi/2, Pi/2].
The roll angle is defined about the positive z-axis with range [-Pi, Pi].
The entire rotation can be written as matrix product: Ry(yaw) * Rx(pitch) * Rz(roll).
All angles are defined in radian.
- Template Parameters
-
T | Data type of angle values_ |
- See also
- Euler, EulerF, EulerD, Rotation, Quaternion, SquareMatrix3, ExponentialMap.
◆ Type
Definition of the used data type.
◆ EulerT() [1/7]
Creates a new Euler rotation with all angles zero.
◆ EulerT() [2/7]
Creates a new euler rotation by given angles.
- Parameters
-
yaw | The yaw angle with range [-Pi, Pi] |
pitch | The pitch angle with range [-Pi/2, Pi/2] |
roll | The roll angle with range [-Pi, Pi] |
◆ EulerT() [3/7]
Creates a new euler rotation by an array of angles.
- Parameters
-
arrayValue | Array with three angles, with order yaw, pitch, roll, must be valid |
◆ EulerT() [4/7]
Creates a new euler rotation by a given homogeneous transformation.
- Parameters
-
transformation | The homogeneous transformation to create a euler rotation from |
◆ EulerT() [5/7]
Creates a new euler rotation by a given angle-axis rotation.
- Parameters
-
rotation | Angle-axis rotation to create a euler rotation from |
◆ EulerT() [6/7]
Creates a new euler rotation by a given quaternion rotation.
- Parameters
-
quaternion | The quaternion rotation to create a euler rotation from |
◆ EulerT() [7/7]
Creates a new euler rotation by a given 3x3 matrix rotation.
- Parameters
-
matrix | The rotation matrix to create a euler rotation from |
◆ adjustAngles()
template<typename T >
void Ocean::EulerT< T >::adjustAngles |
( |
T & |
yaw, |
|
|
T & |
pitch, |
|
|
T & |
roll |
|
) |
| |
|
static |
Adjusts euler angles with arbitrary value (e.g., outside the valid value range) to euler angles within the value range of a valid Euler object.
- Parameters
-
yaw | The yaw angle to be adjusted, in radian, afterwards will be in the value range of [-PI, PI], with range (-infinity, infinity) |
pitch | The pitch angle to be adjusted, in radian, afterwards will be in the value range of [-PI/2, PI/2], with range (-infinity, infinity) |
roll | The roll angle to be adjusted, in radian, afterwards will be in the value range of [-PI, PI], with range (-infinity, infinity) |
◆ decomposeRotationMatrixToXYZ()
Decomposes a 3x3 rotation matrix to the corresponding x, y and z angles.
The provided rotation matrix can be recreated by the matrix product: Rx(xAngle) * Ry(yAngle) * Rz(zAngle).
- Parameters
-
matrix | The 3x3 square matrix to decompose, must be an orthonormal rotation matrix |
xAngle | The resulting x angle (rotation around the x-axis), with range [-PI, PI] |
yAngle | The resulting y angle (rotation around the y-axis), with range [-PI/2, PI/2] |
zAngle | The resulting z angle (rotation around the z-axis), with range [-PI, PI] |
Combined rotation matrix for R(x)R(y)R(z) [ cy cz -cy sz sy ] [ cx sz + sx sy cz cx cz - sx sy sz -sx cy ] [ sx sz - cx sy cz sx cz + cx sy sz cx cy ]
Combined rotation matrix for R(x)R(y)R(z), with sy == -1 and cy == 0 [ 0 0 1 ] [ 0 0 1 ] [ cx sz - sx cz cx cz + sx sz 0 ] = [ -sin(x - z) cos(x - z) 0 ] [ sx sz + cx cz sx cz - cx sz 0 ] [ cos(x - z) sin(x - z) 0 ]
Combined rotation matrix for R(x)R(y)R(z), with sy == 1 and cy == 0 [ 0 0 1 ] [ 0 0 1 ] [ cx sz + sx cz cx cz - sx sz 0 ] = [ sin(x + z) cos(x + z) 0 ] [ sx sz - cx cz sx cz + cx sz 0 ] [ -cos(x + z) sin(x + z) 0 ]
◆ decomposeRotationMatrixToYXZ()
Decomposes a 3x3 rotation matrix to the corresponding yaw, pitch and roll angles as defined by the euler class.
The provided rotation matrix can be recreated by the matrix product: Ry(yAngle) * Rx(xAngle) * Rz(zAngle).
- Parameters
-
matrix | The 3x3 square matrix to decompose, must be an orthonormal rotation matrix |
yAngle | The resulting (yaw) angle (rotation around the y-axis), with range [-PI, PI] |
xAngle | The resulting (pitch) angle (rotation around the x-axis), with range [-PI/2, PI/2] |
zAngle | The resulting (roll) angle (rotation around the z-axis), with range [-PI, PI] |
Combined rotation matrix for R(y)R(x)R(z) [ cy cz + sx sy sz cz sx sy - cy sz cx sy ] [ cx sz cx cz -sx ] [ -cz sy + cy sx sz cy cz sx + sy sz cx cy ]
Combined rotation matrix for R(y)R(x)R(z), with sx == -1 and cx == 0 [ cy cz - sy sz - cz sy - cy sz 0 ] [ cos(y + z) -sin(y + z) 0 ] [ 0 0 -1 ] = [ 0 0 -1 ] [ -cz sy - cy sz - cy cz + sy sz 0 ] [ -sin(y + z) -cos(y + z) 0 ]
Combined rotation matrix for R(y)R(x)R(z), with sx == 1 and cx == 0 [ cy cz + sy sz cz sy - cy sz 0 ] [ cos(y - z) sin(y - z) 0 ] [ 0 0 -1 ] = [ 0 0 -1 ] [ -cz sy + cy sz cy cz + sy sz 0 ] [ sin(z - y) cos(y - z) 0 ]
◆ isValid()
Returns whether the euler rotation holds valid parameters.
- Returns
- True, if so
◆ operator!=()
Returns whether two euler rotations are not identical up to a small epsilon.
- Parameters
-
euler | Right euler rotation |
- Returns
- True, if so
◆ operator()() [1/4]
Access operator.
- Returns
- Pointer to the elements
◆ operator()() [2/4]
Access operator.
- Returns
- Pointer to the elements
◆ operator()() [3/4]
Element access operator.
- Parameters
-
index | The index of the element to access, with range [0, 2] |
- Returns
- Element of the euler rotation
◆ operator()() [4/4]
template<typename T >
const T & Ocean::EulerT< T >::operator() |
( |
const unsigned int |
index | ) |
const |
|
inline |
Element access operator.
- Parameters
-
index | The index of the element to access, with range [0, 2] |
- Returns
- Element of the euler rotation
◆ operator==()
Returns whether two euler rotations are identical up to a small epsilon.
- Parameters
-
euler | Right euler rotation |
- Returns
- True, if so
◆ operator[]() [1/2]
Element access operator.
- Parameters
-
index | The index of the element to access, with range [0, 2] |
- Returns
- Element of the euler rotation
◆ operator[]() [2/2]
template<typename T >
const T & Ocean::EulerT< T >::operator[] |
( |
const unsigned int |
index | ) |
const |
|
inline |
Element access operator.
- Parameters
-
index | The index of the element to access, with range [0, 2] |
- Returns
- Element of the euler rotation
◆ pitch() [1/2]
Returns the pitch angle.
- Returns
- Pitch angle in radian
◆ pitch() [2/2]
Returns the pitch angle.
- Returns
- Pitch angle in radian
◆ roll() [1/2]
Returns the roll angle.
- Returns
- Roll angle in radian
◆ roll() [2/2]
Returns the roll angle.
- Returns
- Roll angle in radian
◆ yaw() [1/2]
Returns the yaw angle.
- Returns
- Yaw angle in radian
◆ yaw() [2/2]
Returns the yaw angle.
- Returns
- Yaw angle in radian
◆ values_
The three angles of the euler rotation.
The documentation for this class was generated from the following file: