UAV Systems Engineering · Module 8
M8-T11: GNSS loss handling
GNSS loss is not an event but a process: detect it, change mode, bound the drift, and decide how long to carry on.
Every GNSS-denied UAV will lose GNSS, usually when it matters. A good response is decided before flight: what counts as lost, what the vehicle does in the first second, which operations remain allowed, and when it gives up and lands.
Learning objectives
After this lesson, you should be able to:
- Define GNSS loss and degradation using receiver quality indicators and estimator statistics.
- Design the mode transition and the allowed degraded operations.
- Derive a failsafe timeout from a drift rate and a clearance requirement.
- Test the response in simulation and in flight with a defined procedure.
Conceptual explanation
Implementation-specific The behaviours below are system-design choices, not universal rules. PX4 provides configurable failsafes (parameter names change between versions): read the PX4 safety documentation and map these requirements onto its configuration.
Treat GNSS availability as a graded quality, not a flag: satellite count, DOP, accuracy estimate, fix type, carrier-to-noise ratio, and the estimator’s innovation statistics all feed a judgement. The system should detect degradation (before the estimate is wrong, if possible), transition to a defined mode, operate within restrictions while uncertainty is bounded, and terminate safely when it is not.
| Phase | What happens | Design question |
|---|---|---|
| Detect | Quality metrics cross thresholds or innovations fail the gate | How long can detection take and still meet the position bound? |
| Transition | Mode manager switches to GNSS-denied mode | Is the transition smooth: no jump in the estimate or setpoints? |
| Operate | Odometry-aided flight with restrictions | What speed and clearance keep risk acceptable at the current ? |
| Terminate | Hold, return along the known path, or land when time or uncertainty limits are reached | What is the maximum safe duration and what is the safe end state? |

Engineering intuition
The estimate does not suddenly become wrong when GNSS stops; it becomes uncertain, and the uncertainty grows at a rate set by the quality of the remaining aiding. That growing uncertainty is the clock. A vehicle with good LiDAR-inertial odometry might drift at a fraction of a percent of distance and be good for minutes; a vehicle on bare inertial navigation has seconds. The rules of operation should be written in terms of uncertainty (σ, drift rate, time since last absolute fix) rather than in terms of “GNSS yes/no”, because that is what actually bounds the risk.
Mathematical formulation
If the remaining aiding gives a position drift rate ( per metre travelled) or a drift velocity-error growth, the position uncertainty after time at speed is roughly:
Given a clearance requirement (the smallest distance to an obstacle or a boundary that the plan relies on), a margin factor (for example 3 for ), the maximum permitted time in the degraded mode is:
Example: clearance 2 m, , , drift (1% of distance) at gives . If the mission needs 60 s to reach a safe landing area, either the speed must drop, the clearance requirement relax, or better aiding is needed. Slower flight increases time but not distance, so with drift proportional to distance the distance, not the time, is the budget: here 0.367/0.01 = 37 m.
Architecture and data flow
Receiver quality + estimator innovation (NIS) + odometry cross-check → GNSS trust flag with hysteresis → navigation manager → mode and speed/clearance limits to the planner → mission layer (hold, return, land). The planner must receive the uncertainty, not just the mode, so it can inflate obstacle margins. When GNSS returns, the estimator should blend the new fix gradually and the manager should require a period of consistent GNSS before restoring the nominal mode, to avoid chatter.
Real-world UAV applications
- Urban canyon flights that leave GNSS coverage for short stretches.
- Indoor-outdoor transitions in inspection missions.
- Defining PX4 failsafe configurations and offboard behaviour on loss of position.
- Writing the acceptance tests for the “GNSS loss” requirement in Capstone 4.
Implementation example
This runs as shown: it computes the maximum degraded-mode time from the clearance requirement and the drift rate, and implements a GNSS trust function with hysteresis so that brief fix recoveries do not restore the nominal mode.
def max_degraded_time(clearance_m, k, sigma0_m, drift_ratio, speed_ms):
"""Time until k*sigma exceeds the clearance, with sigma(t) = sigma0 + drift_ratio * speed * t (odometry-aided)."""
budget = clearance_m / k - sigma0_m
return max(0.0, budget / (drift_ratio * speed_ms))
t_max = max_degraded_time(2.0, 3.0, 0.3, 0.01, 2.0)
print(f"maximum time in GNSS-denied mode: {t_max:.1f} s at 2 m/s -> {t_max * 2.0:.0f} m of travel")
assert abs(t_max - 18.3) < 0.2
assert max_degraded_time(2.0, 3.0, 0.3, 0.01, 1.0) > 2 * t_max - 1 # half the speed doubles the time (same distance)
class GnssTrust:
"""Lose trust immediately on bad quality; regain it only after a continuous good period (hysteresis)."""
def __init__(self, regain_after_s=5.0):
self.trusted = True; self.good_since = None; self.regain_after_s = regain_after_s
def update(self, t, sats, hdop, nis_ok):
good = sats >= 8 and hdop < 2.0 and nis_ok
if not good:
self.trusted, self.good_since = False, None
elif not self.trusted:
self.good_since = t if self.good_since is None else self.good_since
if t - self.good_since >= self.regain_after_s: self.trusted = True
return self.trusted
g = GnssTrust()
assert g.update(0.0, 12, 0.9, True) is True
assert g.update(1.0, 4, 6.0, False) is False # lost
assert g.update(2.0, 12, 0.9, True) is False # brief recovery: still not trusted
assert g.update(4.0, 5, 3.0, True) is False # good again? no: resets the timer
assert g.update(5.0, 12, 0.9, True) is False and g.update(9.9, 12, 0.9, True) is False
assert g.update(10.1, 12, 0.9, True) is True # 5.1 s of continuous good quality: regain
print("trust logic ok")Common engineering mistakes
Switching modes on a single bad fix
Chatter between modes; use hysteresis and persistence, and distinguish outliers from loss.
Writing rules in terms of GNSS state instead of uncertainty
The risk is the position error bound, which depends on the remaining aiding.
Resetting the estimate to GNSS when it returns
A jump in position makes the controller and planner react violently; blend the correction.
Failsafe “return to home” with a drifted home
Home is an absolute position; after long denial the return path must use odometry-relative paths or known landmarks.
Never testing the transition
The first real GNSS loss should not be the first execution of the code.
Failure modes
| Failure mode | How it shows up | Likely cause |
|---|---|---|
| Jump on GNSS return | Sudden setpoint and attitude change when GNSS recovers | Hard reset to the GNSS position |
| Mode chatter | Rapid toggling between modes at the edge of coverage | No hysteresis |
| Unsafe return | Vehicle returns toward a wrong home after drift | Return computed from an absolute position that is no longer valid |
| Late failsafe | Clearance violated before the failsafe fires | Timeout not derived from drift and clearance |
Debugging approach
- Replay a log with GNSS data removed and check detection time, mode transitions and the estimate.
- Inject the loss in SITL (disable the GNSS sensor) and measure position error growth against the model .
- Check hysteresis by feeding alternating good and bad quality sequences.
- Test GNSS return with an offset in the estimate and verify the correction is blended.
Practical exercises
- Compute for clearance 1 m, , , drift 2%, speed 1.5 m/s.
- Add a receiver accuracy estimate to the trust logic and choose its threshold.
- Specify the allowed speed and clearance in AMBER mode as a function of .
- In the GNSS-Denied Failure Simulator, compare the time to failsafe with and without a LiDAR.
Interview questions
Write an answer in your own words, then reveal the model answer. Nothing is sent anywhere.
Question 1
How would you decide the failsafe timeout after GNSS loss?
Model answer
From the position uncertainty growth rate and the clearance requirement: choose such that equals the clearance, and verify drift in test. Use distance rather than time when drift scales with distance.
Question 2
Why use hysteresis when restoring GNSS trust?
Model answer
Marginal GNSS can toggle repeatedly; requiring a continuous good period before trusting it avoids mode chatter and sudden jumps.
Question 3
What should happen to the estimate when GNSS returns after a long outage?
Model answer
The correction should be applied smoothly (blended) after trust is regained, not as a step, to avoid abrupt setpoint and attitude changes.
References and further reading
Primary papers, official documentation and standards. Each claim above that is specific to a tool or version points here.
- PX4: Safety configuration (failsafes)
- PX4: EKF2 and GNSS fusion
- . . Groves, Principles of GNSS, Inertial, and Multisensor Integrated Navigation Systems, 2nd ed., Artech House, 2013 (integrity and integration).