Extracting yaw, pitch, roll from transformation matrix

In summary, the two reference frames are A and B. The Euler angles needed to convert from one to the other are gamma, beta, and alpha. Craig's book provides a nice treatment of moving back and forth between transformation matrices and poses (x, y, z, rx, ry, rz), as well as a detailed explanation of the 12 sequences.
  • #1
top40
5
0
There are two references frames, A and B.

Let A's reference frame be denoted by the columns of the identity matrix, and let A's origin be (0,0,0).

Let B's reference frame and origin be denoted by a transformation matrix T, where T =

R11 R12 R13 x
R21 R22 R23 y
R31 R32 R33 z
0 0 0 1

(Sorry, I don't know how to make it fancy as this is my first post). So basically the R sub matrix is the rotation matrix, and x,y,z is the translation of the origin.

Now, I have the values of the elements of T. From this, how do I determine the yaw, pitch, and roll? Roll is defined to be the rotation about the x-axis; pitch is defined to be the rotation about the y-axis; and yaw is defined to be the rotation about the z-axis.

EDIT:

I have already seen this http://en.wikipedia.org/wiki/Rotation_matrix#General_rotations and know that I can just set R_x(gamma) * R_y(beta) * R_z(\alpha) * (a column of the R matrix) = <1,0,0> and then solve for gamma, beta, and alpha, but I was wondering if there was an easier, more direct way.
 
Last edited:
Physics news on Phys.org
  • #2
Perhaps look up "Euler angles"
 
  • #3
A couple of warnings:

1. Note that a roll-pitch-yaw sequence is not the same as a yaw-pitch-roll sequence. There are 12 such Euler sequences: The six aeronautic sequences, the standard Euler sequence (z-x-z), plus five others similar to z-x-z (z-y-z, x-y-z, ...). When you are communicating with others you had dang well better agree on a sequence.

2. You will have to worry about (near) gimbal lock versus non-gimbal lock situations. Gimbal lock occurs when the middle angle of the sequence pitch in a roll-pitch-yaw sequence is 0 or 180 degrees. Near gimbal lock is when that angle is close to 0 or 180. You need to treat those cases specially.Going from an Euler sequence to a transformation matrix is simple. Going from a matrix to a sequence is not so simple.
 
  • #5
monea83 said:
This kind of conversion is rather ugly... a nice algorithm that handles all possible configurations of axes (including roll-pitch-yaw) very compactly is given here:
I didn't say how to implement it. Whether you want to do something compact as is done in the reference or a slew of separate algorithms is somewhat orthogonal to the basic issue that there several representations do exist. The reference you provided also does not address the issue of gimbal lock. As anyone who works in the field of aviation, aerospace, or robotics can attest, failing to worry about gimbal lock opens a door so wide as to let Murphy (as in Murphy's law) and all his evil henchmen pass through in unison.
 
  • #6
Craig's book on robotics (the title is either "Introduction to..." or "Fundamentals of...") has a nice treatment of moving back and forth between transformation matrices and poses (x, y, z, rx, ry, rz), as well as a detailed explanation of the 12 sequences. It was a good starting point for me, but unfortunately I don't own the book.
 

1. How do you extract yaw, pitch, and roll from a transformation matrix?

To extract yaw, pitch, and roll from a transformation matrix, you can use the equations: yaw = atan2(m[1][0], m[0][0]), pitch = asin((-1)*m[2][0]), and roll = atan2(m[2][1], m[2][2]). These equations use the elements of the transformation matrix to calculate the rotation around each axis.

2. What is a transformation matrix?

A transformation matrix is a mathematical representation of a transformation in three-dimensional space. It is used to describe the position, orientation, and scale of an object in relation to a coordinate system.

3. What does yaw, pitch, and roll represent?

Yaw, pitch, and roll represent the rotation around the three axes of an object. Yaw is the rotation around the vertical axis, pitch is the rotation around the lateral axis, and roll is the rotation around the longitudinal axis.

4. Can you use a transformation matrix to convert between coordinate systems?

Yes, a transformation matrix can be used to convert between coordinate systems by applying the matrix to the coordinates of a point. This will result in the coordinates of the point in the new coordinate system.

5. Are there any limitations to extracting yaw, pitch, and roll from a transformation matrix?

Yes, there are limitations to extracting yaw, pitch, and roll from a transformation matrix. The equations used assume that the transformation matrix represents a pure rotation, without any translation or scaling. If the matrix includes these other transformations, the calculated values for yaw, pitch, and roll may not be accurate.

Similar threads

  • Mechanical Engineering
Replies
3
Views
363
  • Linear and Abstract Algebra
Replies
4
Views
3K
Replies
2
Views
4K
  • Linear and Abstract Algebra
Replies
6
Views
9K
  • Linear and Abstract Algebra
Replies
6
Views
2K
  • Nuclear Engineering
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
8
Views
620
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Replies
18
Views
930
Replies
4
Views
2K
Back
Top