CameraSDK-TrackIR5, rotation order, axis, unit

Post Reply
hwang
Posts: 6
Joined: Thu Jan 02, 2014 1:20 pm

CameraSDK-TrackIR5, rotation order, axis, unit

Post by hwang »

Hello, everyone!

I'm working on a TrackIR5 camera with TrackClip tool, using CameraSDK version 1.5.

I did a search in the forum, but didn't find the answer.
Could anybody please tell me the following information?
Or please kindly give a referring link?

Code: Select all

CameraLibrary::cModuleVectorProcessing::GetOrientation(double &Yaw, double &Pitch, double &Roll);
1. What's the unit returned? Is it "degree" or "radian"

2. Are the returned angles Tait–Bryan angles or Euler Angles?
Is "Yaw" around the Y-axis, "Pitch" around Z-axis and "Roll" around X-axis?

3. What's the rotation order of those angles?
Are they intrinsic rotations or extrinsic rotations?

Thanks in advance!
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: CameraSDK-TrackIR5, rotation order, axis, unit

Post by beckdo »

Hi hwang. Here are some answers:

1) Degrees

2) yaw, pitch, and roll values are created from a 3x3 orientation matrix and then converted to degrees. The conversion uses an implementation described in detail here:

http://www.euclideanspace.com/maths/geo ... rixToEuler

3) I believe the Euler conventions are: left-handed, axis order ZYX, X=roll, Y= yaw, Z=pitch.

You clearly have a good understanding of Euler angles and their potential pitfalls. For you I would recommend you grab the Position and the first two markers. Then calculate your own orientation from two vectors: Position->Marker1 and Position->Marker2.
hwang
Posts: 6
Joined: Thu Jan 02, 2014 1:20 pm

Re: CameraSDK-TrackIR5, rotation order, axis, unit

Post by hwang »

beckdo wrote: 2) yaw, pitch, and roll values are created from a 3x3 orientation matrix and then converted to degrees. The conversion uses an implementation described in detail here:

http://www.euclideanspace.com/maths/geo ... rixToEuler

3) I believe the Euler conventions are: left-handed, axis order ZYX, X=roll, Y= yaw, Z=pitch.
Hello!
First of all, thanks for your reply!

Based on what I learned from the link, I think the website use following rules to convert a rotation matrix to Euler angles:

1. Right-handed Cartesian Coordinate;
2. Right hand rule for positive angle;
3. Euler Angle order: Heading(yaw) applied first, Attitude(pitch) applied second and Bank(roll) applied last;
4. Intrinsic rotations

The above information is obtained from this page:
http://www.euclideanspace.com/maths/standards/index.htm

This is somehow inconsistent with what you gave in 3).

Could you please confirm?
Thanks!


BTW, actually in our project, we don't need Euler Angles at all.
Rotation Matrix or Quaternion perfectly fit our needs.
Is there anyway we could retrieve matrix/quaternion from CameraSDK directly?
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: CameraSDK-TrackIR5, rotation order, axis, unit

Post by beckdo »

That is correct. There are differences in our Euler assumptions that impact the result.

It's good that you are not relying on Euler angles for your project as you are already clearly aware of the pitfalls associated with them.

I would recommend creating two vectors and generate your own orientation matrix or quaternion output.

To do that, take the cModuleVectorProcessing's position and marker results. Specifically you need three points to create an orienation. I would recommend using Position, Marker1, and Marker2.

From these three points, create two vectors:

vector1 = Position --> Marker1
vector2 = Position --> Marker2

From these you can create a quaternion. I would suggest googling something like 'creating a quaternion from two vectors'.

If you want to create a 3x3 orientation matrix, I believe you'd want 3 orthogonal vectors. You can create a third vector by taking the cross of vector1 & vector2:

vector3 = vector1 x vector2;

Finally, create another vector from the cross of vector1 and vector3:

vector4 = vector1 x vector3;

Now you have 3 orthogonal vectors: vector1, vector3, and vector4. From this you can create a 3x3 matrix.
Post Reply