Page 1 of 1
How to get the head orientation form Yaw-Pitch-Roll
Posted: Tue Jan 29, 2008 9:55 am
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
Re: How to get the head orientation form Yaw-Pitch-Roll
Posted: Tue Jan 29, 2008 11:42 am
by VincentG
Are you refering to the OptiTrack, or TrackIR line of products?
Re: How to get the head orientation form Yaw-Pitch-Roll
Posted: Tue Jan 29, 2008 7:44 pm
by tiendat
Dear Vincent,
I'm using the TracIR 4.
Thank for your help.
Re: How to get the head orientation form Yaw-Pitch-Roll
Posted: Wed Jan 30, 2008 11:10 am
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
Re: How to get the head orientation form Yaw-Pitch-Roll
Posted: Wed Jan 30, 2008 11:40 pm
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
Re: How to get the head orientation form Yaw-Pitch-Roll
Posted: Fri Feb 01, 2008 7:06 am
by leith
random guess follows:
rotation order issues?
Re: How to get the head orientation form Yaw-Pitch-Roll
Posted: Tue Mar 25, 2008 1:45 am
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.