[WIP] Magnetometer Calibration algorithm documentation #2338
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
As noted in PX4/PX4-Autopilot#19459, the calibration algorithm in PX4 is sophisticated & amazing, but it isn't well documented and reading the code to understand it is quite challenging (due to it's complexity), this adds a documentation for what Magnetometer calibration actually does.
This came up while discussing whether PX4 includes online soft iron calibration feature, which was hard to figure out by reading the codebase! And only 10+ minutes later, I realized offline soft iron calibration is implemented in this PR: PX4/PX4-Autopilot#15235
Relevant Twitter thread: https://twitter.com/YohanHadji/status/1566075481576931330
Relevant Discord message: https://discord.com/channels/1022170275984457759/1032412576727978084/1084491061935738930
Relevant doc (perhaps): https://www.infineon.com/dgdl/Infineon-AN2272_PSoC_1_Sensing_Magnetic_Compass_with_Tilt_Compensation-ApplicationNotes-v04_00-EN.pdf?fileId=8ac78c8c7cdc391c017d0731b0d05573
TODOs