To put this question into context, when my plane is pointed North, I want the indicated 'true' heading to be 0.0, and not +8.3 deg, which it is in my case. I'm orienting the plane along a surveyed north/south axis. From that I can back out/confirm my local variation (13 deg 22 minutes), and estimate the airframe's deviation in all four cardinal directions, with the motor running and the airframe fixed in place.
If a compass is present, it's the primary heading reference. In the default settings, the magnetic signal is corrected for local variation via lookup from the GPS; otherwise the system uses whatever is stored in the variation parameter.
Question - how are people correcting for their airframe's deviation, e.g. due to permanent magnets within the airframe?
The crude non-solution is to set the bitfield (EKF2_DEC_TYPE) governing variation correction to 0, and then provide a fake "variation" parameter value (in EKF2_MAG_DECL) which is actually the sum of the local variation and airframe's deviation. That will not work, since the deviation is a function of the heading, so at least, there would need to be 4 deviation parameters, one for each cardinal point. But there must be a better way? Since the GPS provides a true heading, presumably the px4 firmware could (or is already?) constantly estimating and updating the regional variation and the airframe's deviation? If so, does anyone know where the estimated deviation vector is stored? Thanks!