Function navtk::navutils::quat_prop

Function Documentation

Vector4 navtk::navutils::quat_prop(const Vector4 &q, const Vector3 &r)

Propagate a quaternion.

See Titterton and Weston 2nd ed. eqs 11.39-11.42.

Consider a quaternion q that describes the frame rotation to rotate a coordinate frame from frame \(\text{A}\) to frame \(\text{B}\), expressed as \(\textbf{q}_\text{B}^\text{A}\). (Note that this is equivalent to vector rotation required to rotate a vector from frame \(\text{B}\) to frame \(\text{A}\). See Appendix in Coordinate Frames for more details on the difference between a frame rotation and a vector rotation.)

Now, consider we have an incremental rotation r of the \(\text{B}\) frame that causes the \(\text{B}\) frame to have a slight rotation to become the \(\text{B}^{\prime}\) frame. For this function, this incremental rotation is expressed as a rotation vector which describes the frame rotation to apply to convert frame \(\text{B}\) into frame \(\text{B}^{\prime}\).

In the above case, the quaternion that will be output by the function is \(\textbf{q}_{\text{B}^{\prime}}^\text{A}\).

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

  • r – Rotation vector describing an incremental rotation of the \(\text{B}\) frame to become the \(\text{B}^{\prime}\)

Returns

Quaternion describing the frame rotation from frame \(\text{A}\) to frame \(\text{B}^{\prime}\) ( \(\textbf{q}_{\text{B}^{\prime}}^\text{A}\))