# Issues with data recorded from MetamotionC

Hello,

I recorded data with my MetaMotionC in quaternions and I am trying to convert them back in Euler angles with Matlab. But, I have a problem with that : The values for some “roll” data values are given in complex numbers and not in a real angle value.

I checked the quaternions data file and tried to make the sum of the power every terms (w, x, y, and z). Normally I should have “1”. But, for some values I have more or less than 1 (It can from 1.19 to 0.82).

I think this is the reason why I have complex numbers in my Euler angles. Do you confirm ?

I tried it with two MetaMotionC and for both of them I have this problem.

Could you help me about that ? Thanks in advance !

Kind regards,

Alex

This discussion has been closed.

## Comments

Here is a file showing my problem. In the last column, the values in red seems to be too high or low for me.

I'm not sure why you are getting complex numbers. The typical quaterion to Euler angle conversion is just simple arithmetic ending with either an arcsin or arctan.

The sensor fusion algorithm already provides Euler Angles; try using those values instead.

Yeah, the red values are quite far from the expect square sum of 1.0. We are working on providing better calibration tools so hopefully that will address these odd quaternion values.

Hi Eric,

Thank you for your response.

Finally, I think that the two problems are not linked : data with complex values angles are sometimes really close to 1. And other data lines are far from 1 and with real angles values. I have 107 complex numbers angles for about 96000 data lines. They are complex numbers because when I make the arcsin(), the term inside is out of [-1 ; 1]. But, I think I will just ignore them as they are not so many.

I also saw that sometimes for about 70 other data lines the sign of the value is opposite as it should to be. For example, I have something like: 145.23 then -143.65 then 142.64. They are usually alone or grouped by maximum 2 data lines. I replaced the sign manually.

And last question, just to be sure, I see that the sensor uses a left hand coordinate system. But, are the rotation directions also left hand ? On the data sheet the rotations directions showed are a little confusing to visualize for me.

Thanks four help !

Alex

The BMI160 imu uses a right-handed coordinate system.