3
$\begingroup$

Already asked this question on mathexchange but didn't got any promising answers so posting it here Since I'm from a CG background.

I really can't understand how and why gimbal lock occurs using euler angles. First of all let me clear this "I know that gimbal lock occurs when 2 gimbals/axes coincide thus losing 1 degree of freedom"

However what I'm interested in why the axes are coinciding in the first place when they are supposed to remain perpendicular when we move anyone.

According to wikipedia here :

The general problem of decomposing a rotation into three composed movements about intrinsic axes was studied by P. Davenport, under the name "generalized Euler angles", but later these angles were named "Davenport angles" by M. Shuster and L. Markley.

Davenport proved that any orientation can be achieved by composing three elemental rotations using non-orthogonal axes.

That's what I want to hear about more. Why "non-orthogonal" ? I can't see any problems with making the axes orthogonal? What does making the axes non-orthogonal give us?

2) After the above one has been answered. How is this all tied up to rotational matrices? How can we achieve gimbal lock through the matrices when they only rotate a given point/vector around global axis. For example If i multiply a column vector with a Rotation matrix around X-axis Rx and then with Ry It will rotate around the global X-axis first, then global Y-axis second. So how can I achieve the lock situation using matrices?

EDIT:- To make it more clear I've also heard about rotation orders like in the order Y-Z-X when Y axis rotates then Z and X rotate with it but when Z rotates only X rotates with it. thus making the axes non-orthogonal. I am assuming that's what it means by non-orthogonal mentioned in the wiki article. Here is a picture.

enter image description here

As you can see in the Y-Z-X order, the Y axis remains there as in 3rd picture causing the axes to coincide...

$\endgroup$
5
  • $\begingroup$ @joojaa - I saw that question. But the answers still don't answer how or why exactly the axes coincide when they are supposed to remain perpendicular. Or if is it related to non-ortho axes mentioned in the OP. Why are we using a non-ortho frame. $\endgroup$ Feb 9, 2018 at 16:50
  • $\begingroup$ @joojaa - that's what I want to see with the coordinate frame. Show me a situation where I end up with a rotation repeating another rotation? For this to happen in a physical gimbal the rings must coincide, hence for this to happen with a coordinate frame the axes must coincide. If the axes aren't coinciding as you say, then the gimbal lock never happens as all 3 axes point in different directions maintaining the 3 degrees of freedom. $\endgroup$ Feb 9, 2018 at 17:20
  • $\begingroup$ @joojaa - Every time some one asks this question people start giving examples and pictures of "physical gimbal". I'm asking you to restrict yourself to a coordinate frame even though I know that the concept originated from the physical gimbal. I can understand what's happening in the physical gimbal but not in the coordinate frame. In the picture it says rotation direction is lost but "HOW" is it happening when the 3 coordinate axes don't coincide according to you? $\endgroup$ Feb 10, 2018 at 10:42
  • $\begingroup$ Let us continue this discussion in chat. $\endgroup$
    – joojaa
    Feb 10, 2018 at 10:52
  • $\begingroup$ The question is, even if there is a gimbal lock , what effect will cause ? You can always adjust your rotation to make the plane rotate as what you want. You don't need quaternion. $\endgroup$ Apr 11, 2021 at 16:20

2 Answers 2

3
$\begingroup$

OK I think I know what your problem is, gimbal lock does not really lock anything from a mathematical point if view, only for certain operations. See euler suggested that euler angles can define all space angles. And that is true. Its just that euler does not say that the space is uniform. Highly mathematical people also say that the euler space has impossible solutions since some positions are overlapping, but in practice this is not really a problem.

Now since you can reach any angle, and you can always unwind your angle you can reach any angle in the body. Provided that your ready to unravel the situation and start over for a computer program doing animation and a mathematician this seems reasonable.

However, this is not what most people are doing. Instead if you try to do some physical things like calculating the distance between 2 positions, the energy needed to rotate, use a external force to move the system or make a delta move in the gimbals space then this non uniformity kicks in. Simply the space is not uniform the same way that a real space is at the poles the distance to a position next to you in real space can be surprisingly far away in Euler rotation space.

So when somebody is euler locked it does not mean they can not move anywhere they just can not move in the direction they would want to move in that particular orientation of the gimbal, and close to it. Its a bit like living in the suburbs and wanting to reach your neighbors house (that is 100 m away) but being forced to go trough the center of the city (15 km away). Energetically or time wise highly wasteful.

This is a problem in 3D graphics only if you choose to interpolate in Euler angles. But for a control engineer or a mechanical engineer this can be a nightmare, since you can suddenly have a discrepancy between what your mechanism and your control logic is saying.

Now it is possible to construct the gimbal so that the pole does not really happen, just not with the orthogonal axes the space is still not uniform but it does not experience the extreme case. However it might just be easier to use some other formulation like quaternionions, or axis angle instead. (quaternionions aren't really practical if your building a real mechanism though, its possible but very convoluted)

PS: I would draw an image, its just that drawing something the wraps perfectly upon itself and is a 3d field is a bit difficult to do.

$\endgroup$
1
  • $\begingroup$ Ok wait. your post was helpful but I think I finally understand. Will post my own answer shortly. $\endgroup$ Feb 10, 2018 at 14:01
4
$\begingroup$

So thanks to joojaa I finally got a hint, and I searched on the net further and found this link which cleared all the doubts and has my answer. Though I am still posting it here as a summary.

So anyone reading this and who has similar problem to mine here is what I understood. Suppose we are considering the tait-bryan angle order X-Y-Z that is rotate first along X then Y and finally Z. Also to make it clear we are rotating around the "fixed" axes since a rotation matrix always rotates around the fixed axes. The matrix doesn't know anything about the axes moving or anything.

enter image description here

So suppose I have my initial frame like in my picture (original post) leftmost. If I use Ax with angle = 90 degrees then my Y axis becomes Z and Z becomes -Y. However if I now rotate with Ay the matrix will still be rotating around the previous/original fixed Y axis.

Now that's clear take this plane as an example. We want to rotate in the order X-Y-Z. enter image description here

If we rotate around the X-axis we can see that the plane will either roll left or right. Suppose we rotate a little around the X-axis and then rotate around Y-axis so that it is pointing straight up like this

enter image description here

Now we have to rotate around Z as this is the last in the order. But notice that the rotation around Z is similar to the previous rotation we performed around X. The plane will roll either towards the left or right. This means we lost 1 degree of freedom. I think this is what joojaa was trying to explain to me. So everywhere where people are saying the axis coincide its the local, moving frame coinciding with the original frame. Initially both the local and global frames are coinciding. In this case when we rotated around Y by 90 the local moving X-axis collapsed on to the fixed original Z- axis causing this gimbal lock

$\endgroup$
4
  • $\begingroup$ There is the same question about is, blender.stackexchange.com/questions/469/… But the answer's video I can't understand. Why do we need to parent the z-axis to the x-axis, and parent the x-axis to the y-axis? I think this is the key point $\endgroup$
    – Liu Hao
    Apr 4 at 3:52
  • $\begingroup$ @Liu Hao - The concept of parenting seems to clear up if you start thinking of ordered rotations. Let's say X-Y-Z. Think of the gimbals as they are being used to preserve the way rotation around an axis was supposed to originally move the object. For e.g, in the picture of plane, Rotation around X causes it to roll. Since X is the first in the order it doesn't affect anybody. Once we applied X, that orientation is fixed. So now when you move Y, the gimbal of X moves with it in-order to preserve the way Rotation around X was supposed to move the plane. $\endgroup$ Apr 7 at 9:18
  • $\begingroup$ If you however, think solely in terms of singular individual non-ordered rotations. You can always find an axis to apply the rotation to get the desired result. The problem lies with ordered rotations since the order has been determined pre-hand. This determining of the order leads to an apparent sense of loss of freedom since you were supposed to Rotate around X again after X-Y if you wanted the original rotation around Z. But since the order was fixed pre-hand, you basically lost that degree of freedom due to axes or more specifically "ways of rotation" collapsing onto each other $\endgroup$ Apr 7 at 9:22
  • $\begingroup$ I think the problem is not that one is missing, but rather that there is one too many. All rotations can be represented by at least one set of Euler angles, so there isn't a shortage of degrees of freedom. $\endgroup$
    – user253751
    Nov 11 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.