Module 2/10 · Weeks 3 · 14 h

Sensor fusion and consistency checking

UAT 461 Autonomous Navigation and Multi-UAV Systems

About 95 minDraft, awaiting reviewLast updated 1 October 2026

Lesson

By the end of this module you will be able to

  1. Compare loosely and tightly coupled fusion and compute how the number and spread of satellites affect position uncertainty
  2. Build a 2D EKF for a ground vehicle that fuses wheel odometry, a gyro and GNSS, letting the GNSS variance follow the fix type
  3. Check filter consistency with NEES when truth is available and NIS when it is not, using chi-square bounds
  4. Design a navigation-mode supervisor that turns the filter's sigma into a speed limit

Prerequisites: Module 1 Autonomous navigation architecture and localization · UAT 305 Autopilot and Control Technology (Kalman filter and EKF)

Why this matters

Module 1 ended with the conclusion that under the canopy no single position source is good enough. GNSS drops out in stretches, the wheels carry the position only about 33 m before it is half a metre off, and vision and LiDAR need texture or structure in the scene. The places where each source is poor do not coincide, so together they can beat any one of them, if they are combined the right way. This module teaches three things that make it “the right way”: the level at which to combine (the receiver’s solution or raw satellite ranges), giving each source the uncertainty its real condition deserves, and checking that the filter is honest with itself. The honest uncertainty is then used to decide how fast to drive.

It builds on the Kalman filter in UAT 305 and on the example in UAT 458 module 8 that goes into IMU bias. Here the emphasis is outdoor use with GNSS whose quality changes in time. The fictional case is still the durian orchard from module 1. All figures are assumed.

Fusing at the solution level or at the range level

A GNSS receiver computes position from ranges to several satellites (pseudoranges). A filter can take the data at two levels (Groves, 2013).

  • Loosely coupled takes the “position and velocity” the receiver has already computed. It is simple and works with an off-the-shelf receiver, but the receiver needs at least four satellites to output a position (three for a 3D position plus one for the receiver clock). With fewer, the filter gets nothing.
  • Tightly coupled takes the raw range of each satellite as one measurement and keeps the receiver clock error as a filter state. Even two or three satellites still bound the uncertainty in the directions those satellites look along. The price is access to raw receiver data and a more complex model.

Under the orchard canopy two effects must be told apart. Leaves block low satellites, so mostly high ones, or ones in the gaps of the canopy, remain. If the rows run north-south, the visible sky is a narrow strip along the row. Satellite geometry is therefore good along the row but poor across it, which is exactly the direction that matters most, since cross-row error is what makes the wheels run over a hose or hit a tree. The review by Popovici et al. (2026) also notes that vegetation degrades satellite geometry.

The effect of geometry is measured by HDOP. If each row of is the unit vector from the receiver to a satellite (east, north, up) plus a column of 1 for the clock, then . The standard deviation of position on each axis is when the range errors are independent and equal, and (the definition follows the knowledge unit on GNSS and limited navigation in the drone knowledge base). A low HDOP only says the geometry is good; it does not say there is no multipath.

A tightly coupled filter can fuse satellite ranges directly with the earlier belief from the INS. If the prior has covariance and each range has error , the covariance after fusing is .

Example 1 Satellite geometry along a row, and loose versus tight coupling

The assumed sky has 12 satellites that should be visible. Along a north-south row, the satellites that can be seen are those higher than 70° or those within 30° of the row axis and at least 15° up. The range error for one satellite under the canopy is 1.5 m. The prior from the INS is off by 3 m horizontally, 1 m vertically (helped by the barometer) and 10 m for the clock (all assumed). Compute HDOP for each case, and the uncertainty after fusing only some of the satellites.

import numpy as np
# Example 1: satellite geometry in the open and along a row, and loose versus tight coupling (assumed sky and errors)
def geometry(sats):                                  # rows: unit line of sight to the satellite (E, N, U) and a clock column
    az, el = np.radians(np.array(sats, float)).T
    return np.c_[np.cos(el) * np.sin(az), np.cos(el) * np.cos(az), np.sin(el), np.ones(len(az))]

sky = [(10, 72), (50, 38), (95, 22), (140, 55), (185, 28), (230, 62), (275, 33), (320, 47), (355, 18), (170, 80), (25, 40), (160, 45)]  # (azimuth, elevation) deg
def in_row(az, el):                                  # row runs north-south: canopy hides low satellites to the east and west
    off_axis = min(abs((az - 0 + 180) % 360 - 180), abs((az - 180 + 180) % 360 - 180))
    return el >= 70 or (off_axis <= 30 and el >= 15)
row = [s for s in sky if in_row(*s)]
SIG_R = 1.5                                          # range error of one satellite under the canopy (m)

def hdop(sats):
    Q = np.linalg.inv(geometry(sats).T @ geometry(sats))
    return np.sqrt(Q[0, 0] + Q[1, 1]), np.sqrt(Q[0, 0]), np.sqrt(Q[1, 1])
for name, s in (("open sky", sky), ("along the row", row)):
    h, qe, qn = hdop(s)
    print(f"{name:14s} {len(s):2d} satellites  HDOP {h:.2f}  east {SIG_R * qe:.2f} m  north {SIG_R * qn:.2f} m (1 sigma)")

P0 = np.diag([3.0 ** 2, 3.0 ** 2, 1.0 ** 2, 10.0 ** 2])   # prior from the INS: east, north, up (barometer-aided), receiver clock (m^2)
print("satellites  tight east/north (m)   loose east/north (m)")
for k in range(2, len(row) + 1):
    G = geometry(row[:k])
    P = np.linalg.inv(np.linalg.inv(P0) + G.T @ G / SIG_R ** 2)       # tightly coupled: every range is one measurement
    tight = np.sqrt(np.diag(P))[:2]
    if k >= 4:                                                        # loosely coupled: the receiver needs 4 to output a position
        Qr = np.linalg.inv(G.T @ G) * SIG_R ** 2
        Pl = np.linalg.inv(np.linalg.inv(P0[:2, :2]) + np.linalg.inv(Qr[:2, :2]))
        loose = np.sqrt(np.diag(Pl))
        ltxt = f"{loose[0]:.2f} / {loose[1]:.2f}"
    else:
        ltxt = "no fix, stays 3.00 / 3.00"
    print(f"{k:6d}      {tight[0]:.2f} / {tight[1]:.2f}              {ltxt}")
open sky       12 satellites  HDOP 0.84  east 0.96 m  north 0.82 m (1 sigma)
along the row   6 satellites  HDOP 2.90  east 4.24 m  north 0.94 m (1 sigma)
satellites  tight east/north (m)   loose east/north (m)
     2      2.99 / 1.58              no fix, stays 3.00 / 3.00
     3      2.94 / 1.07              no fix, stays 3.00 / 3.00
     4      2.92 / 1.05              3.00 / 1.07
     5      2.56 / 1.00              2.61 / 1.02
     6      2.41 / 0.87              2.45 / 0.89

The open sky gives an HDOP of 0.84 with the two axes close together (0.96 and 0.82 m). Along the row only 6 satellites remain and HDOP is 2.90, with the error splitting in two: only 0.94 m along the row (north) but 4.24 m across it (east), worse than the INS prior (3 m). Fused with the prior, a tightly coupled filter cuts the northward uncertainty from 3.00 to 1.58 m with only two satellites, while a loosely coupled filter gains nothing until four are visible. Across the row, however, neither method improves much (from 2.99 m with two satellites to 2.41 m with six). The conclusion is that GNSS under the canopy helps along the row, while the cross-row error that endangers hoses and trees needs another source, such as a LiDAR measuring the distance to the trunks on both sides.

Two sky plots. The left circle, open sky, has 12 green satellites spread in all directions, HDOP 0.84, east error 0.96 metres and north error 0.82 metres. The right circle, along a north-south row, keeps 6 green satellites near the north-south line or near the centre, while the blocked ones are grey. HDOP is 2.90, east error 4.24 metres and north error 0.94 metres
Figure 1 Sky visible in the open and along a row of trees, with HDOP

Besides GNSS, the filter also takes relative data such as visual or LiDAR odometry, which says how the vehicle moved between two times, not where it is in the world. Such data can be fused in two ways. One treats it as a velocity measurement (velocity in the vehicle frame). The other uses it as a factor between two positions, as in the smoother of module 1. A caution from the PX4 documentation: EKF2 can enable fusion of position, velocity and heading from a vision system separately through the parameter EKF2_EV_CTRL and compensates the vision system’s delay with EKF2_EV_DELAY, but the documentation warns that mixing vision position with GPS is unreliable (PX4 Autopilot, n.d.-b). When two sources give conflicting absolute positions, the filter must choose which to believe. Fusing vision velocity with GNSS position avoids this because the data are of different kinds.

A 2D EKF for the vehicle

The orchard’s four-wheeled robot has three sensor sets: wheel odometry gives forward speed , the gyro gives turn rate , and GNSS gives horizontal position. The filter state is , where is the odometry scale (true distance = distance the wheels measured ÷ ), so the filter can learn the scale error itself while RTK is good and keep using it when GNSS vanishes. The prediction step is

The correction step uses the GNSS position with variance . The key point of this module is to choose from the fix type the receiver reports each time (fixed 0.02 m, float 0.30 m, single 2.5 m, no fix means no correction), not as a constant. A constant that is too small makes the filter chase single fixes that are off by metres; one that is too large throws away the accuracy of RTK.

GNSS data are always later than IMU data because of the receiver’s computation and the data transfer. An autopilot therefore compensates each sensor’s delay through parameters, and the effect of uncompensated delay is already quantified in UAT 458 module 2. This example leaves delay out to focus on variance.

Example 2 Three ways to set GNSS R in 30 Monte Carlo runs

The vehicle drives at 1.5 m/s for 60 s (about 90 m), weaving slightly between trunks. Seconds 12 to 48 are under the canopy, where the fix mix is that of Z3 in module 1 (fixed 12%, float 38%, single 35%, none 15%); outside that period it is that of Z1. Odometry has a 1.5% scale error and the gyro has a residual bias of 0.0003 rad/s. The true GNSS error matches the sigma of each fix type. The three filters differ only in R: A uses 0.02 m always, B uses the fix-type value, C uses the fix-type value divided by two. They are evaluated by true position error and by the horizontal NEES (two degrees of freedom) averaged over the 30 runs at each time against the two-sided 95% bounds (all assumed).

import numpy as np
from scipy.stats import chi2
# Example 2: 2D EKF for the ground robot (wheel odometry + gyro + GNSS); R follows the fix type; 30 Monte Carlo runs (assumed values)
DT, T, RUNS = 0.1, 60.0, 30
STEPS = int(T / DT)
V, SCALE = 1.5, 1.015                                  # true speed (m/s) and wheel-odometry scale error
SIG = {6: 0.02, 5: 0.30, 3: 2.5}                       # true horizontal 1-sigma per fix type (m); code 1 = no fix
P_OPEN, P_CANOPY = [0.97, 0.03, 0.0, 0.0], [0.12, 0.38, 0.35, 0.15]
CODES = [6, 5, 3, 1]

def simulate(seed):
    rng = np.random.default_rng(seed)
    truth = np.zeros((STEPS + 1, 3))                  # x, y, heading
    odo = np.zeros(STEPS); gyro = np.zeros(STEPS)
    fixes, state = [], 0
    for k in range(STEPS):
        t = k * DT
        w = 0.05 * np.sin(2 * np.pi * t / 20.0)       # gentle weaving between trunks
        x, y, th = truth[k]
        truth[k + 1] = [x + V * DT * np.cos(th), y + V * DT * np.sin(th), th + w * DT]
        odo[k] = V * SCALE + rng.normal(0, 0.02)
        gyro[k] = w + 0.0003 + rng.normal(0, 0.003)   # small residual gyro bias
        if k % 2 == 0:                                # GNSS at 5 Hz; the state persists with probability 0.90
            p = P_CANOPY if 12.0 <= t < 48.0 else P_OPEN
            if k == 0 or rng.random() > 0.90:
                state = rng.choice(4, p=p)
            code = CODES[state]
            z = truth[k + 1, :2] + rng.normal(0, SIG.get(code, 1.0), 2) if code != 1 else None
            fixes.append((k, code, z))
    return truth, odo, gyro, fixes

def run_ekf(truth, odo, gyro, fixes, r_of):
    """EKF with state [x, y, heading, odometry scale]; r_of(code) gives the GNSS sigma the filter believes."""
    x = np.array([0.0, 0.0, 0.0, 1.0]); P = np.diag([0.05 ** 2, 0.05 ** 2, 0.02 ** 2, 0.02 ** 2])
    Q = np.diag([0.0015 ** 2, 0.0015 ** 2, 0.001 ** 2, 5e-5 ** 2])
    out_x, out_P, nis = [x[:2].copy()], [P[:2, :2].copy()], []
    fix_at = {k: (c, z) for k, c, z in fixes}
    for k in range(STEPS):
        d = odo[k] * DT / x[3]
        F = np.array([[1, 0, -d * np.sin(x[2]), -d * np.cos(x[2]) / x[3]],
                      [0, 1, d * np.cos(x[2]), -d * np.sin(x[2]) / x[3]],
                      [0, 0, 1, 0], [0, 0, 0, 1]])
        x = np.array([x[0] + d * np.cos(x[2]), x[1] + d * np.sin(x[2]), x[2] + gyro[k] * DT, x[3]])
        P = F @ P @ F.T + Q
        if k in fix_at and fix_at[k][0] in SIG:
            code, z = fix_at[k]
            H = np.zeros((2, 4)); H[0, 0] = H[1, 1] = 1.0
            S = H @ P @ H.T + np.eye(2) * r_of(code) ** 2
            nu = z - x[:2]
            K = P @ H.T @ np.linalg.inv(S)
            x = x + K @ nu; P = (np.eye(4) - K @ H) @ P
            nis.append((code, float(nu @ np.linalg.solve(S, nu))))
        out_x.append(x[:2].copy()); out_P.append(P[:2, :2].copy())
    return np.array(out_x), np.array(out_P), nis

filters = {
    "A fixed R = 0.02 m":   lambda c: 0.02,
    "B R by fix type":      lambda c: SIG[c],
    "C R by fix type / 2":  lambda c: SIG[c] / 2,
}
runs = [simulate(100 + i) for i in range(RUNS)]
logs = {name: [run_ekf(*r, fn) for r in runs] for name, fn in filters.items()}
canopy = slice(int(14 / DT), int(48 / DT))
lo, hi = chi2.ppf([0.025, 0.975], 2 * RUNS) / RUNS            # two-sided 95% bounds for the NEES averaged over the runs
print(f"NEES bounds for {RUNS} runs and 2 degrees of freedom: {lo:.2f} to {hi:.2f}")
for name, res in logs.items():
    err = np.array([r[0] - r_[0][:, :2] for r, r_ in zip(res, runs)])          # runs x time x 2
    rms = np.sqrt(np.mean(np.sum(err[:, canopy] ** 2, axis=2)))
    nees = np.array([[e @ np.linalg.solve(Pk, e) for e, Pk in zip(err[i], res[i][1])] for i in range(RUNS)]).mean(axis=0)
    inside = np.mean((nees[canopy] >= lo) & (nees[canopy] <= hi)) * 100
    print(f"{name:20s} RMS error in the canopy {rms:.2f} m, mean NEES {nees[canopy].mean():7.2f}, inside the bounds {inside:5.1f}% of the time")
NEES bounds for 30 runs and 2 degrees of freedom: 1.35 to 2.78
A fixed R = 0.02 m   RMS error in the canopy 0.79 m, mean NEES 7904.22, inside the bounds   0.0% of the time
B R by fix type      RMS error in the canopy 0.06 m, mean NEES    1.65, inside the bounds  93.8% of the time
C R by fix type / 2  RMS error in the canopy 0.07 m, mean NEES    3.93, inside the bounds   1.2% of the time

Filter A errs by 0.79 m (RMS under the canopy) and its mean NEES is 7,904, where it should be about 2, because it believes it is off by only a few centimetres yet meets single fixes that are wrong by metres. Filter B errs by only 0.06 m and its mean NEES of 1.65 is inside the bounds 93.8% of the time. Filter C, with half the true sigma, errs about as much (0.07 m) but has a mean NEES of 3.93 and is inside the bounds only 1.2% of the time, meaning it is roughly twice as confident as it should be. The important observation is that accuracy alone cannot tell you whether the filter is usable: B and C err almost equally, yet the uncertainty they report is clearly different.

Log-scale line graph of NEES averaged over 30 runs against time from 0 to 60 seconds. A thin green band marks the 95 percent bounds of 1.35 to 2.78. The blue line for filter B stays mostly inside the band. The gold line for filter C sits above the band at about 4. The pink line for filter A jumps to thousands and tens of thousands when it enters the canopy at second 12, then falls after second 48
Figure 2 Averaged NEES of three filters against the 95% bounds

Checking consistency with NEES and NIS

A Kalman filter reports an estimate with covariance . It is consistent when the real error has the size says (Bar-Shalom et al., 2001). There are two standard tests.

  • NEES (normalized estimation error squared), , needs truth, as in simulation or on a test field with an RTK reference. If the filter is consistent, is chi-square distributed with as many degrees of freedom as states tested, and its expected value equals the degrees of freedom (here 2).
  • NIS (normalized innovation squared), , uses the difference between measurement and prediction and needs no truth, so it works in the field.

Both fluctuate randomly, so judgement uses the average over many samples against bounds. For the average of independent samples of a chi-square variable with degrees of freedom, the average lies in with probability 95%. Example 2 applies these bounds to the 30-run average at each time. A value above the bounds means overconfident; below means more cautious than necessary.

Autopilots already have similar tools. PX4’s EKF2 computes a test ratio for each measurement’s innovation and rejects the measurement when the ratio exceeds 1 (PX4 Autopilot, n.d.-a). ArduPilot’s EKF failsafe triggers when any two of the compass, position and velocity variances exceed FS_EKF_THRESH for 1 second (ArduPilot Dev Team, n.d.). These are the flight stack’s last safety net; they do not check whether the noise model you set matches the real sensors. That check is the developer’s job.

Example 3 Finding a wrong R from the innovations alone

In the field we have only the filter’s log and no truth. Use the NIS of every GNSS correction from Example 2, split by fix type, against the 95% bounds for the mean of that many samples (the expected value is 2 because the measurement is two-dimensional).

# Example 3: no ground truth in the field, so test the filters with their own innovations (uses logs from Example 2)
print("fix type  samples | mean NIS of A, B, C | 95% bounds for a consistent filter (expected value 2)")
for code, label in ((6, "fixed"), (5, "float"), (3, "single")):
    vals = {name: np.array([v for run in res for c, v in run[2] if c == code]) for name, res in logs.items()}
    n = len(vals["B R by fix type"])
    lo, hi = chi2.ppf([0.025, 0.975], 2 * n) / n
    row = "  ".join(f"{v.mean():8.2f}" for v in vals.values())
    verdict = "  ".join("ok" if lo <= v.mean() <= hi else ("high" if v.mean() > hi else "low") for v in vals.values())
    print(f"{label:8s} {n:7d}  | {row} | {lo:.2f} to {hi:.2f}   {verdict}")
fix type  samples | mean NIS of A, B, C | 95% bounds for a consistent filter (expected value 2)
fixed       4086  |   101.82      1.94      7.17 | 1.94 to 2.06   high  low  high
float       2215  |   798.31      1.96      7.77 | 1.92 to 2.08   high  ok  high
single      1996  | 28194.57      1.96      7.85 | 1.91 to 2.09   high  ok  high

The table says both that something is wrong and where. Filter A has a mean NIS of 101.8 with fixed, 798.3 with float and 28,194.6 with single; all three rows are far above the bounds, showing R is too small for every type and worst for single. Filter C is high in every row at about 7.2 to 7.9, the signature of halving sigma (NIS rises to roughly four times what it should be). Filter B gets 1.96 in both float and single, inside the bounds, and 1.94 for fixed, which is slightly below the lower bound (they round to the same 1.94), so it is a touch cautious and acceptable. The practice is that when the NIS of a fix type is above the bounds, increase R for that type (or check whether that type has a systematic error the filter does not model), rather than widening the gate to make the warning go away.

The navigation-mode supervisor

A consistent filter can say how bad the position is. The next layer must use that to decide. A navigation supervisor takes the filter’s sigma and turns it into an allowed speed. The rule comes from the geometry of the lane. If the free space from the vehicle to things it must not touch (hoses, trunks) is metres on each side and a margin of metres is wanted, believing that the cross-row position lies within requires , so . Above this the vehicle may be outside the lane without knowing it, and must stop.

Example 4 The mode supervisor on the data of Example 2

The robot’s lane has hoses on both sides, with free space m on each side and an extra margin m, giving m. The supervisor has three modes from the filter’s lateral sigma. Green when it is at most half of : full speed, 1.5 m/s. Amber when above half but at most : speed reduced linearly down to 0.3 m/s. Red when above : stop. It is evaluated on the recorded data of the three filters by counting the time when the supervisor allowed the vehicle to move although the true cross-row error exceeded 0.6 m (an open-loop evaluation; the supervisor does not change the vehicle’s trajectory in the simulation).

# Example 4: a navigation-mode supervisor that turns the filter's own sigma into a speed limit (uses logs from Example 2)
CLEAR, MARGIN, V_FULL, V_MIN = 0.6, 0.1, 1.5, 0.3     # free half-width each side (m), extra margin (m), speeds (m/s)
sigma_max = (CLEAR - MARGIN) / 3                      # 3 sigma plus the margin must fit in the free half-width
def supervisor(sig_y):
    if sig_y > sigma_max:
        return "red", 0.0                             # stop and wait for a better fix or switch to LiDAR lane keeping
    if sig_y > sigma_max / 2:
        return "amber", V_MIN + (V_FULL - V_MIN) * (sigma_max - sig_y) / (sigma_max / 2)
    return "green", V_FULL
print(f"largest sigma allowed across the lane: {sigma_max:.3f} m")
for name, res in logs.items():
    counts = {"green": 0, "amber": 0, "red": 0}; unsafe = total = 0; speed = 0.0
    for (est, Ps, _), (truth, *_r) in zip(res, runs):
        for k in range(canopy.start, canopy.stop):
            mode, v = supervisor(np.sqrt(Ps[k][1, 1]))
            counts[mode] += 1; total += 1; speed += v
            if mode != "red" and abs(est[k][1] - truth[k][1]) > CLEAR:
                unsafe += 1                           # allowed to move while the true lateral error exceeded the free half-width
    share = " ".join(f"{m} {100 * c / total:5.1f}%" for m, c in counts.items())
    print(f"{name:20s} {share} | mean speed {speed / total:.2f} m/s | moving with true error > {CLEAR} m: {100 * unsafe / total:.2f}% of the time")
largest sigma allowed across the lane: 0.167 m
A fixed R = 0.02 m   green 100.0% amber   0.0% red   0.0% | mean speed 1.50 m/s | moving with true error > 0.6 m: 25.31% of the time
B R by fix type      green  73.6% amber  22.6% red   3.8% | mean speed 1.36 m/s | moving with true error > 0.6 m: 0.00% of the time
C R by fix type / 2  green  87.8% amber  10.7% red   1.5% | mean speed 1.43 m/s | moving with true error > 0.6 m: 0.00% of the time

Trusting filter A, the supervisor sees green 100% of the time and the vehicle runs at full speed, although for 25.31% of the time under the canopy the true error exceeded 0.6 m. Trusting filter B, the supervisor is in amber 22.6% and red 3.8% of the time, the mean speed falls to 1.36 m/s, and at no time does the vehicle move while the true error exceeds 0.6 m. Filter C lets the vehicle run a little more (mean speed 1.43 m/s) and in this scene it still never reaches 0.6 m, but Example 2 already showed it is overconfident, so a worse scene would give a different result. The cost of safety is availability: the vehicle slows or stops 26.4% of the time under the canopy (actually stopped 3.8%). The way to reduce that cost is to add a cross-row source from LiDAR so that sigma does not grow so fast.

Graph of the lateral sigma of filter B against time from 0 to 60 seconds. The background has three zones: green up to half of the maximum sigma of 0.167 metres, amber from there to 0.167, and red above. The sigma line is near zero outside the canopy, grows to about 0.1 metres during a stretch without usable fixes and drops when a fix arrives, then grows again to about 0.28 metres in the red zone before dropping when fixes return
Figure 3 Lateral sigma of the filter against the supervisor modes

The mode supervisor is an application layer. It does not replace the flight stack’s safety net but acts before it. When the mode is red the system should have a way out, such as switching to following the trunk line by LiDAR or sending a message to the operator, rather than standing still forever. The supervisor is also an instance of the contract between layers in module 1, where the estimator sends sigma along, and the prototype of the runtime monitor in module 5.

Module lab

Lab: set R by fix type and check NIS on real data

  1. Use the data logged in the module 1 lab (time, fix type, position, wheel distance) or sample data prepared by the lecturer, and add gyro data if available.
  2. Write the EKF with state as in Example 2, adapted to read the real data. Set R by fix type using sigma values you measure yourself from 5 minutes of standing still on a point of known coordinates, separately for each fix type.
  3. Compute the mean NIS for each fix type against the 95% bounds as in Example 3. Adjust R until every type is inside the bounds.
  4. If a tape-measured check point exists, compute the true error there and compare it with the sigma the filter reports.
  5. Try a single R value for every type and compare NIS and error with step 3.
  6. Define and of the lane on the group’s test field, compute and count the share of time in each supervisor mode as in Example 4.

Common mistakes

Watch out

  • Setting one R for GNSS of every fix type, so the filter trusts a single fix as much as RTK
  • Looking only at position error, not at consistency: a filter that is accurate but overconfident leads the supervisor and the planner to wrong decisions
  • Using NEES in the field where there is no truth: use NIS instead
  • Judging NEES and NIS from a single sample: use averages over many samples and bounds that fit the sample count
  • Widening the gate to make a warning disappear instead of fixing R or finding the systematic error
  • Mixing absolute positions from two conflicting sources, such as vision position with GPS, without checking frames and timing
  • Believing GNSS with many satellites is always good: under the canopy the satellites cluster in a narrow strip, so cross-row HDOP is poor
  • Using a mode supervisor that stops the vehicle with no alternative: the vehicle will stand still under the canopy and the mission will not progress

Summary

  • Loosely coupled fusion takes the receiver’s solution and needs at least four satellites; tightly coupled fusion takes raw ranges and works with two or three.
  • Under the canopy satellite geometry is good along the row and poor across it, so a cross-row source such as LiDAR is needed.
  • A vehicle EKF should set GNSS R by fix type and carry the odometry scale as a state.
  • NEES checks consistency when truth exists and NIS works in the field; use averages against .
  • Accuracy alone is not enough; an overconfident filter is more dangerous than a cautious one.
  • A mode supervisor turns sigma into speed with and needs an alternative when it reaches red.

Self-check questions

  1. For the NEES averaged over 20 runs with three degrees of freedom, what is the 95% bound? (Use and .)
  2. A receiver sees three satellites. What do a loosely coupled and a tightly coupled filter get differently?
  3. A lane has 0.8 m of free space per side and a 0.2 m extra margin. What is , and what sigma is green?
  4. The mean NIS of 100 float corrections (two degrees of freedom) is 3.1 and the 95% bounds are 1.63 to 2.41. Is the filter overconfident or too cautious, and how should R be adjusted?
  5. With , and a range standard deviation of 1.5 m, what are the HDOP and the two axis errors?
Answers
  1. (software gives 2.0241 and 4.1649).
  2. The loosely coupled filter gets no position from the receiver because it needs at least four satellites, so it relies on the INS and wheels alone. The tightly coupled filter uses each range as a measurement and reduces the uncertainty in the directions the satellites look along, even with only three.
  3. m. Green is a sigma of at most half of that, 0.1 m.
  4. 3.1 is above the upper bound of 2.41, so the filter is overconfident. R for float is too small (or there is a systematic error). Increase R for float and recompute NIS.
  5. ; east error m; north error m.

Key formulas

Satellite geometry matrix and HDOP
Covariance after fusing satellite ranges, tightly coupled
NEES and NIS
Bounds for an average of N samples with n degrees of freedom
Largest sigma allowed across the lane

Key references

  1. Groves, P. D. (2013). Principles of GNSS, inertial, and multisensor integrated navigation systems (2nd ed.). Artech House. link
  2. Bar-Shalom, Y., Li, X.-R., & Kirubarajan, T. (2001). Estimation with applications to tracking and navigation: Theory, algorithms and software. Wiley. link
  3. Thrun, S., Burgard, W., & Fox, D. (2005). Probabilistic robotics. MIT Press. link
  4. Welch, G., & Bishop, G. (2004). An introduction to the Kalman filter (TR 95-041). University of North Carolina at Chapel Hill. link
  5. PX4 Autopilot. Using PX4's navigation filter (EKF2). PX4 user guide (main). link
  6. PX4 Autopilot. Visual inertial odometry (VIO). PX4 guide (main). link
  7. ArduPilot Dev Team. EKF failsafe. ArduPilot Copter documentation. link
  8. Popovici, B., Pelorosso, R., Herbei, M. V., Sala, F., & Avădanei, M. (2026). GNSS positioning accuracy in forest environments: A structured critical review of canopy effects and mitigation strategies. Geodetski list, 80(3), 207–226. link
  9. Borenstein, J., & Feng, L. (1996). Measurement and correction of systematic odometry errors in mobile robots. IEEE Transactions on Robotics and Automation, 12(6), 869–880. link

Further reading

Study the assigned knowledge units in advance, review media and take the module quiz

In class / field

Lab or field practice from worksheets with a safety checklist

Learning evidence: Checked worksheets and quiz results

Module quiz

This is a formative self-check, not a graded exam

Knowledge domain: Control, autopilot and navigation · Sensors and embedded systems