Skip to content

MAGFit: allow location to be entered and use AHRS origin params - #370

Open
j-w9 wants to merge 1 commit into
ArduPilot:mainfrom
j-w9:magfit-location
Open

j-w9 wants to merge 1 commit into
ArduPilot:mainfrom
j-w9:magfit-location

Conversation

@j-w9

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

Copy link
Copy Markdown
Contributor

Covers "Option to enter location manually" from #81, and the follow-up there about calibrating without GPS.

  • New Location box in Setup with latitude and longitude. It is filled from the log as before (ORGN, then last POS), and now also from AHRS_ORIGIN_LAT / AHRS_ORIGIN_LON when those are non-zero (4.7 can record the origin to these).
  • If none are found, loading no longer stops at "Could not get earth field". It asks for a location, and Calculate uses it.
  • calculate() reads the location from the inputs. If it changed, it recomputes the earth field and clears the selected source, so the body frame expected field is recalculated.

Checked against main on six logs with compass data:

  • Three with ORGN/POS: identical fit results.
  • Two 4.7 logs with no GPS but with AHRS_ORIGIN_* set: these fail on main, and now load.
  • One with no location at all: prompts, and fits after a location is entered.

Location input

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