MAVLINKHUD

Overview

The MAG parameter group (specifically MAG_ALY) is a SITL-only tool used to simulate magnetic interference.

Note: For physical compass calibration and setup, please refer to the COMPASS group.

Key Concepts

1. Simulated Interference

In the Software-In-The-Loop (SITL) simulator, developers can inject a "Magnetic Anomaly" to see how the EKF and navigation algorithms handle incorrect heading data.

  • MAG_ALY: A 3D vector (X, Y, Z) in Gauss that is added to the simulated world's magnetic field.
  • Purpose: Testing the "Compass Variance" failsafe logic and "Compass-less" flight algorithms.

Developer Notes

  • Library: libraries/SITL.
  • Units: Gauss (Magnetic field strength).

MAG_ALY: Magnetic Anomaly Vector

Description

Sets a local magnetic anomaly vector (in Gauss) to be added to the earth's magnetic field in the simulator.

Values

  • Units: Gauss
  • Format: Vector3 (X, Y, Z)
  • Default: 0, 0, 0

Description

This parameter allows developers to simulate magnetic interference or local anomalies in the SITL environment.

  • X, Y, Z Components: Represents the anomaly vector added to the base earth magnetic field.
  • Use Case: Testing compass calibration routines, EKF mag fusion resilience, or simulating flight near large metal structures.
  • Note: The anomaly strength decays with height based on MAG_ALY_HGT.

Source Code

ardupilot/libraries/SITL/SITL.cpp