Skip to content

Magfit updates#475

Merged
Williangalvani merged 10 commits into
ArduPilot:masterfrom
Williangalvani:magfit_updates
Jun 29, 2026
Merged

Magfit updates#475
Williangalvani merged 10 commits into
ArduPilot:masterfrom
Williangalvani:magfit_updates

Conversation

@Williangalvani

Copy link
Copy Markdown
Collaborator

No description provided.

Williangalvani and others added 10 commits June 29, 2026 15:30
The reactivity trigger passed the array itself as the index and null as
the value (this.$set(this.newCorrections, this.newCorrections, null)),
which created a bogus property keyed by the stringified array and never
made the actual index assignment reactive. This is the source of the
"weird data" that downloadParams() had to filter out. Set the correct
index/value instead so the New table and post-calibration fitness update
reactively.

Co-authored-by: Cursor <cursoragent@cursor.com>
Matrix3.invert() returns null for a singular matrix instead of throwing,
so the try/catch never caught it and correctionMatrix.times() would later
crash on null. Check the return value explicitly and bail out instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
The generated MAGFIT message type used the misspelled key "multipiers",
so it never matched the "multipliers" field used elsewhere by the parser
and plotting code.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add a "Consistency" section to the Mag Fit tool that plots the absolute
heading difference between two selectable compasses, both from the raw
log and after fitting, e.g.
abs(angle_diff(mag_heading_df(MAG[0], ATT), mag_heading_df(MAG[1], ATT))).

Also fixes compassMessageNames, which was an empty computed: message
types are added to state.messages non-reactively as they stream in, so
the names are now derived in computeData() from a single shared candidate
list (kept in sync with compassData and extended to cover MAG/MAG2/MAG3
older-log keys). Adds an abs() helper to mavextra for use in expressions.

Co-authored-by: Cursor <cursoragent@cursor.com>
When the log has no GPS position, add a "Get from IP" button that fetches
approximate coordinates from a geo-IP service (ipapi.co, falling back to
ipwho.is) to populate the lat/lon used for the earth field estimate.

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the fixed pixel width/height and size the pane to its content
(width: max-content, height/overflow auto) so it no longer shows
scrollbars. Disable resizing via the baseWidget resizeable prop and
remove the now-unused resize handle. Also compact the tables/buttons
(single line, matching font size) so the auto-sized box stays tight.

Co-authored-by: Cursor <cursoragent@cursor.com>
The optimizer is async, so clicking a second Fit button mid-run made two
fits interleave through shared state (optimizingData/oldCorrections) and
produce garbage. Guard against re-entry while processing, disable the Fit
buttons during a run, pass the fit data through a closure instead of
instance state, and reset processing in a finally so a thrown optimizer
no longer locks the UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
Restyle the Mag Fit tool: a proper header with a hover close button,
card-style sections with underlined titles, consistent solid buttons with
hover/disabled states, bordered inputs/selects, and right-aligned result
tables. Colour-code the post-fit fitness green/red depending on whether
the fit improved the error, and show a per-compass spinner on the Fit
button (and a "Fitting..." footer) while optimizing.

Co-authored-by: Cursor <cursoragent@cursor.com>
Disable the Fit buttons (and guard fitWmm) until the log has GPS or the
user has entered valid lat/lon, since a fit needs a location to compute
the expected earth field. Show a hint and tooltip explaining what's
needed.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add an onProgress callback to the genetic optimizer and plot the best
error per generation as a small inline SVG chart that animates while a
fit runs and hides once it finishes. Also drop the per-evaluation
console.log in wmmError that spammed the console.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Williangalvani
Williangalvani merged commit d67d88c into ArduPilot:master Jun 29, 2026
2 checks passed
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