I want to calibrate my compass, which is installed on a board which inherits a GPS module. Because the GPS antenna is up-side-down the compass is 180° inverted. The easiest way to correct the problem would be to invert the rotation matrix 180°.
However I got interested how a general approach to calibrate a compass would look like. I found some approaches like this. They seem to collect magnetometer readings an project them on a sphere. But what is actually the point in this?
Does someone know how a general calibration algorithm of a 3D magnetometer looks like?