Fix calculations of BMM150#2376
Conversation
The reported sensor output was completely wrong
Include it in API, to simplify usage and avoid errors
|
Hum, there is still something I don't get, as with the previous method, you were able to really have a great space repartition (see the pictures). If you don't apply a proper calibration like this, you'll mainly get improper numbers. Unfortunately, on other platforms and in the samples online, the calibration is most of the time not done properly. |
A calibration is only possible if you know what the values should be, as with this sensor, the expected reading when not in motion is not 0 (we can't switch off the earth's magnetic field). So to properly calibrate such a sensor, you need some kind of reference, E.g. a GNSS sensor and an attitude sensor. I've started to investigate into this topic, but that is a lot of math and I couldn't find the proper practical documentation on this yet. In either case, that's something that needs a separate PR. |
The calculated headings (both corrected and uncorrected) of the BMM150 Magnetometer where wrong due to an incorrect sign extension. The compensation functions also had sign errors.
Microsoft Reviewers: Open in CodeFlow