Documentation Index
Fetch the complete documentation index at: https://docs.altnautica.com/llms.txt
Use this file to discover all available pages before exploring further.
Fallback methods
Vision navigation is a real-time control loop reading noisy sensors. Things go wrong. The plugin’s design assumption is that every input will degrade or fail at some point and the system needs to handle it gracefully. This page documents the four fallback mechanisms that make degradation visible and recoverable.1. The scale ladder (rangefinder-free OF)
Theoptical_flow_degraded mode flies without a rangefinder. The
tracker still produces angular flow; the missing piece is the
altitude that turns that flow into metric velocity.
The plugin walks a four-rung ladder on every camera frame and picks
the highest-priority healthy rung:
| Rung | Source | Trigger | Quality multiplier |
|---|---|---|---|
| 1 | GLOBAL_POSITION_INT.relative_alt from the FC’s baro-EKF | message ≤ 2 s old, vehicle armed, value ≥ 0.3 m | 0.7 |
| 2 | VFR_HUD.alt minus the captured take-off altitude | message ≤ 2 s old | 0.6 |
| 3 | GPS_RAW_INT.alt minus take-off, gated on operator outdoor flag + 3D fix + HDOP ≤ 2 | message ≤ 2 s old | 0.4 |
| 4 | 1.5 m static fallback | always available | 0.2 |
degraded whenever
the static rung is active. The fallback banner appears after 5
seconds on the static rung.
Why not stop emitting altogether? The EKF prefers a low-quality
sample to no sample at all when it has nothing else to fuse. The
1.5 m static rung is the lowest possible quality emission; the EKF
de-weights it strongly. Operators in the field who genuinely lose
all altitude sources at once are typically at low altitude and
benefit from a degraded velocity hint over no velocity hint.
2. The time-sync drift bands
VIO estimators are sensitive to the time relationship between camera frames and IMU samples. The plugin runs a time aligner that pairs each frame with the closest IMU sample, applies the calibrated static offset, and tracks the residual drift over a rolling window.| Band | Average residual | Action |
|---|---|---|
| Green | ≤ 10 ms | Acceptable for VIO arm |
| Yellow | 10 to 30 ms | Degraded; warn but arm |
| Red | > 30 ms | Refuse to arm in VIO mode |
3. The heartbeat watchdog (VIO engines)
The VIO engines run as out-of-process vendor binaries. The plugin talks to them through a Unix-domain socket and a shared-memory ring; the binary reports back with pose messages and analive heartbeat
every second.
If the binary goes silent for more than 2 seconds, the watchdog
restarts it. The cooldown between restarts is 5 seconds so a bad
config does not spawn an unbounded restart storm.
What the operator sees: the estimator card flips to failed
during the restart window. The fallback banner appears with the
restart-in-progress message. After the restart, the binary goes
through init → converging → converged on its own; the GCS
shows the state climbing back.
When does the binary go silent? Usually one of:
- Out-of-memory (the OS killed it). The plugin’s
max_ram_mbresource limit is generous but not unbounded. - A crash in the vendor binary (rare but possible; the binaries are GPL-3.0 open source upstream of the plugin).
- A pathological input (the binary’s optimiser hung). The watchdog always recovers; the operator may want to switch modes temporarily.
4. The EKF source-set switcher
The final escape hatch. The Vision Nav tab in Mission Control has a button that flips the flight controller’s EKF source set between GPS (set 1), VIO (set 2), and OF (set 3) at runtime.- On ArduPilot: all three source-set switches work in flight. The EKF tolerates a one-time innovation spike on switch.
- On PX4: the switcher is disabled because PX4 does not support runtime source-set switching. The change requires a parameter write and an EKF restart; the GCS shows the tooltip explaining why.
How the four mechanisms combine
A real flight that goes wrong might exercise all four:- The camera fogs over (low light + condensation). Flow quality
drops below 50; the estimator marks itself
degraded. - The fallback banner fires. The operator sees the degraded state on the estimator card.
- The operator hits the EKF source switcher button to flip back to GPS. The EKF takes a one-time innovation spike, settles within a few seconds.
- The drone returns to LOITER under GPS. The plugin keeps emitting degraded OF samples (the EKF ignores them; that is fine), giving the operator the option to flip back when conditions improve.
Where to go next
- Modes for the per-mode pre-arm matrix.
- Troubleshooting for decision trees against each failure family.
- Calibration for re-running the camera-IMU calibration when the sync band turns red.