Sign in to follow this  
No_Germs

Working with Yaw-Pitch-Roll

Recommended Posts

Just don't do it - work internally with quaternions or 3x3 matrices. If you need to present yaw/pitch/roll to the user, then convert (not difficult).

Share this post


Link to post
Share on other sites
ok, i think i got a little confused :) i don't want to use any angles, except when creating the rotation matrices...
so i need to use quaternions, not euler angles?

Share this post


Link to post
Share on other sites
What you want to to is calculating the composition of three matrices

M_yaw * (M_roll * M_pitch)

the order could be different. And it is how you define yaw, pitch and roll which all correspond to rotations about x,y,z correspondingly.

So how could this be done? I will do the first matrix (yaw) and you can figure out the rest. so lets create M_yaw.

We look at how the basis e_x = (1,0,0)^T, ..., e_z = (0,0,1)^T transforms which is very easy:

M_x * e_x = e_x
M_x * e_y = (cos v * e_y) + (sin v * e_z)
M_x * e_z = (-sin v *e_y) + (cos v * e_z)

(tip: draw a picture..)

But now we know the matrix M_x since M_x * e_x = first column, M_x * e_y = second column and M_x * e_z = third column (very nice way of calculating a matrix if you are not used to it, just find how the standard basis is transformed).

Your M_x is then:
M_x = [1 0 0 0; 0 cosv sinv; 0 -sinv cosv]

(rotation is counter clockwise, just transform v' = -v to get it clockwise)


Doing this also for roll and pitch and finally calculating the composition (given above) gives you the final rotation matirx.


The reason why everyone is talking about quaternions is that they have some advantages in 1) memory efficiency 2) no gimbal lock 3) nice and very fast for doing spherical interpolation.

Regards

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this