Function navtk::navutils::correct_quat_with_tilt

Function Documentation

Vector4 navtk::navutils::correct_quat_with_tilt(const Vector4 &q, const Vector3 &t)

Corrects a quaternion with a vector of tilts.

If the quaternion q describes the vector rotation from frame \(\text{B}\) to frame \(\text{A}\) ( \(\textbf{q}_\text{B}^\text{A}\)), and the vector t represents the small “tilt” corrections that describe the frame rotation from the \(\text{A}_{corrected}\) frame to the \(\text{A}\) frame, then this function will return the quaternion representing a vector rotation from the \(\text{B}\) frame to the \(\text{A}_{corrected}\) frame ( \(\textbf{q}_\text{B}^{\text{A}_{corrected}}\)).

By way of example, suppose that a quaternion is being calculated by an inertial mechanization algorithm which describes the sensor frame \(\text{S}\) relative to what is assumed to be the \(\text{NED}\) frame ( \(\textbf{q}_\text{S}^{\text{NED}_{assumed}}\)). There are tilt errors (perhaps estimated by a Kalman filter) of \(\epsilon_x\), \(\epsilon_y\), and \(\epsilon_z\) which describe how much the true NED frame would need to be rotated about the x, y, and z axes to become the \(\text{NED}_{assumed}\) frame. When these rotations (which are essentially a rotation vector) are converted into a quaternion, this frame rotation is expressed, following the conventions described in Coordinate Frames, as \(\textbf{q}_{\text{NED}_{assumed}}^{\text{NED}_{true}}\).

The output of this function in this case is

\(\textbf{q}_\text{S}^{\text{NED}_{true}} = \textbf{q}_{\text{NED}_{assumed}}^{\text{NED}_{true}} \textbf{q}_{S}^{\text{NED}_{assumed}}\)

Note that this definition is consistent with the definition of tilts used in Titterton and Weston 2nd ed, eq 12.6.

Parameters
  • q – Quaternion that describes a vector rotation from arbitrary frame \(\text{B}\) to arbitrary frame \(\text{A}\): \(\textbf{q}_{\text{B}}^{\text{A}}\)

  • t – Vector of tilt rotations about the x, y, and z axes that describe a frame rotation from frame \(\text{A}_{corrected}\) to frame \(\text{A}\)

Returns

Quaternion that describes a vector rotation from frame \(\text{B}\) to frame \(\text{A}_{corrected}\) ( \(\textbf{q}_\text{B}^{\text{A}_{corrected}}\))