GNSS/IMU Fusion (gnss fuse)¶
Loosely-coupled GNSS/IMU integration: a 15-state error-state EKF (position, velocity, attitude, accel bias, gyro bias) propagates 100 Hz strapdown mechanization and corrects with the library's own RTK (or SPP) solutions plus Doppler-derived velocity. Design insights are borrowed from inuex35/tightly-coupled-gnss-imu-fgo (two-phase pipeline, ZUPT/NHC constraints, lever-arm handling), re-expressed as a pure C++/Eigen ESKF with no external estimator dependency.
Usage¶
gnss fuse \
--rover data/PPC-Dataset/tokyo/run1/rover.obs \
--base data/PPC-Dataset/tokyo/run1/base.obs \
--nav data/PPC-Dataset/tokyo/run1/base.nav \
--imu data/PPC-Dataset/tokyo/run1/imu.csv \
--lever-arm 0.31,0,0.55 \
--preset low-cost \
--out output/fused.pos
Omitting --base falls back to SPP as the GNSS half. --attitude-csv
exports per-epoch roll/pitch/yaw for analysis.
Add --tight-dd-imu (requires --base) to augment the propagated INS state
with real rover/base double-difference rows and innovation-gated soft recovery.
Code DD is committed; carrier/ambiguity candidates are evaluated in shadow and
fall back to code-only without partial AR. --tight-dd-carrier-experimental
commits carrier, ambiguity, and partial-AR updates for research ablations. It
is deliberately separate because PPC long-prefix validation found that
apparently accepted carrier updates could make the covariance indefinite.
Without either flag the established loose-coupling path is unchanged.
Key flags: --lever-arm x,y,z (IMU→antenna, body FLU), --zupt/--no-zupt
(default on), --zupt-gnss-speed-gate/--no-zupt-gnss-speed-gate (default
on), and --zupt-gnss-speed-threshold-mps (default 0.5). A last-known GNSS
velocity above the threshold latches ZUPT suppression until a later low-speed
GNSS velocity releases it; stale/missing velocity does not silently re-enable
ZUPT after a moving latch. If no GNSS velocity has ever been available, the
legacy IMU-only detector is preserved. The default-on gate is a safety guard
against the IMU variance/median detector mistaking smooth constant-speed
motion for a stop. --nhc/--no-nhc (default off), --imu-grade,
--max-position-nis/--max-velocity-nis/--max-consecutive-gate-rejections
(innovation gating), heading-alignment window/threshold knobs (see --help).
When a GNSS Doppler velocity update is rejected repeatedly, the default
--max-consecutive-velocity-gate-rejections 3 recovery can re-anchor only the
IMU-origin velocity from the same finite, positive-semidefinite Doppler
covariance. The antenna measurement is converted with
v_imu = v_antenna - R(omega x lever_arm); position, attitude, and biases are
left unchanged, velocity cross-covariances are cleared, and the correction is
bounded by --max-gnss-velocity-reanchor-mps (default 20 m/s). A malformed
covariance or an over-bound correction cannot trigger the recovery. This is a
bounded deterministic recovery for velocity-gate lockout, not an ungated EKF
retry; set the patience to 0 to disable it.
Position-gate recovery follows the same separation: only a run of trusted
FIXED rejections can trigger the position-only re-anchor, and a FLOAT or
SPP epoch resets that patience counter. The application default is 30
consecutive FIXED epochs. The default position correction bound is unlimited
(+infinity), because a genuine outage can leave the IMU origin tens or
hundreds of metres from a returning, accurate FIX; an application that has an
independent maximum-jump contract can set a finite
max_fixed_position_reanchor_m in the library configuration. The reset still
requires finite target/covariance data and changes only position (including
its covariance block); it never retries a rejected EKF update or overwrites
velocity, attitude, or biases.
The RTK half takes three wrong-fix guards from gnss solve, all off by
default:
--hold-kalman-updateapplies the held integers as a Kalman pseudo-observation instead of overwriting the ambiguities.--hold-kalman-update-validated-only(with--hold-kalman-update) applies it only after a validated ambiguity-resolution FIX, not after the hold-fix fallback.--min-fix-satellites <k>refuses an ambiguity-resolution FIX with fewer than k non-reference satellites.
With --navi776-tc on the six PPC runs, all three together cut the wrong-FIX
rate from 7.08% to 2.00% of FIX. FIX within 0.5 m fall by 0.91 pp of epochs,
but FIX within 0.25 m rise from 62.93% to 65.90%
(measurement).
On UrbanNav Tokyo they also lower the wrong-FIX rate. On Odaiba, however, they
hold one wrong fix for 13 s, 12 m off horizontally and 44 m in height
(UrbanNav check).
Position frame contract¶
The loose ESKF nominal position_enu and velocity_enu are always the IMU
origin. LooseCouplingProcessor::toPositionSolution() preserves that
IMU-origin contract for internal consumers, including tight-coupling
propagation, priors, and integrity evidence. The GNSS/RTK input and the PPC
reference.csv are antenna-frame positions.
External fused .pos and KML products emitted by gnss fuse use
toAntennaPositionSolution(): position is p_imu + R_body_to_enu * lever_arm
and velocity is v_imu + R_body_to_enu * (omega_body x lever_arm), then both
are rotated to ECEF. Their position and velocity covariance are the matching
H P H^T projections, including the lever-arm attitude Jacobian. The
velocity projection treats the latest bias-corrected gyro sample as an
observed input and therefore does not include a separate gyro measurement
noise term. Do not change internal propagated-solution callers to the
antenna method without separately auditing their frame contract.
The urban-bridge-score JSON summary records the same declaration under
coordinate_frame_contract so archived metrics remain auditable.
IMU input¶
imu.csv is parsed by header name (whitespace/case/punctuation-insensitive),
matching the convention of scripts/analysis/analyze_ppc_imu_coverage.py:
GPS TOW + week, accel in m/s², angular rate in deg/s (converted to rad/s at
load). Body-axis convention is explicit (ImuAxisConvention), defaulting to
FLU/Z-up, which is what the PPC-Dataset IMU actually logs (verified: stationary
Acc Z ≈ +9.81, despite the upstream README saying FRD).
Architecture¶
| Piece | Location |
|---|---|
| IMU CSV loader | include/libgnss++/io/imu.hpp, src/io/imu.cpp |
| Strapdown mechanization, attitude | src/fusion/mechanization.cpp, attitude.cpp |
| Process noise / discretization | src/fusion/fusion_process_noise.cpp |
| Measurement models (pos/vel/ZUPT/NHC, lever arm) | src/fusion/fusion_measurement.cpp |
| Dense Joseph-form update + NIS gate | src/fusion/fusion_update.cpp |
| Static + heading alignment | src/fusion/fusion_initialization.cpp |
| Per-epoch driver | src/fusion/fusion_processor.cpp (LooseCouplingProcessor) |
RTK + IMU epoch pipeline (gnss fuse --base) |
src/fusion/rtk_imu_fusion.cpp (RtkImuFusionProcessor) |
| Tight DD row adapter | RTKProcessor::formTightlyCoupledObservations |
| Augmented INS/ambiguity update | src/fusion/dd_imu_bridge.cpp |
| Doppler LS velocity (feeds SPP/RTK solutions) | src/algorithms/spp_velocity.cpp |
| CLI | apps/native/gnss_fuse.cpp (registered as fuse in apps/gnss.py) |
gnss fuse --help intentionally shows only everyday inputs, outputs, and
presets. The accepted tuning and research flags remain backward-compatible
and are listed under gnss fuse --help-advanced. Prefer --navi776-tc
instead of spelling out its component tight-coupling flags.
With --base, --navi776-tc writes --out from the
independent output filter. With
--tc-velocity-states set by hand, add --independent-output-filter if you
use --out, or use the RTK stream written by --rtk-pos-out. Without that
filter the fused --out stream can be kilometres off on the PPC Tokyo runs,
because the main loose ESKF takes a wrong RTK velocity state
(known issue).
Without any tight-coupling flag, PPC nagoya/run1 is kilometres off too: there
the loose ESKF's gyro bias estimate grows to 0.23 rad/s and its heading does
not converge. --consider-before-heading-latch fixes most of that
(below).
For repeatable runs, put defaults in a flat TOML [gnss_fuse] table and pass
--config <path>. Keys may use snake_case or kebab-case; vector values
such as lever_arm and base_ecef use three-element arrays. Command-line
options are applied after the file regardless of where --config appears, so
they are reliable one-run overrides. See configs/examples/fuse.example.toml.
The fusion deliberately does not reuse algorithms/kalman.hpp: its
RTKLIB-style "active state" convention (x[i] != 0) is incompatible with an
error state that is legitimately zero after injection.
Heading alignment latches only after a trailing window of GNSS course samples agrees within a circular-scatter tolerance (a single-epoch latch was shown to catch reversing vehicles ~180° wrong on PPC nagoya). The reported "heading converged" status requires alignment plus healthy recent velocity-innovation NIS.
The loose ESKF before the heading latch¶
Until the heading latches, the yaw σ is 180°, so the error-state linearization about the nominal yaw is not valid. By default the GNSS, ZUPT and NHC updates of that phase still correct roll, pitch and both IMU biases. The latch then reopens only the yaw, and the tilt and biases learned before it stay, with a small and wrong covariance.
- What goes wrong. On 7 of the 11 runs below, the gyro bias estimate reaches 0.09–0.23 rad/s, and the heading then drifts. On tokyo/run1, tokyo/run2 and nagoya/run1 the jump comes within seconds of the latch. This is the mechanism found for the online PVA filter (candidate v11).
- What the flag does.
--consider-before-heading-latchmakes those pre-latch updates Schmidt consider updates for the attitude and both biases: position and velocity are corrected, the attitude and biases are left unchanged, and the covariance stays consistent (Joseph form). After the latch every update is the plain update. The option is the onevelocity_consistency_v10ofgnss pva-evaluatesets;gnss fuseexposes it as an opt-in. - nagoya/run1 starts by reversing. The car backs out of a parking space
for about 8 s at up to 1.2 m/s, and the course samples agree, so the
heading latches 180° off. The flag does not fix this wrong latch: with it,
nagoya/run1 still reaches 0.117 rad/s and a p90 of 72.5 m. The heading-latch direction test of
velocity_consistency_v5flips nagoya/run1 correctly but also flips the correct forward latches on Odaiba and HK Deep-Urban-1, so it is not exposed ingnss fuse. A regression check fixed it on the development data but failed its frozen holdout and was removed (reverse starts).
Fused --out 3D error, p50 / p90 (m), one run each, the same RTK flags
(--preset low-cost --ratio 2.4 --max-subset-ar-drop-steps 18
--rtk-snr-weighting --no-arfilter) and no tight coupling. The largest gyro
bias estimate of the run is in parentheses (rad/s).
| Run | Default | --consider-before-heading-latch |
|---|---|---|
| PPC tokyo/run1 | 2.43 / 60.3 (0.161) | 0.12 / 9.4 (0.012) |
| PPC tokyo/run2 | 0.12 / 1.6 (0.088) | 0.10 / 1.6 (0.010) |
| PPC tokyo/run3 | 0.09 / 2.3 (0.158) | 0.08 / 2.3 (0.008) |
| PPC nagoya/run1 | 2,044 / 13,274 (0.229) | 1.60 / 72.5 (0.117) |
| PPC nagoya/run2 | 0.63 / 15.4 (0.025) | 0.63 / 15.2 (0.024) |
| PPC nagoya/run3 | 1.86 / 16.7 (0.013) | 1.81 / 16.7 (0.021) |
| UrbanNav Odaiba | 0.39 / 17.8 (0.152) | 0.27 / 17.8 (0.005) |
| UrbanNav Shinjuku | 0.53 / 19.5 (0.097) | 0.32 / 15.5 (0.024) |
| UrbanNav HK Deep-Urban-1 | 5.98 / 57.5 (0.101) | 3.21 / 56.4 (0.006) |
| UrbanNav HK Harsh-Urban-1 | 66.2 / 479 (0.023) | 140.7 / 265 (0.028) |
| UrbanNav HK Medium-Urban-1 | 4,659 / 39,329 (0.050) | 48.8 / 193 (0.038) |
- The PPC runs use the FLU lever arms, UrbanNav a zero lever arm, and
UrbanNav Tokyo
--base-ecef -3961904.9530 3348993.7578 3698211.7553. The Hong Kong error is to the raw truth, about 0.6 m from the antenna. - The RTK stream (
--rtk-pos-out) is byte-identical with and without the flag on all 11 runs. - HK Harsh-Urban-1 is worse at p50. Its RTK stream fixes 2.5% of the epochs and 92% of those fixes are wrong, so its fused output is unusable either way.
- All 11 runs are development data: PPC and UrbanNav Tokyo were used to find the mechanism, and the table was measured after it.
- It failed a frozen holdout (contract, results), so the default stays off. On SmartPNT-POS Data11 the fused p90 rose from 4.80 m to 33.6 m: after a 630 s stand-still the heading did not converge for about 2,000 s after the latch. Data12 was unchanged.
- Do not combine it with
--tc-closed-loopor--navi776-tc. The closed-loop INS starts from the loose ESKF's attitude and biases, so the flag changes the RTK stream. On one run per PPC run under--navi776-tc, correct FIX fall from 68.21% to 65.10% and the wrong-FIX rate rises from 6.41% to 9.53%.--navi776-tcuses the independent output filter instead, which makes the consider update without touching the RTK stream. - Since 2026-11-02 the flag also re-aligns over the stand-still before the latch (below). The table above was measured before that.
Independent output filter¶
--independent-output-filter (with --base) writes --out and
--attitude-csv from a second loose ESKF. That filter gets the same IMU
samples and the RTK position, but two things differ:
- its velocity input is the epoch SPP Doppler velocity, not the RTK solution's velocity;
- it always makes the pre-latch updates consider updates, as
--consider-before-heading-latchdoes.
The main loose ESKF is unchanged. It still bootstraps the closed-loop INS and
serves the options that read it (--rtk-ins-prior, --tight-dd-imu). So the
RTK stream (--rtk-pos-out) is byte-identical with and without the flag; that
holds on all 11 runs below. The last column is the RTK stream's own error,
for reference; each stream is scored on the epochs it outputs.
It is meant for --navi776-tc. There the RTK velocity state is not a usable
velocity, and the main filter, which takes it, drifts kilometres away.
--navi776-tc turns the filter on when --base is given.
--no-independent-output-filter, given
anywhere, keeps --out from the main filter. Under --navi776-tc the run
summary says whether the filter is on and, if not, why.
Fused --out 3D error, p50 / p90 (m), one run each, --preset low-cost
--ratio 2.4 --max-subset-ar-drop-steps 18 --rtk-snr-weighting --no-arfilter
--navi776-tc. Lever arms and the UrbanNav Tokyo --base-ecef are as in the
previous table.
| Run | Main loose ESKF | --independent-output-filter |
RTK stream |
|---|---|---|---|
| PPC tokyo/run1 | 6,156 / 81,696 | 0.12 / 12.0 | 0.05 / 10.7 |
| PPC tokyo/run2 | 154 / 3,447 | 0.09 / 2.6 | 0.04 / 2.3 |
| PPC tokyo/run3 | 7,919 / 104,223 | 0.09 / 1.4 | 0.04 / 2.9 |
| PPC nagoya/run1 | 1.56 / 84.5 | 1.46 / 52.6 | 0.13 / 2.6 |
| PPC nagoya/run2 | 34.4 / 330 | 0.49 / 19.0 | 0.44 / 34.4 |
| PPC nagoya/run3 | 6.76 / 108 | 0.45 / 8.8 | 0.20 / 61.5 |
| UrbanNav Odaiba | 30.3 / 135 | 0.28 / 8.7 | 0.08 / 16.4 |
| UrbanNav Shinjuku | 40.7 / 548 | 0.39 / 14.6 | 0.16 / 8.8 |
| UrbanNav HK Deep-Urban-1 | 73,048 / 210,610 | 28.1 / 126 | 2.21 / 22.7 |
| UrbanNav HK Harsh-Urban-1 | 65.2 / 444 | 27.2 / 252 | 8.53 / 65.8 |
| UrbanNav HK Medium-Urban-1 | 1,153 / 2,289 | 908 / 25,565 | 4.82 / 12.4 |
- The SPP velocity is what matters. Giving the second filter the RTK velocity instead (with the consider update) leaves Tokyo hundreds to thousands of metres off: tokyo/run1 p50 611 m.
- Hong Kong stays poor.
- The RTK filter reports every FLOAT with the same small covariance (σ 0.17 m over the three axes). On HK Deep-Urban-1 the FLOAT error is 13–17 times that (median), so both filters trust FLOAT positions that are metres off.
- Without tight coupling the same output filter gets 2.94 m on that run.
- On HK Medium-Urban-1 the RTK stream has few valid epochs, the filter coasts for long stretches, and both outputs are unusable.
- nagoya/run1 still starts with the reverse-out-of-parking latch 180° off (above); see reverse starts.
- Development data, then a frozen holdout. These 11 runs are development data. The flag then passed a frozen holdout on SmartPNT-POS Data11 and Data12 (contract, results):
- Data11: 181 / 790 m → 0.79 / 4.42 m;
- Data12: 93.7 / 1,542 m → 0.15 / 10.2 m;
- the RTK stream identical on both.
--navi776-tc has turned it on since then (2026-11-01).
- Re-alignment over the stand-still before the latch (2026-11-02). The
filter takes its gyro bias and tilt from the first 2 s of IMU data. Before
the latch, the consider update keeps both out of every measurement update.
- The failure. An IMU start-up transient in that window used to
integrate into the tilt for the whole stand-still:
- SmartPNT Data15: 46° of pitch by the first motion, and --out
hundreds of kilometres off;
- UrbanNav HK Harsh-Urban-1: 27°.
- The fix. While the consider update is in force, the filter now
re-aligns over the current stand-still. Once the ZUPT stationarity test
has held for 2 s, and then every 1 s, it sets three values from the mean
raw IMU sample of that stand-still, as the static alignment does:
the gyro bias, the tilt and the accel bias. The yaw is kept, and any
motion restarts the stand-still.
- Where it applies. The independent output filter under
--navi776-tc, and --consider-before-heading-latch. The RTK stream
never changes.
- Evidence. It passed a frozen holdout
(contract,
results) with a small
effect: one run better and four equal. The large repair is development
evidence only.
- Effect on the 20 development runs, fused --out 3D p50 / p90 (m)
under --navi776-tc, before → after:
- Better: Data15 776,534 km / 26,124,910 m → 1.00 / 22.5 m; Data16
0.191 / 76.4 → 0.175 / 76.4; nagoya/run1 1.458 / 52.6 → 1.464 / 50.8.
- Equal: the other usable runs.
- Unusable either way, worse on three: HK Deep 28.1 / 126 → 46.6 / 133;
HK Harsh 27.2 / 252 → 78.7 / 369; HK Medium 908 / 25,565 → 46.3 / 258;
Data01 545 / 186,987 → 179 / 2,241; Data14 405 / 27,223 → 14,596 /
477,702.
- Yaw variance before the latch (2026-11-02). The consider update never
lowers the yaw variance, and the gyro-bias variance keeps adding to it.
- The failure. On SmartPNT Data16 the yaw sigma of the output filter
grew from 180° to 794° over the 1,300 s stand-still. Through the lever
arm (0.57 m) that made the position update worth several metres of
sigma: the filter took 0.1 m RTK updates all along, yet its east position
sigma grew from 0.72 m to 1.66 m and --out wandered about 0.4 m from
the RTK position.
- The fix. While the consider update is in force, the filter keeps the
yaw variance at the initial (180°)². It scales the yaw row and column of
the covariance, which keeps the matrix positive semi-definite and the
yaw correlations. The latch replaces the yaw row and column as before.
- Where it applies. Where the re-alignment does. The RTK stream never
changes, and without the consider update the output is byte-identical
(checked on tokyo/run1 and Data16 without tight coupling).
- Effect on the 20 development runs, fused --out 3D p50 / p90 (m)
under --navi776-tc, before → after. The fused stream changes on every
run, but on most only within the 1% band:
- Better: Data13 0.159 / 0.79 → 0.118 / 0.79; Data16 0.175 / 76.4 →
0.165 / 76.4.
- Equal: the other 13 usable runs.
- Unusable either way: HK Deep and HK Medium equal; HK Harsh
78.7 / 369 → 90.6 / 615; Data01 179 / 2,241 → 260 / 2,488; Data14
14,596 / 477,702 → 2,014 / 592,669.
The cap shrinks the Data16 wander in the second half of the stand-still
(−0.12 → −0.01 m east at TOW 376200), not the 0.2 m offset of its first
minute. It is a correctness fix with no holdout: an unbounded variance
has no meaning, and the development runs show no harm.
Reverse starts¶
The heading latch takes the GNSS course, the direction of travel. When the vehicle starts by reversing, body +X points the other way and the latch is 180° off. nagoya/run1 starts like that: it backs out of a parking space.
Status: not fixed. The opt-in --heading-latch-direction-regression
(#697) failed its frozen holdout and was removed from gnss fuse and
LooseCouplingProcessor (its code is at 894ccc1). A next version would be
rebuilt, so the option was not kept. The rest of this section records what it
did.
The check tested the direction with a regression. Over each interval of at least 0.5 s since the last stop, it paired two numbers:
- the mean IMU body-forward kinematic acceleration;
- the rate of change of the GNSS horizontal speed.
The slope of the first on the second is about +1 moving forward and −1
moving backward. A constant accelerometer bias or tilt error moves only the
intercept, so it did not drift as the integrated longitudinal velocity of
velocity_consistency_v5 does. That integral reads −3.09 m/s on HK
Deep-Urban-1 and 48 m/s on HK Medium-Urban-1 at the latch.
- The decision. With at least 4 intervals and a speed-rate spread of at least 0.05 (m/s²)², a slope below −0.5 latched course + 180°.
- Deferred. When the latch had fewer intervals than that, the decision waited for the end of that motion segment (a stop) or 20 s after the latch.
- Once. It was made once; a flip turned the attitude by 180° about up, reset the yaw σ to the latch σ and re-anchored the velocity.
- Which filter. The option applied to the loose ESKF that writes
--out: the independent output filter under--navi776-tc, the main filter otherwise.
Slope of the decision (deferred decisions marked d) and fused --out 3D
p50 / p90 (m), without → with the option, one run each. Flags, lever arms
and the UrbanNav Tokyo --base-ecef are as in the tables above. SmartPNT-POS
Data11 and Data12 use the lever arm of their
holdout.
| Run | --navi776-tc: slope |
--navi776-tc: --out |
No tight coupling: slope | No tight coupling: --out |
|---|---|---|---|---|
| PPC tokyo/run1 | 1.02 d | unchanged | 0.79 d | unchanged |
| PPC tokyo/run2 | 1.04 d | unchanged | 1.12 d | unchanged |
| PPC tokyo/run3 | 0.99 d | unchanged | 0.87 | unchanged |
| PPC nagoya/run1 | −0.88 | 1.46 / 52.6 → 0.21 / 13.8 | −0.81 | 2,044 / 13,274 → 0.23 / 20.2 |
| PPC nagoya/run2 | 0.84 | unchanged | 0.87 | unchanged |
| PPC nagoya/run3 | 0.67 | unchanged | 0.82 | unchanged |
| UrbanNav Odaiba | 0.63 d | unchanged | 0.49 d | unchanged |
| UrbanNav Shinjuku | 0.73 d | unchanged | 0.82 d | unchanged |
| UrbanNav HK Deep-Urban-1 | 1.10 | unchanged | 2.49 | unchanged |
| UrbanNav HK Harsh-Urban-1 | 0.81 | unchanged | 0.88 | unchanged |
| UrbanNav HK Medium-Urban-1 | 0.98 | unchanged | 0.95 | unchanged |
| SmartPNT-POS Data11 | 1.01 | unchanged | 0.98 | unchanged |
| SmartPNT-POS Data12 | 0.90 d | unchanged | 0.92 d | unchanged |
- Unchanged means byte-identical. The
--outstreams are byte-identical without and with the option, and the RTK stream is byte-identical on all 26 runs. - nagoya/run1 flips at the latch in both modes. With the lever arm moved by
2–4 cm (the nine members of the
spread script) it
flips on every member with the same slope.
--outis 0.21 / 13.8 m on every member, against 1.46 / 50.9–53.0 m without the option. - A backward-velocity vote does not work. The alternative was to flip
once, within 120 s of the latch, after the GNSS velocity points backward in
the body frame for 5 s at 2 m/s or more. On nagoya/run1 it flips 18 s after
the latch and makes
--outworse: 21.1 / 4,206 m. - Development data only. All 13 runs are development data, and nagoya/run1 is the only reverse start among them. The first version took 1 s intervals and decided only at the latch; it had too few intervals on nagoya/run1 and the PPC Tokyo and UrbanNav Tokyo runs. The 0.5 s interval and the deferred decision were added after that run, on these data.
- It failed a frozen holdout in both modes (contract, results).
- Data14 reverses out of a parking space, and the check fixed the latch
in both modes:
--out405 / 27,223 m → 0.90 / 21.5 m and 0.62 / 4,301 m → 0.53 / 2.0 m. - A wrong flip in each mode. Data15 (
--navi776-tc) and Data13 (no tight coupling) latch correctly in forward motion. The check then flipped them, with slopes of about −5.- Data15: the intervals behind the decision come from both directions (a slow reverse just before).
- Data13: its IMU file had duplicate records at the start. On the fixed conversion (#699) the slope is 0.74, and the run does not flip.
- Removed. A next version needs different rules and its own holdout on new data: accept a flip only for a slope near −1, and end a segment at a speed minimum. So the option was removed rather than kept as an unused opt-in.
Validation snapshot (PPC Tokyo/Nagoya, --preset low-cost)¶
Scored against the 5 Hz Applanix reference. Representative results:
| Run | Availability (RTK→fused) | H-RMSE (RTK→fused) | Roll/Pitch RMSE | Yaw median err |
|---|---|---|---|---|
| tokyo/run1 | 84.8% → 99.7% | 5.7 m → 7.4 m | 0.5° / 1.9° | 0.9° |
| nagoya/run2 | 76.8% → 99.9% | 6.3 m → 14.2 m | 1.1° / 1.7° | 1.7° |
Fusion trades some average accuracy (IMU dead-reckoning drift during long urban outages) for near-total availability: ~99% of reference epochs get a solution vs 69–92% for RTK alone, with ~94–100% of RTK outage epochs bridged. Fixed-epoch accuracy is not degraded.
The Tokyo/run1 3500-epoch ZUPT A/B confirmed 21 false applications while the last GNSS speed was 0.529–4.014 m/s (tow 187483.0–187491.0). The moving latch is therefore retained for safety, although this short A/B did not improve the trajectory score: gate off/on max bridge was 81.938/102.780 m and fixed-P95 regression was 36.044/36.209 m. This is a safety hardening result, not an accuracy-pass result; the full run1 gate was not opened from this slice.
Known limits: consumer/tactical-grade dead-reckoning drifts tens of meters
through multi-minute outages; vertical error remains weaker than horizontal;
the NIS gate defaults were tuned on PPC data. The reusable Stage-2 core now
lives in fusion/dd_imu_bridge: it accepts a mechanized 15-state INS state,
maintains live DD ambiguity states and cross-covariances, applies joint code and
carrier updates, performs quality-ordered partial LAMBDA, and replaces hard SPP
reseed with a gated soft update/covariance inflation. The opt-in
gnss fuse --tight-dd-imu epoch loop evaluates the existing RTK DD machinery
at the propagated INS position, converts the ECEF Jacobian into the fixed local
ENU frame, and applies the bridge update while reporting row, gate, PAR, and
soft-reset diagnostics. The validation table above predates that opt-in path
and remains loose-coupling evidence only.
A C++20/MSVC real-data integration smoke on the first 50 Tokyo/run1 epochs verified the operational committed-carrier path, but a 600-epoch replay exposed catastrophic carrier-tail instability (p95 above 149 km). The default was therefore changed to safe shadow-carrier evaluation. On the same 600 epochs, baseline versus safe-shadow p50/p95/p99 ECEF error was 1.171/3.480/27.031 m versus 1.123/3.480/30.447 m; 301 epochs used the carrier-to-code fallback, partial AR and soft resets were both zero. This is near-neutral safety evidence, not adoption evidence. The full-six and blocked-span ablation driver used for this comparison was never committed to the repository, so there is no in-tree reproduction script for it.
The complementary RTK-hosted tightly-coupled path is specified in
tight_coupling.md. It keeps baseline, ambiguity, and AR
ownership in RTKProcessor, and feeds opt-in INS propagation and measurement
updates into that existing lifecycle.