Skip to the content
FixTheRobot Explore Robotics / UAV / Module 8 / M8-T11

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.

  • Lesson 11 of 18
  • Safety, Verification and Flight Testing
  • Implementation-specific
  • About 6 minutes to read

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.

GNSS loss timelineA timeline of a GNSS loss. Detection occurs after a delay, the mode manager switches to a GNSS-denied mode and restricts the mission, the position uncertainty grows, and a failsafe action triggers if confidence stays red for too long. GNSS lostdetectedGNSS-denied modefailsafe timer position uncertainty σ(t) grows detection delayallowed degraded operation: reduced speed, larger clearance, no new risk
The anatomy of a GNSS loss: detection delay, mode change, restricted operation and a failsafe timer.
Phases of GNSS loss handling
PhaseWhat happensDesign question
DetectQuality metrics cross thresholds or innovations fail the gateHow long can detection take and still meet the position bound?
TransitionMode manager switches to GNSS-denied modeIs the transition smooth: no jump in the estimate or setpoints?
OperateOdometry-aided flight with restrictionsWhat speed and clearance keep risk acceptable at the current σ\sigma ?
TerminateHold, return along the known path, or land when time or uncertainty limits are reachedWhat is the maximum safe duration and what is the safe end state?
Animation of dead reckoning after GNSS is lost. Thirty simulated flights start from zero position error at the moment of loss; each has its own accelerometer bias drawn at random plus velocity noise, so the position errors grow roughly with the square of time. The analytical three-sigma bound envelopes the runs. The time at which the bound reaches the allowed error of twenty metres is marked as the latest time at which a failsafe action, landing or return, must be started.
After GNSS loss the position error is dominated by the accelerometer bias bb: error ≈ ½ b t2b\,t^{2} plus a velocity random walk. A requirement on allowed error therefore becomes a time limit for the failsafe. Illustrative bias σ=0.03 m/s2\sigma =0.03\,\mathrm{m}/\mathrm{s}^{2} and velocity noise 0.02 m/s/√s; 30 seeded runs, 3σ3\sigma bound. (Looping, about 5 seconds; drawn and computed for this course with illustrative values.)

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 ρ\rho (mm per metre travelled) or a drift velocity-error growth, the position uncertainty after time tt at speed vv is roughly:

Odometry-aided
σ(t)≈σ0+ρ v t\sigma(t) \approx \sigma_0 + \rho\,v\,t
Error proportional to distance travelled.
Inertial only
σ(t)≈σ0+12 b t2\sigma(t) \approx \sigma_0 + \tfrac{1}{2}\,b\,t^{2}
Driven by the accelerometer bias (lesson M2-T8).

Given a clearance requirement cc (the smallest distance to an obstacle or a boundary that the plan relies on), a margin factor kk (for example 3 for 3σ3\sigma ), the maximum permitted time in the degraded mode is:

Failsafe timeout from a clearance requirement
σ(tmax⁡)=ck  ⟹  tmax⁡=c/k−σ0ρ v\sigma(t_{\max}) = \frac{c}{k} \;\Longrightarrow\; t_{\max} = \frac{c/k - \sigma_0}{\rho\,v}
For the odometry-aided case.

Example: clearance 2 m, k=3k=3, σ0=0.3 m\sigma _{0}=0.3\,\mathrm{m}, drift ρ=0.01\rho =0.01 (1% of distance) at v=2 m/sv=2\,\mathrm{m}/\mathrm{s} gives tmax⁡=(0.667−0.3)/(0.02)≈18 st_{\max}=(0.667-0.3)/(0.02)\approx 18\,\mathrm{s}. 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")
Failsafe timeout from a clearance requirement, and a GNSS trust function with hysteresis.

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 modes, symptoms and causes
Failure modeHow it shows upLikely cause
Jump on GNSS returnSudden setpoint and attitude change when GNSS recoversHard reset to the GNSS position
Mode chatterRapid toggling between modes at the edge of coverageNo hysteresis
Unsafe returnVehicle returns toward a wrong home after driftReturn computed from an absolute position that is no longer valid
Late failsafeClearance violated before the failsafe firesTimeout not derived from drift and clearance

Debugging approach

  1. Replay a log with GNSS data removed and check detection time, mode transitions and the estimate.
  2. Inject the loss in SITL (disable the GNSS sensor) and measure position error growth against the model σ(t)\sigma (t).
  3. Check hysteresis by feeding alternating good and bad quality sequences.
  4. Test GNSS return with an offset in the estimate and verify the correction is blended.

Practical exercises

  1. Compute tmax⁡t_{\max} for clearance 1 m, k=3k=3, σ0=0.2 m\sigma _{0}=0.2\,\mathrm{m}, drift 2%, speed 1.5 m/s.
  2. Add a receiver accuracy estimate to the trust logic and choose its threshold.
  3. Specify the allowed speed and clearance in AMBER mode as a function of σ\sigma .
  4. 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 tmax⁡t_{\max} such that k⋅σ(tmax⁡)k\cdot \sigma (t_{\max}) 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.

What’s next

Mark this lesson

Saved in this browser and synced to your account when you are signed in.

Practice this lesson

M8-L2: Simulate GNSS loss

Inject GNSS loss.

Next lesson

M8-T12: Visual odometry failure handling

Detect and handle visual odometry failure using feature statistics and consistency, and fall back to other sources.