From Robotics
Jump to: navigation, search
← Back: Euler angles Overview: Quaternions Next: Basic properties of quaternions

Using homogeneous matrices for transformations is working well in theory. But practically there are several problems especially when multiple transformations are applied successively. First problem is, that matrix multiplication needs a lot of computations and thus computation time. Additionally no computer calculates a hundred percent correctly. So errors in matrix multiplication increase over time when multiple multiplications are calculated. This leads to matrices that are no longer orthonormal, which means that the three coordinate axes described by the matrix are not orthogonal anymore. So applying these matrices results in distorted transformations.

Furthermore rotation matrices can be defined with the 3 Euler angles. But using Euler angles can result in the loss of one degree of freedom. This so called Gimbal lock arises if two of the three rotation axes are parallel. Then two angles define the same rotation. For further information see the videos below.

Quaternions avoid these problems. They are an extension of real numbers to a four-dimensional number system using imaginary units. As quaternions have been described at first by William Rowan Hamilton, they are also called Hamilton numbers.

A quaternion consists of a scalar part with one component and a vector part with three components. The vector components are assigned to imaginary units, which is why they are also called the imaginary part. A quaternion \overset{\circ}{q} can be written as

\overset{\circ}{q} &= s + \mathbf{v} \\
&= s + v_1i + v_2j + v_3k \\
&= \text{Re}(\overset{\circ}{q}) + \text{Im}(\overset{\circ}{q})

where s, v_1, v_2, v_3 \in \R and i, j, k are imaginary units.

Often the four components of a quaternion are named correspondingly to the label of the quaternion itself. So assuming a quaternion q the four components are also denoted with \overset{\circ}{q}:

\overset{\circ}{q} = q_0 + q_1i + q_2j + q_3k

There is a second notation for quaternions, the vector notation, avoiding imaginary units. In this notation the operator \oplus concatenates the scalar and the vector part, which obviously cannot be added to each other. So on one side of the operator there is only the scalar part and on the other side only the vector part:

\overset{\circ}{q} = q_0 \oplus \vec{\mathbf{q}} \quad \text{with } \vec{\mathbf{q}} = [q_1, q_2, q_3]^T \in \R^3

This can also also be denoted as

\overset{\circ}{q} = (q_0,\vec{\mathbf{q}})

In the following subarticles all important aspects of quaternions are treated in detail: