Function navtk::navutils::dcm_to_rpy
Defined in File navigation.hpp
Function Documentation
-
Vector3 navtk::navutils::dcm_to_rpy(const Matrix3 &dcm)
Converts a DCM to Euler angles.
When provided a
dcmthat rotates a vector from frame B to frame A ( \(\textbf{C}_\text{B}^\text{A}\)), this function returns the yaw, pitch, and roll that correspond to a 3-2-1 frame rotation sequence from frame A to frame B as described inrpy_to_dcm.REFERENCE: This function implements the transpose of Titterton and Weston eqs 3.66 through 3.68, and Savage, eq 3.2.3.2-3 and 3.2.3.2-4. Note the difference in the equations for the pitch near \( \frac{-\pi}{2} \) case with the Savage version having a \( \pi \) offset; this is the version implemented here. When pitch is near \( \pm\frac{\pi}{2} \), roll and yaw rotations appear to be about the same axis and one must be selected to be ‘held’ and the other solved for in relation to the held angle. This function will always hold the ‘roll’ angle when required.
See also
- Parameters
dcm – Direction cosine matrix ( \(\textbf{C}_\text{B}^\text{A}\))
- Returns
Equivalent Euler angles [roll pitch yaw] (radians) that describe a frame rotation from frame A to frame B.