How to get the head orientation form Yaw-Pitch-Roll

Post Reply
tiendat
Posts: 3
Joined: Tue Jan 29, 2008 9:51 am

How to get the head orientation form Yaw-Pitch-Roll

Post by tiendat »

Hi all,
I'm using Optitrack Pro 4 and I haven't been successful to get the correct head orientation and position from (X,Y,Z) and Yaw-Pitch-Roll information. Has anybody been successful with that?
Thank you,
Dat
VincentG
Posts: 7728
Joined: Mon Jul 17, 2006 5:00 am
Location: Corvallis, Oregon

Re: How to get the head orientation form Yaw-Pitch-Roll

Post by VincentG »

Are you refering to the OptiTrack, or TrackIR line of products?
tiendat
Posts: 3
Joined: Tue Jan 29, 2008 9:51 am

Re: How to get the head orientation form Yaw-Pitch-Roll

Post by tiendat »

Dear Vincent,
I'm using the TracIR 4.
Thank for your help.
VincentG
Posts: 7728
Joined: Mon Jul 17, 2006 5:00 am
Location: Corvallis, Oregon

Re: How to get the head orientation form Yaw-Pitch-Roll

Post by VincentG »

You have gone thru the manual, section 4.1.3, 4.1.4, and 4.1.5?

http://www.naturalpoint.com/optitrack/s ... .1.032.doc
tiendat
Posts: 3
Joined: Tue Jan 29, 2008 9:51 am

Re: How to get the head orientation form Yaw-Pitch-Roll

Post by tiendat »

Hi Vincent,
Section 4.1.3 talks about INPVector, from that I can have (X,Y,Z) and (Yaw, Pitch, Roll). Section 4.1.4 and 4.1.5 talk about INPVector2 and INPVector3. But what I need is not how to get these info. What I really need is how to create the rotation matrix from (Yaw, Pitch, Roll). I have tried the order Rz -> Ry -> Rx but it's not quite good. So I wonder how you guys come up with the rotation matrix because in the application coming with the driver, you can rotate the head very smoothly.
Thanks,
Dat
leith
Posts: 194
Joined: Tue Jan 02, 2007 2:17 pm

Re: How to get the head orientation form Yaw-Pitch-Roll

Post by leith »

random guess follows:

rotation order issues?
kinemagician
Posts: 2
Joined: Mon Mar 24, 2008 4:09 am
Location: Italy

Re: How to get the head orientation form Yaw-Pitch-Roll

Post by kinemagician »

To solve your problem I suggest you the following:
- Use the quaternions qx, qy qz, qw to compute the transform matrix

A=2*[qw^2+qx^2-0.5 qx*qy-qw*qz qx*qz+qw*qy;
qx*qy+qw*qz qw^2+qy^2-0.5 qy*qz-qw*qx;
qx*qz-qw*qy qy*qz+qw*qx qw^2+qz^2-0.5
];

The quaternion values are reported in the csv file generated by the RigidBody module.

From such a matrix you can compute the set of Euler angles you want.
There are six set of Euler angles. They depend on the rotation sequence you choose (XYZ, ZYX...)

I hope this helps.
Post Reply