Jump to content

  • Log In with Google      Sign In   
  • Create Account


Orientation representation: Is it really true that all representations with 3 values suffer from gimbal lock ?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Frederick   Members   -  Reputation: 140

Like
0Likes
Like

Posted 21 March 2011 - 08:35 AM

Hi,

unfortunately i have found no solution for my other problem, so I will have to live with that.

But in my quest for the shortest adequate representation of 3D rotations for my diploma thesis I ran into some questions, I can´t answer myself. I will
ask my prof, but I try here too, because I expect that the practical understanding of quaternions and rotations is actually better in the gaming community.

If you are interested: my project is about motion capturing, formulated as an optimization problem with approximate 25 degrees of freedom. So it is really important
to have short representations for rotations (matrices are no option).

My question:

Looking at this wikipedia quote:

It can be shown that no two-parameter coordinate system can avoid such degeneracy. We can avoid such problems by embedding the sphere in three-dimensional space and parameterizing it with three Cartesian coordinates (here w,x,y),


So analogous we can´t represent a rotation in 3D with 3 values, but...

Points on the sphere satisfy the constraint w2 + x2 + y2 = 1, so we still have just two degrees of freedom though there are three coordinates.


We can note that one coordinate is always redundant, because w^2 = 1 - x^2 - y^2. Why bother about the w ? Isn´t it a bad approach to store redundant values, which can be inferred easily ?

Actually if we look at quaternion representation there is a compact axis-angle representation hidden in the four values. Actually the first three values x,y,z denote a vector which acts as a rotational axis. The angle is encoded as the axis length. Maximally short and elegant if you ask me.

Back up:

The point (w,x,y,z) represents a rotation around the axis directed by the vector (x,y,z) by an angle Posted Image


We have an axis-angle representation realised by now, with actually three values rather than four and to my best knowledge, axis angle representations do not suffer from gimbal lock. But why is it stated on a regular basis, that there is no gimbal lock free representation with three values and why is a redundant value stored in the quaternion representation ?

I am sure someone can shed some light in my dark ;)

Cheers,
Frederik

Sponsor:

#2 haegarr   Crossbones+   -  Reputation: 3261

Like
1Likes
Like

Posted 21 March 2011 - 09:33 AM

I'm not a mathematician, so I may be inexact or even wrong.

1. With x2 + y2 + z2 = 1 and (x, y) given, you still cannot compute a unique z. You are only happy with this if +z and -z have the same meaning. In the case of quaternions it is true that for each orientation in 3D space 2 equivalent quaternions exist, one being the negated version of the other. But due to the square, the sign is lost anyway.

2. A rotation matrix can be interpreted as a basis. Such an interpretation is (AFAIK) not existent for quaternions. Saying "if we look at quaternion representation there is a compact axis-angle representation hidden in the four values" is wrong w.r.t. a geometric interpretation. Of course, you can convert from quaternion to axis/angle (or matrix, or Euler angles, or whatever), so in this sense it is hidden therein, but I think that isn't the statement behind the sentence.

3. A quaternion need not be of unit length, but only unit-quaternions represent pure rotations. So from the standpoint of the general quaternion, the unit-length is not a must and hence there is no redundancy. Just your usage may introduce this redundancy.

4. Although a 3D axis/angle representation where the angle is encoded in the vector's length is more compact than a quaternion, you also have to consider the operations like concatenation and application onto a vector.

5. AFAIK gimbal lock is a problem of consecutive rotations where a particular rotation becomes worthless because of the previous rotations. This has nothing to do with the number of co-efficients but with the method of rotations one uses to compose the overall rotation. That said, gimbal lock may occur when using quaternions or axis/angle rotations as well; you just have to use them in the same manner as Euler angles are used, for example.

#3 Frederick   Members   -  Reputation: 140

Like
0Likes
Like

Posted 21 March 2011 - 02:23 PM

Hi,

I'm not a mathematician, so I may be inexact or even wrong.


Neither am I :P

1. With x2 + y2 + z2 = 1 and (x, y) given, you still cannot compute a unique z. You are only happy with this if +z and -z have the same meaning. In the case of quaternions it is true that for each orientation in 3D space 2 equivalent quaternions exist, one being the negated version of the other. But due to the square, the sign is lost anyway


Well thats interesting. The w value is not completely redundant, but stores a sign, which will disambiguate the dual rotations. Quaternions seem to cover the action of rotation not only the result, which means not only the end orientation is stored, but also the way taken to reach it.

For me that is not so important, and its totally fine to loose this extra information.

2. A rotation matrix can be interpreted as a basis. Such an interpretation is (AFAIK) not existent for quaternions. Saying "if we look at quaternion representation there is a compact axis-angle representation hidden in the four values" is wrong w.r.t. a geometric interpretation. Of course, you can convert from quaternion to axis/angle (or matrix, or Euler angles, or whatever), so in this sense it is hidden therein, but I think that isn't the statement behind the sentence.


Well there is a geometric interpretation, have a look at the wiki. Quaternion is actually axis/angle, with the axis scaled by some sine of the angle.
Again the quote:

he point (w,x,y,z) represents a rotation around the axis directed by the vector (x,y,z) by an angle Posted Image


3. A quaternion need not be of unit length, but only unit-quaternions represent pure rotations. So from the standpoint of the general quaternion, the unit-length is not a must and hence there is no redundancy. Just your usage may introduce this redundancy.


Right but un-normalised quaternions are not of great use, unlike unnormalised homogenous coordinates !? Or are there other use cases for quaternions ?

5. AFAIK gimbal lock is a problem of consecutive rotations where a particular rotation becomes worthless because of the previous rotations. This has nothing to do with the number of co-efficients but with the method of rotations one uses to compose the overall rotation. That said, gimbal lock may occur when using quaternions or axis/angle rotations as well; you just have to use them in the same manner as Euler angles are used, for example.


Given, but it is often stated that representations with only three values are degenerate at some point.

It can be shown that no two-parameter coordinate system can avoid such degeneracy.

In our case thats 3D.

This doesn´t seem to apply to "axis scaled by angle".

Any more enlightenment ? Actually I am favouring "scaled axis" over eulers at the moment. I believe including w would cause only trouble, since this would require the optimization process to care for the quaternion constraints.

Thanks al lot!
Frederik

#4 scgames   Members   -  Reputation: 1961

Like
1Likes
Like

Posted 21 March 2011 - 02:44 PM

Given, but it is often stated that representations with only three values are degenerate at some point.

I've never run across that particular statement (not to say it's not out there somewhere).

In any case, a compressed quaternion represented using three elements should work fine and should not suffer from any degeneracies (IINM). Furthermore, you could probably use Euler angles as well (just using Euler angles to store and transmit orientations and rotations should not introduce problems such as gimbal lock).

Either way, you should be able to represent your orientations/rotations using three elements. (As for the actual memory requirements, that depends on how many bits of precision you need for each element.)

#5 Frederick   Members   -  Reputation: 140

Like
0Likes
Like

Posted 22 March 2011 - 04:02 AM

Hi jyk,

I've never run across that particular statement (not to say it's not out there somewhere).


This is from wikipedia. Maybe this is right for angular representations only. But I have definitelty seen relaxations of this sentence stating that 3 parameters are generelly insufficient.

In the same way the hyperspherical space of 3D rotations can be parameterized by three angles (Euler angles), but any such parameterization is degenerate at some points on the hypersphere, leading to the problem of gimbal lock.


I am not too sure about the eulers though. I will try (actually my computer will ;)) many poses to search for one which minimizes the error to a depth image. So its not completely unlike that the problem with gimbal lock could occur. I have read about character animators who are used to work around gimbal lock :o I can´t exactly tell so I will try the compressed quaternion form.

Thanks!

#6 scgames   Members   -  Reputation: 1961

Like
0Likes
Like

Posted 22 March 2011 - 05:21 AM

This is from wikipedia.

I think that statement is just in reference to Euler angles, not to three-parameter representations in general. (Given that both axis-angle pairs and unit-length quaternions can be compressed to three elements, and that neither of those representations suffers from such degeneracies, I think it's safe to say that the 'three parameter' comment is only in reference to Euler angles.)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS