General definitions and manipulations with quaternions can be found at Quaternions. Filtering quaternions and computation of it's temporal derivation can be found at QuaternionFilter.

Using Quaternions for Parameterizing Orientation

The orientation of a rigid body in 3D space can be parameterized by a normalized quaternion. In this case the quaternion $\tilde{q}$ describes a rotation of 3D vectors. To rotate a 3D vector $\vec{r}$, it's coordinates $\underline{r} = \left[r_x, r_y, r_z\right]^{\rm T}$ are written as a pure quaternion $\underline{\tilde{r}} = r_x i + r_y j + r_z k$. The coordinates $\underline{r}_{\rm rot}$ of the rotated vector $\vec{r}_{\rm rot}$ are computed as:

This rotation can be seen not only as a rotation in one coordinate system, but also as a transformation of coordinates of the same vector from one into another coordinate system. In this case we have only one vector $\vec{r}$, which can be written in coordinates of the body system $\underline{r}_{\rm b}$ as well as in coordinates of the fixed inertial system $\underline{r}_{\rm i}$. Assuming that the quaternion defines the current orientation of the rigid body as a rotation from the initial orientation to the current orientation, the coordinates of the vector $\vec{r}$ are transformed with:

Dealing with different coordinate systems one has to keep in mind that not only the coordinates of each vector are dependent on the coordinate system but also the rotation quaternions do. In the case of only one rotational quaternion $\tilde{q}$, describing the orientation of the rigid body, this quaternion is the same in both systems. But introducing a second rotation quaternion $\tilde{q}_{\rm rot}$ to define a rotation of the orientation for example, it must be clear in which coordinate system the rotation should be applied:

defines a rotation of $\tilde{q}$ by $\tilde{q}_{\rm rot}^{(\rm i)}$ in the fixed inertial system and

defines a rotation of $\tilde{q}$ by $\tilde{q}_{\rm rot}^{(\rm b)}$ in the body system.

Axis Angles to Quaternion

Axis angles define a rotation by a single vector $\vec{\varphi} = \alpha\,\vec{v}$, where $\vec{v}$ is a unit vector defining the rotation axis and $\alpha$ is the angle of rotation. According to the Polar Form of quaternions, the rotation quaternion can be assembled from axis angles by:

which formulates a rotation around the axis $\vec v$ (which has to be normalized) and the angle $\alpha$.

Transformation Matrix

The transformation of coordinates from one into another system can also be calculated by a transformation matrix. By expanding the product $\underline{\tilde{r}}_{\rm i} \,= \tilde{q}\,\underline{\tilde{r}}_{\rm b}\,\tilde{q}^*$ for a given rotation quaternion $\tilde{q}= q_w + q_x i + q_y j + q_z k$ the transformation matrix from coordinates of the body system to the inertial system yield:

and vice versa from inertial to body system

Angular Velocity of a Rigid Body

The temporal derivative of a quaternion $\tilde{q}$ which defines an orientation of a rigid body turning with angular velocity $\vec{\omega}$ is computed as:

Expanding the latter identity with coordinates of $\vec{\omega}$ in the body system $\underline{\tilde{\omega}}^{( \rm b)} = \omega_x i + \omega_y j + \omega_z k$ yields

QuaternionOrientation (last edited 2014-06-05 20:40:57 by StefanEngelke)