The ignore_flags Bitmask
Why We Ignore Data
In MAVLink GPS injection, sometimes "No Data" is safer than "Bad Data." The ignore_flags field is a bitmask that tells the Flight Controller to disregard specific values in the packet.
Key Flags
| Bit | Decimal | Flag Name | Usage Scenario |
|---|---|---|---|
| 0 | 1 | LAT_LON |
Never used. Position is primary. |
| 1 | 2 | ALTITUDE |
Never used. Altitude is primary. |
| 3 | 8 | VEL_HORIZ |
Hovering. When the phone is stationary, Doppler velocity is noisy. We set this to force EKF to rely on position delta. |
| 4 | 16 | VEL_VERT |
Always Set. Phone Z-axis velocity is extremely noisy. We force ArduPilot to rely on the Barometer for climb rate. |
| 5 | 32 | SPEED_ACC |
Optional. |
| 6 | 64 | HORIZ_ACC |
Never used. Critical for EKF weighting. |
| 7 | 128 | VERT_ACC |
Used if vertical accuracy is unknown/estimated poorly. |
Strategy: The "Vel Vert" Lock
MAVLink GPS always sets bit 4 (Value 16).
- Reason: Phones are handheld. Small vertical movements (breathing, walking) creates noise in the vertical velocity estimate.
- Effect: The EKF ignores the
vd(Velocity Down) field entirely. It fuses thealt(Position) with theBarometer(Pressure) to estimate climb rate. This provides a much smoother altitude hold.
Strategy: The "Zero Clamp"
When the app detects the phone is stationary (e.g., set on a table or tripod):
- It stops sending velocity data.
- It sets
VEL_HORIZ(Bit 3, Value 8). - Result: The EKF knows not to trust a velocity of "0.00". It calculates velocity purely by observing the change in Latitude/Longitude over time, which is mathematically cleaner for stationary station-keeping.