Kinematic singularities

An even worse problem arises when using yaw, pitch, roll angles (and related Euler-angle variants). Even though they start off being intuitively pleasing, the representation becomes degenerate, leading to kinematic singularities that are nearly impossible to visualize. An example will be presented shortly. To prepare for this, recall how we represent locations on the Earth. These are points in $ {\mathbb{R}}^3$, but are represented with longitude and latitude coordinates. Just like the limits of yaw and pitch, longitude ranges from 0 to $ 2 \pi$ and latitude only ranges from $ -\pi/2$ to $ \pi/2$. (Longitude is usually expressed as 0 to $ 180$ degrees west or east, which is equivalent.) As we travel anywhere on the Earth, the latitude and longitude coordinates behave very much like $ xy$ coordinates; however, we tend to stay away from the poles. Near the North Pole, the latitude behaves normally, but the longitude could vary a large amount while corresponding to a tiny distance traveled. Recall how a wall map of the world looks near the poles: Greenland is enormous and Antarctica wraps across the entire bottom (assuming it uses a projection that keeps longitude lines straight). The poles themselves are the kinematic singularities: At these special points, you can vary longitude, but the location on the Earth is not changing. One of two DOFs seems to be lost.

The same problem occurs with 3D rotations, but it is harder to visualize due to the extra dimension. If the pitch angle is held at $ \beta = \pi/2$, then a kind of ``North Pole'' is reached in which $ \alpha$ and $ \gamma $ vary independently but cause only one DOF (in the case of latitude and longitude, it was one parameter varying but causing zero DOFs). Here is how it looks when combining the yaw, pitch, and roll matrices:

$\displaystyle \small \begin{bmatrix}\cos\alpha & 0 & \sin\alpha  0 & 1 & 0 \\...
...0 & 0 & -1  -\sin(\alpha-\gamma) & \cos(\alpha-\gamma) & 0  \end{bmatrix} .$ (3.27)

The second matrix above corresponds to pitch (3.17) with $ \beta = \pi/2$. The result on the right is obtained by performing matrix multiplication and applying a subtraction trigonometric identity. You should observe that the resulting matrix is a function of both $ \alpha$ and $ \gamma $, but there is one DOF because only the difference $ \alpha - \gamma$ affects the resulting rotation. In the video game industry there has been some back-and-forth battles about whether this problem is crucial. In an FPS game, the avatar is usually not allowed to pitch his head all the way to $ \pm \pi/2$, thereby avoiding this problem. In VR, it happens all the time that a user could pitch her head straight up or down. The kinematic singularity often causes the viewpoint to spin uncontrollably. This phenomenon also occurs when sensing and controlling a spacecraft's orientation using mechanical gimbals; the result is called gimbal lock.

The problems can be easily solved with axis-angle representations of rotation. They are harder to learn than yaw, pitch, and roll; however, it is a worthwhile investment because it avoids these problems. Furthermore, many well-written software libraries and game engines work directly with these representations. Thus, to use them effectively, you should understand what they are doing.

Figure 3.9: Euler's rotation theorem states that every 3D rotation can be considered as a rotation by an angle $ \theta $ about an axis through the origin, given by the unit direction vector $ v = (v_1, v_2, v_3)$.
\begin{figure}
% latex2html id marker 3472
\centerline{\psfig{file=figs/eulertheorem.eps,width=2.5in}}\end{figure}

The most important insight to solving the kinematic singularity problems is Euler's rotation theorem (1775), shown in Figure 3.9. Even though the rotation axis may change after rotations are combined, Euler showed that any 3D rotation can be expressed as a rotation $ \theta $ about some axis that pokes through the origin. This matches the three DOFs for rotation: It takes two parameters to specify the direction of an axis and one parameter for $ \theta $. The only trouble is that conversions back and forth between rotation matrices and the axis-angle representation are somewhat inconvenient. This motivates the introduction of a mathematical object that is close to the axis-angle representation, closely mimics the algebra of 3D rotations, and can even be applied directly to rotate models. The perfect representation: Quaternions.

Steven M LaValle 2016-12-31