‹ DASHBOARD/ state estimator / deep dive STAGE 1 LANDED · UPDATED 2026-07-09
▍STATE ESTIMATOR · DEEP DIVE
Stage 1 — contact-aided error-state EKF · landed.
IMU strapdown + no-slip contact updates + online bias estimation, fused at 500 Hz from
onboard sensors alone. Built and math-verified — then its own NEES/NIS harness caught it
inconsistent, the diagnosis found a planted foot that isn't quite still, and an online
slip-velocity bias fixed it: drift 0.73 % → 0.32 %. This page is that arc.
01 THE FILTER — CONTACT-AIDED ERROR-STATE EKF src/humanoid_asimov/estimator.py · all three blocks landed · docs/STAGE1_ESKF_REVIEW.md
PREDICT — IMU STRAPDOWN
✓ BUILTGYRO + ACCEL500 Hz
gyro drives attitude: R ← R · exp((ω̂−bg) dt)
accel − bias − gravity integrates v, p
biases modeled as random walks ·Q matched to the injected
LSM6DSOX-scale noise
covariance grows between contacts — the update earns it back
the nominal state integrates nonlinearly; the filter tracks only the small error δx —
linearization stays honest. Every Jacobian — F, contact-H, gravity-H, the injection,
the Joseph form — is finite-difference checked (~1e-7).
bc is the slip-velocity bias the consistency arc (03) forced into the state.
estimator.py — eskf · 15-dim → 18-dim after the fix
◂
UPDATE — CONTACT VELOCITY
✓ BUILTCONTACT ANCHORFK
a planted foot is almost still — its world velocity is modeled as vfoot = R · bc (not exactly 0)
FK from the 15 encoders puts the foot in the base frame
fires on stance · makes tilt + bg observable —
bc soaks up the systematic
the stance flag itself is derived from the engine's contact force (>1 N) — this robot has no foot sensor, so real hardware needs a contact detector (motor current / joint torque); the filter consumes a clean boolean, an interface-compatible swap
ⓘ design note — FK from encoders, not sim state — RobotKinematics loads the robot
model purely as an FK engine: base pinned at the origin with identity orientation, the 15
measured encoder angles written in, foot-site positions read out — which, with an identity base,
are the foot positions in the base frame. That is the robot's known kinematics
(the same computation it would run on hardware), not a read of sim ground truth —
kinematics only, physics never stepped.
02 ACT 1 · THE BACKBONE — LEG-ODOMETRY DEAD RECKONING scripts/run_estimator.py · offline replay over the full 8 s log
Leg odometry is run open-loop (no filter yet) to validate the measurement backbone before
any fusion. Attitude R is supplied two ways: true attitude from the GT quaternion —
isolating the translational drift floor of the anchor + FK chain itself — and
gyro-integrated attitude (R ← R·exp(ω̂ dt) from the noisy gyro) — what dead reckoning
really looks like with no filter. Same encoders, same contacts, same code path either way.
8 s walk, +x with a slow −y drift · cyan hugs the grey GT so closely they overlap · amber peels off as gyro attitude drifts · click plot to replay sweep
HORIZONTAL ERROR vs TIME cm—
cyan sawtooth = creeps within a stance, resets on every re-anchor — bounded, never accumulates · amber = attitude error compounding into translation · click plot to replay
⚑ the insight — translation is already drift-free; attitude is the whole game —
with true attitude the error is a bounded sawtooth: it creeps ≈ 0.4 cm during a stance
(foot micro-slip) and resets on every re-anchor — after 5.8 m it has accumulated
essentially nothing (0.03 % drift). Swap in gyro-integrated attitude and the same
pipeline climbs near-linearly to 3.2 cm (0.54 %) — every millimetre of that gap is attitude
error leaking through the kinematic chain. That is the error budget the ESKF plays for:
accelerometer gravity levels roll/pitch and contact makes bg observable —
but yaw about gravity stays unobservable from IMU + contact alone, a floor the arc below
runs straight into. The measurement backbone is validated — act 2 fuses it.
SCORES — vs GROUND TRUTH horizontal (x-y) · full 8 s
variant
attitude source
ATE (xy)
final err
drift · of 5.8 m path
leg-odom · true attitude
GT quaternion — floor isolation
0.4 cm
0.2 cm
0.03 %
leg-odom · gyro attitude
∫ noisy gyro — realistic, no filter
1.9 cm
3.2 cm
0.54 %
ATE = RMSE of horizontal error over the run · drift = final error / 5.80 m path ·
the 1.4 % dead-reckoning floor was budgeted up front — both variants come in well under it ·
the fused-ESKF rows join the drift ladder in 03
The ESKF landed in four beats. It ran with verified-correct math — and still drifted
more than raw dead reckoning. A NEES/NIS consistency harness said why that smelled: the
covariance was lying. The trail led to a contact assumption that is almost — but not
exactly — true, and the fix was to make the filter estimate the lie.
ACT 2 · FUSE✓ RAN
15-STATE ESKF — CORRECT MATH
FD-VERIFIEDDRIFT 0.73 %
strapdown predict + no-slip contact update + online bg, ba.
Velocity RMSE ~0.045 m/s — the deliverable a nav stack consumes. But drift lands at
0.73 %, behind the 0.54 % dead reckoning it should beat: the ESKF fuses at the
velocity level (position = ∫v̂), so any contact systematic random-walks the position.
correct math ≠ consistent filter — so interrogate the covariance, not just the error
▸
ACT 3 · CHECK✗ FAIL
NEES / NIS — THE FILTER LIES
M = 10 SEEDSINCONSISTENT
per-block NEES: velocity optimistic (ANEES 6.8 vs dof 3) while tilt/yaw sit
conservative — and the lumped 15-dof NEES ≈ 16.6 reads as a false pass (opposite
failures cancel). The contact-innovation NIS is non-white: lag-1 autocorrelation
+0.80.
the smoking gun — white residuals don't remember themselves; +0.8 means a systematic, not noise
▸
ACT 4 · DIAGNOSE⌖ FOUND
THE PLANTED FOOT ISN'T STILL
CONTACT GEOMETRY0.61 m LEVER
the stance ankle site sits ~9 mm above ground and the foot rolls about a moving
contact point — its true velocity is a systematic ~[−4, ±3, −7] mm/s, not zero.
Via the 0.61 m lever arm it leaks into the gyro bias — bg y corrupted by
+2.53 mrad/s (sign-flipped!) — and drives a hidden ~4 cm z drift.
tuning can't absorb a bias — matching Q to the injected noise only makes the covariance optimistic (a tight P can't explain a biased residual). fix the model, not the tuning.
▸
ACT 5 · FIX✓ LANDED
ESTIMATE THE SLIP ONLINE
+3 STATES → 18-DIMDRIFT 0.32 %
add a slip-velocity bias bc to the state and model the planted foot as
vfoot = R·bc, estimated online. Learned
bc ≈ [−5, +4, +13] mm/s — matching the predicted slip.
bg y: +2.53 → +0.11 mrad/s · drift 0.73 → 0.32 % — now beats
the 0.54 % baseline · z-err 4.1 → 3.4 cm.
the filter now estimates the systematic instead of eating it into bg
THE DEFECT — STANCE-FOOT GEOMETRY side view · not to scale
the "zero-velocity" point isn't — it rides ~9 mm up and rolls through every stance · the residual it leaves is correlated, hence the +0.8 NIS autocorrelation
DRIFT — % OF THE 5.8 m PATH final error / path length
the fused 18-dim ESKF is the first variant to beat the dead-reckoning baseline · the 0.03 % kinematic floor is what stage-2 VIO played for — loop drift is now ~0.15 % (5-seed median) ▸ vio deep dive
GYRO-BIAS ERROR — BEFORE / AFTER THE SLIP FIX mrad/s · vs true bias
the contact systematic had been billed to the gyro bias — the slip-bias state absorbs it and bg comes back honest on all three axes
0.32 %
ESKF drift · 18-dim + slip bias
final 1.8 cm / 5.8 m · beats 0.54 % DR baseline
+0.11 mrad/s
b_g y error — was +2.53 (−96 %)
full b_g err [+0.08, +0.11, −0.15] · run_nees.py
0.045 m/s
velocity RMSE — the fused deliverable
what a nav stack actually consumes
3.4 cm
z error — was 4.1, and hidden
surfaced by adding 3D-ATE + z to the metrics
~1e-7
max finite-difference error · every Jacobian
F · contact-H · gravity-H · injection · Joseph
+0.85
NIS lag-1 autocorr — still colored
the honest caveat · see 04 → stage 1.5
FULL RUN — ESKF vs GROUND TRUTH renders/stage1_eskf.png · run_estimator.py
left — every variant hugs the GT track at plot scale · mid — the ESKF error breathes with each stance about a bounded band (velocity-level fusion; the early spike is filter convergence) and ends at 1.8 cm while gyro dead reckoning climbs away · right — the online bg estimate settling once bc takes the slip
CONSISTENCY — PER-BLOCK NEES · BEFORE → AFTER renders/stage1_nees.png · run_nees.py · M=10
six error blocks (pos · vel · tilt · yaw · bg · ba) across M=10 seeds, log scale · shaded = χ² consistency band · the per-block split is what exposed the optimistic velocity behind the lumped false pass — and why blocks stay out of band while the residual stays colored (04)
04 KNOWN LIMITS → WHAT'S NEXT say what's still not right · docs/STAGE1_ESKF_REVIEW.md
⚠ honest residuals — the slip-bias fix buys the point estimate, not the covariance — drift and
bg get much better, but the reported uncertainty is optimistic: the contact NIS runs
hot (mean ~6.3, median ~1.2 — not the ~3 a white dof-3 residual gives) and its lag-1
autocorrelation is +0.85: the within-stance error is
correlated (the contact point rolls heel→toe through every stance) and the lateral slip
flips sign per foot. A single shared bc can't track that — and a per-foot
bc was tried and diverges: each foot is observed only ~half the time, so its
fore-aft component aliases with base velocity. A diagonal-Q EKF fundamentally
cannot model colored noise, and no Q/R tuning whitens it: matching Q to the injected noise instead drives the covariance optimistic across the board (per-block ANEES — velocity, tilt and both bias blocks all out of band; lumped 15-dof ANEES ~615). The
principled fix is structural: a right-invariant EKF with foot-position contact states —
position-level contact + trajectory-independent Jacobians → a whitened residual and an honest
covariance. That is Stage 1.5 — now parked: Stage 2 went first because the drift was
yaw-limited, and its vision update is gauge-safe by construction, adding no spurious information —
the contact residual is carried, untouched.
⚑ the through-line — horizontal drift is yaw-limited — attitude error explains 85 % of
the ESKF's translation error (corr 0.998); final yaw error 6.5 mrad ≈ raw gyro integration's 6.8 mrad;
and bg z is provably unlearnable here by any filter — yaw-about-gravity +
absolute position are the classic unobservable subspace of IMU + contact. The remaining drift is not a
bug to tune away; it is missing information. That is exactly what Stage 2 — monocular
VIO added: the head camera measures the yaw drift, and the missing states snapped in.
Landed — on a 24 s closed loop with 360° of yaw, over 5 seeds: VIO ~0.15 % vs ESKF ~0.49 % median, and
bg z — unlearnable on this page — pinned to ≤0.42 mrad/s on every seed (median 0.19, vs ~1.7 blind)▸ the stage-2 deep dive
STEP 1✅ DONE
Leg-Odom Backbone
contact anchor + FK · 0.03 % floor vs 0.54 % gyro DR — attitude is the error source
STEP 2✅ DONE
Strapdown Predict
R · v · p @ 500 Hz + full covariance propagation · Q matched to the injected noise
STEP 3✅ DONE
ESKF Fuse + Slip Bias
contact-velocity update + online bg · ba · bc → drift 0.32 % · bg honest
STEP 4✅ DONE
NEES/NIS Harness
M=10 per-block ANEES + NIS whiteness · caught the false pass, then the slip systematic
STAGE 1.5◌ PARKED
Right-InEKF
foot-position contact states → white residual + honest covariance · parked behind stage 2 — colored contact NIS carried
STAGE 2✅ DONE
Monocular VIO
anchored relative rotation from head_cam — yaw drift observed · loop drift ~0.15 % median · bg,z ≤0.42 mrad/s
stage-1 verdict — the estimate is the deliverable and it landed: drift 0.32 %,
bg honest, velocity RMSE 0.045 m/s, math FD-verified · covariance consistency is the
carried item → stage 1.5 (parked — stage 2's vision update is gauge-safe by construction) · the exit
bar stays: bounded drift + NEES/NIS-consistent covariance over ≥60 s including turns · stage 2 has
since landed on a 24 s loop ▸ vio deep dive