Docs: baro-auto-calibration and gnss-fault-detection (#25796)

This commit is contained in:
Marco Hauswirth
2025-11-26 11:52:40 +11:00
committed by GitHub
parent a8c5df90ce
commit d9a66b11ac
3 changed files with 98 additions and 10 deletions
@@ -348,6 +348,60 @@ The `hpos_drift_rate`, `vpos_drift_rate` and `hspd` are calculated over a period
Note that `ekf2_gps_drift` is not logged!
:::
#### GNSS Fault Detection
PX4's GNSS fault detection protects against malicious or erroneous GNSS signals using selective fusion control based on measurement validation.
The fault detection logic depends on the GPS mode, and also operates differently for horizontal position and altitude measurements.
The mode is set using the [EKF2_GPS_MODE](../advanced_config/parameter_reference.md#EKF2_GPS_MODE) parameter:
- **Automatic (`0`)** (Default): Assumes that GNSS is generally reliable and is likely to be recovered.
EKF2 resets on fusion timeouts if no other source of position is available.
- **Dead-reckoning (`1`)**: Assumes that GNSS might be lost indefinitely, so resets should be avoided while we have other estimates of position data.
EKF2 may reset if no other sources of position or velocity are available.
If GNSS altitude OR horizontal position data drifts, the system disables fusion of both measurements simultaneously (even if one would still pass validation) and avoids performing resets.
##### Detection Logic
Horizontal Position:
- **Automatic mode**: Horizontal position resets to GNSS data if no other horizontal position source is currently being fused (e.g., Auxiliary Global Position - AGP).
- **Dead-reckoning mode**: Horizontal position resets to GNSS data only if no other horizontal position OR velocity source is currently being fused (e.g., AGP, airspeed, optical flow).
Altitude:
- The altitude logic is more complex due to the height reference sensor ([EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF)) parameter, which is typically set to GNSS or baro in GNSS-denied scenarios.
- If height reference is set to baro, GNSS-based height resets are prevented (except when baro fusion fails completely and height reference automatically switches to GNSS).
- When height reference is set to GNSS:
- **Automatic mode**: Resets occur on drifting GNSS altitude measurements.
- **Dead-reckoning mode**: When validation starts failing, the system prevents GNSS altitude resets and labels the GNSS data as faulty.
##### Faulty GNSS Data During Boot
The system cannot automatically detect faulty GNSS data during vehicle boot as no baseline comparison exists.
If GNSS fusion is enabled ([EKF2_GPS_CTRL](../advanced_config/parameter_reference.md#EKF2_GPS_CTRL)), operators will observe incorrect positions on maps and should disable GNSS fusion, then manually set the correct position via ground control station.
The global position gets corrected, and if [SENS_BAR_AUTOCAL](../advanced_config/parameter_reference.md#SENS_BAR_AUTOCAL) was enabled, baro offsets are automatically adjusted (through bias correction, not parameter changes).
##### Enabling GNSS Fusion Mid-Flight
With Faulty GNSS Data:
- **Automatic mode**: Vehicle will reset to faulty position - potentially dangerous.
- **Dead-reckoning mode**: Large measurement differences cause GNSS rejection and fault detection activation.
With Valid GNSS Data:
- **Automatic mode**: Vehicle will reset to GNSS measurements.
- **Dead-reckoning mode**: If estimated position/altitude is close enough to measurements, fusion resumes; if too far apart, data gets labeled as faulty.
##### Notes
- **Dual Detection**: Horizontal and altitude checks run completely separately but both lead to the same result when triggered - all GNSS fusion gets disabled.
- **Recovery**: Only the specific check that labeled data as invalid can re-enable fusion.
- **Alternative Sources**: Dead-reckoning mode provides enhanced protection by requiring absence of alternative navigation sources before allowing resets.
- **Boot Vulnerability**: Initial faulty GNSS data cannot be detected automatically; requires operator intervention and manual position correction.
### Range Finder
[Range finder](../sensor/rangefinders.md) distance to ground is used by a single state filter to estimate the vertical position of the terrain relative to the height datum.