Convert 3 euler angles to one value

kri_kri

New member
Joined
Nov 12, 2013
Messages
9
Reaction score
0
Points
0
Hi,

I would like to ask if anyone knows how to convert/combine x,y,z euler angles into ONE value? Is there any function for this? I've searched but I found the conversion into matrices or quaternions, but these output more than one value (i.e. rotations and vector). Am I correct?

I'm trying to input data to SPSS for statistical analysis for gesture recognition, and I insert for each joint 3 columns (x,y,z rotation) but I want to have ONE column for each joint and hence ONE value in order to analyze and classify them correctly..

Also, just to clarify, that the system that I use for recording uses gimbal lock three-dimensional mechanism and I tried to insert only one rotation, for example x rotations for each joint but the gestures crucially depends on ALL the three-dimensions and for these l'm trying to find a function..

Any suggestions?

Thank you very much! With regards
 
How can you express a 3D relative vector with just one angle? I cannot visualize what that would mean.

Could you handle imaginary numbers? At least then you have two scalars, but even then, the third dimension is important for rotation.
 
I'm trying to input data to SPSS for statistical analysis for gesture recognition {snip} the system that I use for recording uses gimbal lock three-dimensional mechanism and I tried to insert only one rotation, for example x rotations for each joint but the gestures crucially depends on ALL the three-dimensions and for these l'm trying to find a function.

Uhm, I'm a bit ignorant so could you give me some background on what SPSS is? And, more importantly, a picture of your mechanical setup? "Gimbal lock mechanism": I assume this means a gimballed mechanism. "Gimbal lock" is a certain condition a gimballed mechanism might find itself in if the middle angle (most often called 'pitch') gets to plus/minus half-pi radians.

Now to your question: it seems to me like you have a collection of objects linked together in a kinematic chain.

You get pose information for these objects (which includes their position and orientation in space).

You want to know 'joint value angles' for the objects, which means: assuming these objects were linked by single-parameter revolute joints, what are the angle parameters for the joints so that the objects would get to their poses.

IF this is true (post continues after edit ...)

Let's assume you have two rigid bodies (a and b) connected by some revolute joint j. You have some markers on each of the rigid bodies, or some way to track what their pose is relative to the 'world' space or whatever your general reference frame is.

With the T^w_a and T^w_b I denoted the poses of the objects a and b. Presumably you are using homogenous 4-by-4 matrices for this, or a rotation matrix/translation vector pair.

I assume you know what the objects' shapes are, to keep this simple. In particular, I assume you know where the joint j is in the coordinate frame of body a (this would be the T^a_j matrix); I also assume you know the pose of object b in the coordinate frame of the joint when the angle is 0 (this would be the T^j_b|angle=0 matrix). If you don't know how to get those, ask and we'll work it out for your setup.

Anyhoo-

jang_zpsf40bfd62.png


First you want to get the pose of object b relative to the joint j. To do that, you need the pose of the joint in the world frame (that's the first formula in the figure).

Once you know where the joint is in world space and how it is oriented, use the second formula to find out how body b is situated relative to the joint.

Once you have that, use the third formula to get a transformation where what you're interested in is the rotation part. You tell me you've seen the formulas to convert a rotation matrix to axis-angle representation. Use those formulas to get that axis-angle representation, then discard the axis, keep the angle. Done!
 
Last edited:
SPSS is a program for statistical analysis. By saying Gimbal Lock I meant this [ame="http://en.wikipedia.org/wiki/Gimbal_lock"]Gimbal lock - Wikipedia, the free encyclopedia[/ame] . And that I cannot just select one axis of rotations for all joints, as all three are interdependent.
Well I have recording with sensors someone doing some gestures. All human joints have a hierarchical structure, with HIPS being the most important joint.
Also I’m novice in statistics so forgive me for my possible naïve questions.
To the point, unfortunately I can record only rotations of the three axis and not the positions of the joints. As a result I have 3 euler angles for each joint per frame that represent the human’s motion.
I’m a bit confused with what you proposed, but if I understood correctly, you mean to convert euler angles into axis-angles representation and after that to keep only the angle? Is there any possibility to lose any important information with that way?
Thank you very much!
With regards
 

The pretty pictures in the articles are of gimballed mechanisms. Gimbal lock is not a mechanism, it's a state such a mechanism might be in. Just so we're clear on the terminology.

And that I cannot just select one axis of rotations for all joints, as all three are interdependent.

If this means what I think it does ("not all joints have the same axis") it's fine, but what I described above doesn't require all joints to have the same axis. I made an example for just one joint for simplicity, but the same method can be used if you have a chain of bodies, each linked through the next through a joint with only one rotational degree of freedom.

But that "all joint axis are interdependent" is something I don't understand. Explain.

To the point, unfortunately I can record only rotations of the three axis and not the positions of the joints. As a result I have 3 euler angles for each joint per frame that represent the human’s motion.

That's ok actually, as far as my example goes. In the end, you want the rotation component in the result transformation matrix R. And that depends only on the rotation components of the various T matrices.

I’m a bit confused with what you proposed, but if I understood correctly, you mean to convert euler angles into axis-angles representation and after that to keep only the angle? Is there any possibility to lose any important information with that way?

Lol, didn't it strike you that this is exactly what you're doing when you ask us to convert three angles into one?

But what does 'lose information' mean? Basically, you want to be able to recover the poses (or at least the orientations) of the bodies in your kinematic chain. For that, you could record their poses (which is what you do) OR notice that you already have some information about the kinematic structure, which makes the full list of body poses redundant.

Example (notice, this is exactly the example I gave): suppose you have two bodies, linked by one single degree of freedom joint. You know the pose of the first, you know the pose of the second, so that's one way to represent where they are and you need six numbers for it(ignore singularities for now).

But suppose instead that you knew the pose of the first (you need all three euler angles for the first), and the joint angle. Since that joint is the only degree of freedom the second body has relative to the first, you can recover its pose from these four numbers.

However, for that to work, the joint must have only one rotational degree of freedom. Is this really the case for your system?
 
Last edited:
First of all thank you very much BLANDCorporatio!

Secondly I think that it's clear what you've proposed to me.

Also for your last question and if I understood correctly, the system doesn't have only one rotational degree of freedom, because each joint has 3 Euler rotations, referring to the 3 axis (X,Y, Z) and as a result each joint has 3 degrees of freedom..This was the reason that I mentioned gimbal lock or that the axis of each joint are interdependent (even mistakenly)..:) I don't know if you understand what I'm trying to say..

Thank you!
 
Also for your last question and if I understood correctly, the system doesn't have only one rotational degree of freedom, because each joint has 3 Euler rotations, referring to the 3 axis (X,Y, Z) and as a result each joint has 3 degrees of freedom..

That's the kicker. How can one body move relative to the one preceding it in the kinematic chain determines if your original question is solvable.

Incidentally, one gymbal is the same as a one-degree-of-freedom (rotational) joint.

So that this doesn't get complicated: how does your mechanism look like and what do you measure?
 
Well, we have a suit with inertial sensors that capture/record the upper human body. We have sensors for each joint (hands, arms, shoulders, neck, etc). Also for each joint we record per frame 3 euler angles in degrees.

If I understood correctly from the theory, euler rotation is a rotation about a single cartesian axis, so for each joint of the skeleton, a rotation along the three axes X, Y and Z is defined, and euler rotations with three degrees of freedom are thus formed by concatenating three single-axis rotations.

Am I answering to your question? : )
 
Argh, terminology.

The terminology I'm used to is the following: a "link" is an object in a kinematic chain. The arm is a link, the forearm is another. The "elbow" is the "joint" that connects the two links. It's not the only terminology there is, it's just the one I'm used to. You know the drill, everyone thinks theirs is best :P

So in my terminology, I'd say you have a suit with inertial sensors (the Movit suit, by any chance?) that records angles for the links of the body: torso, arms, forearms, hands, neck.

The next question is, what do you really want to get from the measurements?

Example: I could say the elbow is a single degree-of-freedom joint, so if you want to describe gestures by how open the elbow angle is, you can. It makes sense to talk of one 'elbow angle', and the relative pose of the forearm to the arm is determined by this one elbow angle.

However, the 'shoulder' is a three-degree-of-freedom joint (so is the 'wrist', btw). You need all 3 shoulder angles to specify how the arm is located relative to the torso.

So then, how do you think you should describe a gesture?
 
Sorry for the terminology..

Is there any reference describing these relations between the links and the degree-of-freedom, which I could find?

In the long term I want these rotations for gesture recognition. But in short term I want to make some statistical analysis, a classification of the links.

The classification that I do now with all the rotations gives emphasis on the axis, while I want to have conclusions with the links (containing these angles). This is the reason why I want to convert euler angles..

Thank you once more!!
 
Is there any reference describing these relations between the links and the degree-of-freedom, which I could find?

Presumably, but you have such a reference on hand- yourself. The system you study is a human body, which is what you have (right? ;) ), so if you want to know what degrees of freedom a bone has relative to its neighbors, well, just try and see how you can move.

In the long term I want these rotations for gesture recognition. But in short term I want to make some statistical analysis, a classification of the links. {snipped rest}

This is a bit fuzzy, so let's clarify a bit. What classification? What criterion?
 
Thanks for the first!

For the second: it's a bit expected the criterion, and we know the results but it depends on the gesture that the user will make and I consider that this will help me in the gesture recognition. So being more specifically, I want to classify the links that best describe each gesture that is being performed.
 
Unfortunately that doesn't quite make it clear for me. Could you provide an example? Say you wanted to recognize a hand wave. How do you intend to do that?
 
Well let’s say that I’ve recorded a hand wave with all sensors. I’ll have data for all links. So in classification I want to have firstly hand, then arm, etc. These links that best describe each gesture that is being recorded.
So I want one value for each link, not the 3 euler rotations..
 
Well let’s say that I’ve recorded a hand wave with all sensors. I’ll have data for all links. So in classification I want to have firstly hand, then arm, etc. These links that best describe each gesture that is being recorded.
So I want one value for each link, not the 3 euler rotations..

Ok, so if I get it right, this is what you have:

you have inertial sensors that give you 3 angles for arm, 3 angles for forearm, 3 angles for hand; each triplet of numbers gives you the orientation in the room frame of the corresponding link. 9 values total, right?

For gestures, you'll probably want the relative orientation of forearm to arm, and of hand to forearm. Do you understand how to obtain these orientations, and what the difference is between orientation relative to arm, and orientation relative to room?

In particular, the orientation of forearm to arm is to a good approximation governed by a single parameter, so there's a way to describe it using only one number. Orientation of hand relative to forearm however needs three numbers, because the wrist has 3 degrees of freedom.
 
Yes, you got it perfectly..:)

I understand the difference between the orientation relative to a link and to room. I have to find out the degrees of freedom. So if I understood there are combinations of links that I can describe them with one number (like elbow joint), but there are also some that I cannot (like shoulder and wrist that have 3 degrees of freedom). So is there any possibility for the last ones to convert them to one value or not?
Also, what about the solution that you gave me to convert them into axis-angles representation and then keep only angle per link? Sorry for going back and forth, but I do this to understand!

Thank you so much!!!
 
I understand the difference between the orientation relative to a link and to room. I have to find out the degrees of freedom.

Just to make sure we're on the same page, orientation relative to something has no connection with degrees of freedom. It just tells you how to rotate vectors from one reference frame to another. The two reference frames are related by some transformation (which we'll assume here is a pure rotation). The frames may be fixed relative to each other, or they might not; right now that's not important.

You'd describe orientation of the hand, for example, relative to the room by a rotation matrix. What that means is, if you had a vector whose components you measure in the room frame, you'd apply the rotation matrix to get what that vector looks like in the coordinate system attached to the hand. Clear so far?

Orientation of forearm relative to the arm works the same way: if you had a vector measured in the arm's frame, you'd use that matrix describing forearm-to-arm orientation to see what the vector looks like in the forearm frame.

So is there any possibility for [joints with several degrees of freedom] to convert them to one value or not?

You can convert them to one value, but is that value useful to you is the question. You probably want to be able to reconstruct the object pose, at least approximately. To do that, you need at least as many numbers as the system has degrees of freedom. Or more generally, you need at least as many numbers as the behaviors you want to capture have degrees of freedom.

In your case then, the answer comes down to No.
 
BLANDCorporatio thank you very much!!!
I have to think about what we've discussed..and if I have any other problem I'll post.

Thank you!
Best regards
 
Back
Top