Skip to content

MAGFit: option to use earth field along the flight track - #374

Open
j-w9 wants to merge 2 commits into
ArduPilot:mainfrom
j-w9:magfit-position-track
Open

j-w9 wants to merge 2 commits into
ArduPilot:mainfrom
j-w9:magfit-position-track

Conversation

@j-w9

@j-w9 j-w9 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

"Use position throughout flight rather than just using a single origin" from #81. Built on #373 (its commit is included), so that should go first.

When the log has POS, the earth field is evaluated along the track (at most one point per second, skipping 0,0 before a fix) and interpolated to each attitude/compass sample time for the body frame expected field. A "Use position along flight" checkbox in the Location box controls this. It is ticked by default when there is a track and disabled when there is none. The single Location is still used for intensity and declination in the plots, and when the box is unticked.

With the WMM the field changes by roughly 1 mGauss per 10 km and 7 to 10 mGauss per 100 km (1.4 to 1.7%) at the locations I checked, so this mainly matters for long range flights. On two short logs, fitted offsets move by about 0.005 mGauss. With the box unticked, results are identical to #373, and the interpolated field matches direct evaluation at the track points.

Location box

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant