Function navtk::navutils::correct_dcm_with_tilt
Defined in File navigation.hpp
Function Documentation
-
Matrix3 navtk::navutils::correct_dcm_with_tilt(const Matrix3 &dcm, const Vector3 &tilt)
Corrects a DCM by applying tilt error corrections (usually generated via the Pinson Error model).
Consider a
dcmthat rotates a vector from frame B to frame A ( \(\textbf{C}_\text{B}^\text{A}\)). Next, considertiltto be a rotation vector. When coordinate frame A is rotated by the rotation vector defined bytiltit becomes coordinate frame \(\text{A}'\).The DCM that is returned by this function would then be
\(\textbf{C}_\text{B}^{\text{A}'} = \textbf{C}_\text{A}^{\text{A}'} \textbf{C}_\text{B}^\text{A}\).
For example, consider the case where the attitude is expressed as a
dcmthat rotates from a platform frame \(\text{P}\) to the \(\text{NED}\) frame \(\textbf{C}_\text{P}^\text{NED}\). However, this attitude is not quite correct, and when applied doesn’t rotate a vector from the platform frame to the true \(\text{NED}\) frame ( \(\text{NED}_{true}\)). Thetiltcorrections represent the relationship between the assumed \(\text{NED}\) frame ( \(\text{NED}\)) and the true \(\text{NED}\) frame ( \(\text{NED}_{true}\)). If the \(\text{NED}\) coordinate frame is rotated by the rotation vector described bytilt, the result is the \(\text{NED}_{true}\) coordinate frame. In this example, the function will return the DCM corresponding to \(\textbf{C}_\text{P}^{\text{NED}_{true}}\)Note that this function is equivalent to (in pseudocode):
angle = magnitude(tilt)axis = tilt / angle(axis vector is normalized rotation vector)corrected_dcm = transpose(axis_angle_to_dcm(axis, angle)) * dcmWARNING: The definition of the tilt rotation vector given here is opposite of that used in other functions (correct_quat_with_tilt(), for example), where the tilt rotation does a frame rotation from \(\text{A}'\) to \(\text{A}\). In other words, a sign change on the tilts is required between these functions. However, the definition of tilts here is consistent with those typically estimated by our navtk::filtering::Pinson15NedBlock model using the additive error state formulation. In other words, when one has an estimated \(\textbf{C}^{\text{NED}}_\text{P}\) matrix and is using the Pinson model to estimate error states, the following applications of tilts are all equivalent and will produce \(\textbf{C}^{\text{NED}_{true}}_\text{P}\):
correct_dcm_with_tilt( \(\textbf{C}^{\text{NED}}_\text{P}\), tilt)
quat_to_dcm(correct_quat_with_tilt(dcm_to_quat( \(\textbf{C}^{\text{NED}}_\text{P}\)), -tilt))
dot(rot_vec_to_dcm(-tilt), \(\textbf{C}^{\text{NED}}_\text{P}\))
dot(transpose(rot_vec_to_dcm(tilt)), \(\textbf{C}^{\text{NED}}_\text{P}\))
See also
Coordinate Frames for more details on axis-angle and DCM expressions of attitude.
- Parameters
dcm – The DCM that rotates a vector into the estimated frame in which the tilts are defined.
tilt – Tilt errors that rotate the estimated frame to yield the corrected frame [x-tilt, y-tilt, z-tilt] (radians)
- Returns
The corrected DCM.