Humanoid State Estimation ← back to dashboard

▍ Stage 3 — Online Self-Calibration

camera–IMU extrinsictime offsetJacobians FD-verifiedobservability-honestneck-scan retry

While walking its loop, the robot estimates its own camera-mount rotation online — no calibration rig, only the onboard sensors the VIO already uses. It also carries an FD-verified camera–IMU time-offset state (td), held frozen in the headline demo while the mount calibrates online. Validation: inject a known mount error and recover it. The follow-up below revisits both limits with active calibration: a gentle neck scan, and td unfrozen against a known injected clock offset.

The idea

A real robot's head camera is never mounted exactly where the CAD says, and its frame timestamps are a few ms out of sync with the IMU clock. The classic fix is a calibration rig (wave a checkerboard before deploying). In-situ self-calibration instead has the robot recover those errors itself, while just walking — robust to lifetime drift, no downtime.

The Stage-2 VIO filter is augmented with a camera-mount rotation extrinsic δφ_HC (3) and a time offset td (1); the error state grows 21 → 25, with the calibration states placed before the stochastic clone so cloning stays a clean truncate-then-append. Both enter the existing relative-rotation vision measurement, so no new sensor is needed.

Recovering an injected 3.1° mount error
Inject a 3.1° camera-mount error; the estimator starts from the nominal mount and self-calibrates online. φ_x (⊥ the turn) drives to ~0 with a tight ±3σ funnel; φ_y/φ_z (≈ the turn axis) keep wide funnels — the filter correctly reports what a yaw-loop cannot pin.
Inject a 3.1° camera-mount error; the estimator starts from the nominal mount and self-calibrates online. φ_x (⊥ the turn) drives to ~0 with a tight ±3σ funnel; φ_y/φ_z (≈ the turn axis) keep wide funnels — the filter correctly reports what a yaw-loop cannot pin.
87%
observable axis recovered
φ_x: 26 → −3.4 mrad
1.1 mrad
φ_x funnel σ (confident)
tight, consistent
7 mrad
φ_y funnel σ (uncertain)
honestly wide
~1e-7
Jacobian FD error
all blocks, td=0 & 20ms
The observability structure (the real lesson)

A pure yaw-loop observes only the mount component perpendicular to the turn axis. The component along the yaw axis is nearly invisible per frame (only the gait's ripple excites it), and the time offset is weakly observable too — the loop sits near the constant-angular-rate degeneracy where a common time shift cancels. This isn't a bug: the finite-difference check passes to ~1e-7, and the filter's covariance reports the anisotropy (the φ_y funnel stays ~6× wider than φ_x).

TakeawayA consistent filter recovers what the trajectory makes observable and honestly flags what it cannot — a stronger result than a lucky full recovery. Full 3-axis + time-offset calibration needs richer rotational excitation than a single yaw-loop — which is exactly what the next section goes and buys.
Active calibration — the neck-scan retry

If the yaw-loop cannot excite the weak axes, move the camera: walk.py has a neck-pitch “look-around” scan. This was tried during Stage 3 and hurt — the then-~6 mrad front-end lost KLT tracks under camera pitch. With the front-end sharpened to an honest ~2 mrad (IRLS refit), run_neckscan.py retries it properly: inject the same 3.1° mount error plus a 10 ms camera clock offset, estimate both (td unfrozen), and sweep gentle (amplitude, frequency) scans — measuring the observability gain and the track-quality cost, three seeds on the key points.

Left: what the scan buys — the weak-axis funnel σ φ_y and the time-offset funnel/error. Right: what it costs — front-end success is FLAT across the whole sweep (the Stage-3-era track loss is gone); the cost surfaces in the filter's chi-square gate at the aggressive 0.6 Hz point.
Left: what the scan buys — the weak-axis funnel σ φ_y and the time-offset funnel/error. Right: what it costs — front-end success is FLAT across the whole sweep (the Stage-3-era track loss is gone); the cost surfaces in the filter's chi-square gate at the aggressive 0.6 Hz point.
scan (commanded · achieved)σ φ_y (mrad)φ_y err, median (mrad)σ td (ms)td err, median (ms)front-endgate accept
none (baseline)7.515.50.48+0.677%44%
0.10 rad · 0.30 Hz (≈1.5°)7.06.80.46+1.774%63%
0.35 rad · 0.30 Hz (≈5.3°)4.27.30.38−0.674%66%
0.35 rad · 0.60 Hz (≈4.7°)4.22.70.54+1.774%40%
7.5 → 4.2
σ φ_y, weak axis (mrad)
moderate scan, 0.35 rad · 0.3 Hz
15.5 → 7.3
φ_y error, 3-seed median (mrad)
64% → 83% of the injection recovered
+0.6 ms
td recovered, NO scan
of 10 ms injected · σ 0.5 ms
66% → 40%
gate accept at 0.6 Hz
the new trade-off edge

Three honest findings. (1) The old failure mode is gone: front-end success stays 74–77% at every amplitude and rate tried — the sharpened front-end holds its tracks under pitch, so the Stage-3-era “scanning hurts” conclusion was a front-end artifact, not physics. The cost has moved downstream: past ~0.3 Hz the fusion gate starts rejecting (44→66% acceptance at gentle scans, collapsing to ~40% at 0.6 Hz, with seed-noisy estimates to match — the φ_y median of 2.7 there scatters 0.2–4.9 across seeds). (2) The scan pays on the mount axes: the weak-axis funnel halves (7.5→4.2 mrad), the recovered error halves with it (15.5→7.3 mrad), and φ_z is pinned to ~0.1 mrad. Weak-axis errors sit near 2σ in both cases — mildly optimistic on the hardest axis, unchanged by the scan. (3) A surprise on td: the injected 10 ms clock offset is recovered to +0.6 ms without any scan — the walking gait’s angular-rate ripple already excites it; the constant-rate degeneracy argument applies to the smoothed loop, not to the gait riding on it. Freezing td in the headline demo was conservative, not necessary.

TakeawayActive calibration works once the front-end is good enough to survive it: a moderate look-around (~5° at 0.3 Hz) buys a 2× tighter weak-axis funnel and a 2× better mount estimate at zero front-end cost — and the chi-square gate acceptance rate is the online signal that tells you when you are scanning too hard.