I flashed my code with target of 0.6.2, there is no success…
I want to get correct yaw data. Is it same concept between “yaw” and “heading”?
When rotating sensor from 360 to 270, the heading(yaw) value changes from 360 to 180 degrees. It is nonsense…
I’ve tested this now, and I see what you might refer to, but I also consider these results as “by design”.
For the heading, you need to make sure that you have no interfering magnetic field around. My wireless mouse next to the IMU shield causes a divergence of 20+ degrees.
Calculating the real orientation of an object with a 9DOF IMU isn’t as trivial as it might seem to be. The sensor fusion logic in this demo works for a limited range of orientations, but not for all.
At some point the sensor fusion logic would have the choice of multiple results for one set of numbers.
If you look at the math you’ll see sqrt() which by definition will give you two results (+/-) and you have atan2() which also has some non-linear properties you might see that some sets of sensor values just won’t be able to give you a “nice” result.
You might also want to read about gimbal lock which plays a role in these edge case values that look (and probably) are worng, but are the best you can get from the physics used in these cheap sensors.
Thanks for your help, I also have Adafruit LSM9DS0.
This sensor gives me a correct heading(yaw) data. There are some divergences, but it is acceptable.
I don’t want ‘perfect’ value but correct data according to actual rotation of sensor.