Calculating transformation matrix from Motive 1.5 CSV data

Post Reply
rfulton
Posts: 1
Joined: Tue Feb 25, 2014 6:01 pm

Calculating transformation matrix from Motive 1.5 CSV data

Post by rfulton »

Hi all,
We purchased a 3-camera Flex-13 system early this year with the intention of testing it with Motive 1.5 for rigid body motion tracking. We had a *lot* of trouble figuring out how to construct a valid 4x4 transformation matrix from the rigid body pose data in the output .csv file. Now that we have figured it out, I am posting this in the hope that it might be helpful to others.

We initially noticed that we could not reconcile the two forms of orientation information in the output csv file (quaternion and PYR). After some discussion with support they advised that the quaternion information is incorrect and that we should only rely on the PYR data for calculating orientation. (They said that they had fixed this problem internally, but that the latest version of Motive available to users (1.5) did not incorporate the fix).

So, we have been working with the PYR data. Naturalpoint define pitch, yaw and roll as rotations about the x, y and z axes, respectively. We have also been advised by Naturalpoint support that Motive uses a "right-handed coordinate system with axis order X (Pitch), Y (Yaw), Z (Roll). Relative Euler angles".

That means, if we adopt Naturalpoint's relative coordinate axes rather than fixed, and if we use Rx, Ry and Rz to represent rotations about the x, y and z axes, and p, y and r to be the values of pitch, yaw and roll reported in the csv file, respectively, that orientation should be calculated as

Rx(p) x Ry(y) x Rz (r) (1)

However, with these conventions, we could not obtain transformations from csv data that made any sense in relation to known motion in the physical world. We finally resolved this by tracking a rigid body simultaneously with two different tracking systems - a Polaris Spectra and the Optitrack system. Each has its own conventions regarding definitions of pitch and yaw, and each has its own coordinate system in which pose parameters are reported. The Polaris uses fixed coordinates. We first calibrated each system to a common third coordinate system using only x, y z data (which we did not doubt were correct) and then measured the 6 d.o.f. pose of the rigid body in two different positions with both tracking systems, and computed the corresponding 4x4 motion transformations from one pose to the other in common coordinates. We expected the transformation matrices to be the same for both tracking systems, but they were not.

However we found that we could make the transformations the same if we reversed the sign of the yaw angle reported in the Optitrack csv file, i.e. if we calculated orientation as

Rx(p) x Ry(-y) x Rz (r) (2)

Note the minus sign in the yaw angle.

This rang a bell as we had previously noticed that the sign of the yaw angle shown in Motive's rigid body real time display was the opposite of that recorded in the csv file. This seems to be a definite bug in the Motive 1.5 software. (Naturalpoint please note).

Summary:
It appears that in order to calculate poses correctly from csv data exported by Motive 1.5, one should compute orientation as the following matrix product, taking care to reverse the sign of the yaw angle, i.e.

Rx(p) x Ry(-y) x Rz (r),

where p, y and r are the pitch, yaw and roll angles reported in the csv file, respectively.

With this adjustment we are now able to use the system for real rigid body work (after several weeks of not knowing how to interpret the output data) and it seems to work fine. I am impressed. Compared to the Polaris it offers 2x higher sampling rate, a much larger field of measurement, and instant recognition of new rigid bodies. Disappointments are the lack of a proper user manual, and the failure to notify customers of known errors in the Motive software (I refer there to the erroneous quaternion data).

I am not sure if anyone else is having similar trouble with rigid bodies and Motive 1.5, or whether this solution will be useful for all situations, but maybe it will help someone out there.

rfulton.
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: Calculating transformation matrix from Motive 1.5 CSV da

Post by beckdo »

I think you'll see these issues addressed in Motive v1.6. I apologize for the long release cycle this time around. I'm going to work to get you an advanced build of Motive v.1.6 as it gets closer so you can be assured in advance of the release that these issues are addressed.
Cameron
Posts: 17
Joined: Tue Mar 03, 2009 7:11 am

Re: Calculating transformation matrix from Motive 1.5 CSV da

Post by Cameron »

Hi,

I am having similar issues, and I typically use the RPY data for tracking orientation. However, sign aside, I am seeing strange behavior even watching the real-time info display in Motive. When I rotate about the yaw axis only at one point it "flips" my pitch and roll to something around +-180 degrees. This was also described in another post: http://forums.naturalpoint.com/viewtopi ... 828#p57322.

But according to rfulton above, tech support is saying the quaternion data is not reliable either. So what is the best way to resolve this? Wait for v1.6? We have clients using our robots with OptiTrack systems around the world, I'd prefer not to have to tell them to uninstall Motive and install Tracking Tools 2.5 but I don't know if I have another choice.
afsp
Posts: 5
Joined: Fri May 23, 2014 1:53 am

Re: Calculating transformation matrix from Motive 1.5 CSV da

Post by afsp »

Hey,

I was wondering if you could be so kind to share your related Matlab script, as I have a similar issue and thereby won't have to fight with the same issues...

Thanks in advance,

Arthur
Post Reply