Skip to content

magfit: add headless command-line interface#1696

Merged
tridge merged 1 commit into
ArduPilot:masterfrom
tridge:magfit-headless-cli
Jun 21, 2026
Merged

magfit: add headless command-line interface#1696
tridge merged 1 commit into
ArduPilot:masterfrom
tridge:magfit-headless-cli

Conversation

@tridge

@tridge tridge commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

The magfit panel was only reachable through the MAVExplorer wx GUI. Add a main() entry point so the same fit can be run headless and scripted:

python -m MAVProxy.modules.lib.magfit LOG.bin --mag MAG[2]
--orientation ROTATION_YAW_180 --save-plot out.png

It builds the same args the GUI passes, runs the existing fit, prints the suggested COMPASS_* parameters and saves the result plot to a file. magfit() gains an optional save_plot argument so it writes the figure instead of calling pyplot.show() when there is no display; the GUI path is unchanged.

The magfit panel was only reachable through the MAVExplorer wx GUI. Add a
main() entry point so the same fit can be run headless and scripted:

  python -m MAVProxy.modules.lib.magfit LOG.bin --mag MAG[2] \
      --orientation ROTATION_YAW_180 --save-plot out.png

It builds the same args the GUI passes, runs the existing fit, prints the
suggested COMPASS_* parameters and saves the result plot to a file. magfit()
gains an optional save_plot argument so it writes the figure instead of
calling pyplot.show() when there is no display; the GUI path is unchanged.
@tridge tridge merged commit e8fbde5 into ArduPilot:master Jun 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant