7

I have read so many articles on the web about Gimbal Lock and also many Q&A on Stackexchange/Stackoverflow, but nevertheless I cannot fully understand why Gimbal Lock should occur and why it should be a problem.

Let our Euler Angles formalism the following:

  • at the beginning the object reference frame and the world reference frame are aligned (right-hand rule)
  • the first rotation occurs about the (world or object) z-axys (yaw)
  • the second rotation occurs about the object y-axis which is different from the world's one (pitch)
  • the third rotation occurs about the object x-axis which is different from the world's one (roll)

Note that I am using what Wikipedia calls intrinsic formalism (ZYX or z,y',x'') to highlight that the pitch and roll rotations occur about new axis.

From several animations with physical gimbals I understood that when the yaw-gimbal and the roll-gimbal are aligned (and it happens when the object pitches of $\pm\frac\pi2$) then the rotation about those gimbals are the same.

Note that in this case we are facing with a different formalism because for example when the object pitches then the yaw gimbal doesn't follow the object orientation (see for example this top cited video at 0:47).

Anyway mathematically speaking I cannot understand why gimbal lock should occur. I try to explain what i mean in the following.

Denoting with

$$R_X=\begin{bmatrix}1&0&0\\ 0&\cos(\varphi)&-\sin(\varphi)\\ 0&\sin(\varphi)&\cos(\varphi)\end{bmatrix}$$ $$R_Y=\begin{bmatrix}\cos(\theta)&0&\sin(\theta)\\ 0&1&0\\ -\sin(\theta)&0&\cos(\theta)\end{bmatrix}$$ $$R_Z=\begin{bmatrix}\cos(\psi)&-\sin(\psi)&0\\ \sin(\psi)&\cos(\psi)&0\\ 0&0&1\end{bmatrix}$$

the rotation matrices relative to elementary rotation about the three body axis, I obtain that a general rotation of eulers angles $(yaw,pitch,roll)=(\psi,\theta,\varphi)$ is given by:

$$R=R_Z\cdot R_Y\cdot R_X$$ (note the order of rotations ZYX because I am working in the object reference frame see this).

Suppose now that i perform the following elementary rotations:

  • angle $\psi$ about z-axis (yaw)
  • angle $\theta = -\frac\pi2$ about y-axis (pitch which should cause gimbal lock)
  • angle $\varphi$ about x-axis (yaw)

Composing these rotation using the formula above I obtain: $$R=\begin{bmatrix}0&-\sin(\varphi+\psi)&-\cos(\varphi+\psi)\\ 0&\cos(\varphi+\psi)&-\sin(\varphi+\psi)\\ 1&0&0\end{bmatrix}$$

and in different articles they say that the fact that the only angle that appear in that expression is $(\varphi+\psi)$ means that yaw and roll are linked and so we lose a degree of freedom.

But it sounds strange to me. The only thing I can deduce from this result is that there are infinite sequences yaw-pitch-roll (or better yaw-$\left(-\frac\pi2\right)$-roll) which lead to the same orientation. Also I could note that given this orientation I cannot uniquely determine which sequence leads to it, but I cannot see any other problem.

Some articles say that when I am in a gimbal lock situation, to reach some position near the object I need to make a non-intuitive path (and this could be a problem in rendering applications, I have seen some animations in which the object overturns after being in a gimbal lock situations and before to reach another orientation near the gimbal lock one) but I don't know why it should happen).

Let be in this situation: $$R=\begin{bmatrix}0&-\sin(\varphi+\psi)&-\cos(\varphi+\psi)\\ 0&\cos(\varphi+\psi)&-\sin(\varphi+\psi)\\ 1&0&0\end{bmatrix}$$

and suppose $\varphi+\psi = 0$.

I obtain

$$R_0=\begin{bmatrix}0&0&-1\\ 0&1&0\\ 1&0&0\end{bmatrix}$$

Perturbing $\varphi$ or $\psi$ by a small $\varepsilon>0$, we have $$R_{\varepsilon}=\begin{bmatrix}0&-\sin(\varepsilon)&-\cos(\varepsilon)\\ 0&\cos(\varepsilon)&-\sin(\varepsilon)\\ 1&0&0\end{bmatrix}$$ which could be approximated by

$$R_{\varepsilon}=\begin{bmatrix}0&-\varepsilon&\varepsilon^2-1\\ 0&1-\varepsilon^2&-\varepsilon\\ 1&0&0\end{bmatrix}$$

that seems to me a trasformation "near" to $R_0$.

So please help me to understand what I am missing.

aleio1
  • 1,065

1 Answers1

0

In a general (non gimbal lock) orientation, you have three degrees of freedom to make perturbations to the orientation. However in a gimbal lock orientation, you only have two degrees of freedom. This is the meaning of the word 'lock'. As you have pointed out, perturbing either $\phi$ or $\psi$ leads to the same transformation, so you lose one degree of freedom.

Regarding the non-intuitive path comment, here is an analogy. Suppose you are in $\mathbb{R}^3$, and are allowed to move in the $x$, $y$, or $z$ direction. However, if you are on the $x$-axis, then you are only allowed to move in the $y$ or $z$ direction. Then points on the $x$-axis would be the 'locked' positions. To move from a point on the $x$-axis to another point, you can't move in a straight line (intuitive way). You would first have to move orthogonal to the $x$-axis, and then to the other point.

Anand
  • 1,246