-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Magnetometer Calibration algorithm documentation #2338
base: main
Are you sure you want to change the base?
Conversation
Btw @bresch it seems like this paper implements online 'soft iron' calibration. Any reason why this wasn't implemented, but only the 'hard iron' calibration was adapted in PX4/PX4-Autopilot#18327? |
4. `rotation[3 x 3]`: Final rotation matrix to transform magnetometer data from sensor frame to body frame, set via setting the rotation enum as in [Flight Controller Orientation](../config/flight_controller_orientation.md). | ||
|
||
|
||
## Orthogonal offset calibration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First letter capitalization everywhere.
I've moved to draft. MOve it back when you are ready for review. This is a good topic but as with any content, have a little think about who it is for, and what they will use it for. Then you ask yourself, did this doc help those people - a bit like test driven programming. If it is developers then they probably would benefit from links to the code which implement the interesting bits. You should also provide cross links from the calibration pages because otherwise this will probably not be very discoverable. Arguably the people who are most interested in this will already know, but I like to define what is meant by each term - so what is hard/soft iron. How does the calibration differ. What are the impacts of getting it wrong. Etc. |
16aba62
to
02a858c
Compare
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there: https://discuss.px4.io/t/some-notes-on-everything-that-was-a-pain-in-using-px4/33573/1 |
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