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 » Tue Jan 29, 2008 9:55 am

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 » Tue Jan 29, 2008 11:42 am

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 » Tue Jan 29, 2008 7:44 pm

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 » Wed Jan 30, 2008 11:10 am

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 » Wed Jan 30, 2008 11:40 pm

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: 192
Joined: Tue Jan 02, 2007 2:17 pm

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

Post by leith » Fri Feb 01, 2008 7:06 am

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 » Tue Mar 25, 2008 1:45 am

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