humanoid-asimov / estimator console  SIM ONLINE · UPDATED 2026-07-21

▍HUMANOID STATE ESTIMATION

“Where am I, and how am I moving?” — a monocular-camera + IMU + leg-odometry state estimator for a bipedal humanoid, in MuJoCo, from onboard sensors alone — no motion capture, no lidar, no depth.

New here? Start with ▸ the IMU-101 primer and ▸ the robot & its sensors.

STAGES 0–5 · COMPLETE — ESTIMATOR → VIO → CALIB → NOISE → NAV VIO WINS EVERY SEED ~0.15% vs ~0.49% ESKF · HONEST 2 mrad FRONT-END · NAV 4/4 MuJoCo 3.x Python 3.12 1 camera · 1 IMU · 15 encoders · 2 feet base: Asimov (open-source humanoid)
01 DATAFLOW — SENSING → ESTIMATION packets animate at schematic rates · scrolls sideways on small screens
OURS — code written in this repo ORIGINAL — vendored from the open Asimov platform running building planned ground truth · eval-only future stage
SIM / ROBOT
SENSORS · ONBOARD
ESTIMATOR · COMPUTE
STATE / EVAL

MUJOCO · ASIMOV-1 MODEL

ORIGINALMJCF + STL500 Hz
27 DOF (incl. 2 passive toes) · 32.4 kg
IMU site in pelvis · pelvis @ 0.60 m
external/asimov-1/sim-model/xmls/asimov.xml

SCENE MODS

OURSMjSpec · compile-time
+ head_cam — absent upstream · fovy 70° · 15° down
+ firm foot contact — condim 3→4, µtors 0.1, solref 0.005
+ feature room — walls · panels · pillars · concrete floor — visual-only, stage 2
src/humanoid_asimov/scene.py

LOCOMOTION BLACK BOX

OURSGAIT CSV: ORIGINALPD 500 Hz
PD-tracks the open imitation gait (12 leg joints @ 50 Hz, 1.25 Hz)
+ torso virtual support ≈ 44% BW offload · τ clip 150 N·m
DEV STAND-IN · LOAD-BEARING SUPPORT · NOT TRUE DYNAMIC WALKING — real RL policy = next milestone
src/humanoid_asimov/walk.py · data/walking_1.25Hz_50Hz.csv

IMU — PELVIS

OURSGYRO + ACCEL500 Hz
σg 1e-3 rad/s · σa 1.5e-2 m/s²
+ bias random walk (LSM6DSOX-scale)
sensors.py · imu() + ImuNoise

JOINT ENCODERS

OURS×15q · q̇
12 leg + waist + 2 neck
passive toes / sprung arms excluded
sensors.py · ESTIMATOR_JOINTS

FOOT CONTACT

OURSL / RFz
flags + normal force · thresh 1 N
duty ≈ 50/50 · alternates @ 1.25 Hz
sensors.py · contacts()

HEAD CAMERA

OURS · ADDEDMONO · 30 Hz✓ STAGE 2 — LIVE
forward + 15° down · fovy 70°
fx ≈ 343 px @ 640×480 · KLT front-end → anchored rel-rotation R̃
scene.py · head_cam — consumed by vision.py

GROUND-TRUTH TAP

base pose · vel · quat · foot pos — sim oracle.
Never fed to the estimator.
sensors.py · *_gt()

STATE ESTIMATOR▸ estimator deep dive

OURS✓ STAGES 1–4 — LANDEDFD-VERIFIED
IMU strapdown predictR · v · p @ 500 Hz + full covariance (F, Q)
leg odometrycontact foot anchor → FK · no-slip velocity measurement
▼
error-state EKF · 18-dimp · v · R · bg · ba + slip bias bc — update on contact
visual rel-rotation · stage 2 ✓anchored SO(3) update on a cloned rotation (18→21) — observes yaw drift + bg,z ▸ vio ▸ front-end
online auto-calibration · stage 3 ✓camera-mount extrinsic δφHC recovered online (21→25) — a gentle neck scan (3b) halves the weak axis; td unfrozen recovers a 10 ms offset to +0.6 ms ▸ calib
delay compensation · stage 4b ✓StampedStream + ReplayFilter: stamped late measurements fuse at their stamp, buffered IMU replays forward — 15 ms latency 6.46→0.23% ▸ timing
src/humanoid_asimov/{estimator,vision,vio,calib}.py · scripts/run_vio.py · run_calib.py

ESTIMATED STATE

OURS6-DoF + biases
base pose p, R · velocity v · biases bg, ba, bc
@ 500 Hz — from onboard sensors only
loop drift 0.15% w/ vision (5-seed median) · vel RMSE 0.045 m/s
stage-2 output · vio.py

EVAL vs GROUND TRUTH

OURSGT · eval-only
ATE / loop close-gap · NEES / NIS consistency (M=10)
24 s loop (5-seed median): VIO 0.15% · ESKF 0.49% · honest 2 mrad front-end
bg,z err 0.19 mrad/s (5-seed median) — unobservable w/o vision
docs/STAGE2_VIO_DESIGN.md · scripts/run_vio.py · run_nees.py
⚠ locomotion honesty — the walking that feeds these sensors is a development stand-in: a PD-tracked open imitation gait plus a torso “virtual support” that permanently offloads ~44% of body weight and holds the torso upright (without it the open-loop gait topples at t ≈ 0.74 s). This is not true dynamic walking — it exists only to produce self-consistent IMU / encoder / contact data + ground truth for estimator development. The estimator never sees the gait targets, the support wrench, or the ground truth. The real RL locomotion policy is the designated next-milestone upgrade. Related: the foot-contact flag is derived from the physics engine's contact force (>1 N threshold) — this robot carries no foot-force sensor, so real hardware needs a contact detector (motor current / joint torque); the estimator consumes a clean boolean, so that swap is interface-compatible.
02 LIVE TELEMETRY — REAL LOGGED DATA replay t+0.00 s / 3.20 s loop · walk_dataset.npz · window t = 1.20–4.40 s · 4 gait cycles

SENSING LAYOUT schematic · not to scale

0.60 m L R
  • ● head_cam — monocular · fovy 70° · +15° down (ours)
  • ◉ IMU — pelvis site · gyro + accel @ 500 Hz
  • ○ encoders ×15 — hips · knees · ankles · waist · neck
  • ▬ foot contact — L/R pads light with the replay

IMU · GYRO rad/s—

pelvis frame · noisy (σ 1e-3 + bias RW) · z swings with each step yaw

IMU · ACCEL m/s²—

specific force · z rides gravity ≈ +9.81 · spikes ≈ 60 m/s² = heel strikes

FOOT CONTACT L / R—

flags @ thresh 1 N · alternating stance @ 1.25 Hz · the leg-odometry anchor signal

BASE HEIGHT mGT · eval-only—

ground-truth pelvis z · bobs ~2 cm about 0.616 m · nominal Z = 0.60 m
03 ROADMAP — NAIL EACH STAGE BEFORE THE NEXT docs/DESIGN.md · staged plan
  1. STAGE 0✅ DONE
    Sim Harness
    Asimov in MuJoCo · head cam added · sensors exposed · gait black box · GT logging
    ▸ robot + sensors ▸ IMU 101 primer
  2. STAGE 0.5✅ DONE
    Hardening
    contact fix · logger alignment · sensor split · IMU noise · dataset schema · pytest
  3. STAGE 1✅ DONE
    Contact-Aided ESKF
    18-dim error-state EKF: IMU predict + no-slip update + online bg·ba·bc · drift 0.32% · math FD-verified
    ▸ estimator deep dive
  4. STAGE 2✅ DONE
    Monocular VIO
    anchored rel-rotation from head_cam, IRLS-refit front-end (honest ~2 mrad) — observes yaw drift + bg,z · beats ESKF every seed (~0.15% vs ~0.49%)
    ▸ vio deep dive ▸ front-end
  5. STAGE 3✅ DONE
    Online Auto-Calib
    camera-mount extrinsic δφHC recovered online (state 21→25; the camera–IMU time-offset td is carried but stays frozen — this constant-rate loop can't excite it) · recovers an injected 3.1° mount error 87% on the observable axis · Jacobians FD-verified · covariance is observability-honest
    ▸ calibration deep dive
  6. STAGE 3B✅ DONE
    Active Calibration
    gentle neck-scan (~5° · 0.3 Hz) while walking, mount + td unfrozen vs injected 3.1° + 10 ms errors · weak-axis funnel σ 7.5→4.2 mrad, error 15.5→7.3 · td recovered to +0.6 ms with NO scan — the gait ripple already excites it · front-end survives the scan (74–77% flat)
    ▸ calibration deep dive
  7. STAGE 4✅ DONE
    Sim-to-Real Noise
    embedded pipeline: quantization · CAN stagger · latency · jitter · finding: TIMING dominates (latency 5 ms → 2.04% drift), amplitude negligible
    ▸ sim-to-real deep dive
  8. STAGE 4B✅ DONE
    Delay Compensation
    source capture timestamps + buffer-and-replay fusion (timing.py): late measurements fuse at their stamp and replay forward · 15 ms latency 6.46→0.23% drift · position NEES 26→2.5 (confidently-wrong → honest) · flat to 20 ms · zero delay reduces bit-for-bit to the naive loop
    ▸ sim-to-real deep dive
  9. STAGE 5✅ DONE
    Nav Slice
    waypoint planner → VelocityCommand(vx, vy, vyaw) on the estimated state · reaches 4/4 waypoints closed-loop · 7.1 cm / 0.59% from truth
    ▸ navigation deep dive
  10. STAGE 5B✅ DONE
    Closed-Loop Showdown
    the same 3-circuit course under four estimator configs, all steering on their own estimate · replay-compensated 5 ms latency restores the clean numbers (terminal yaw 5.7°→3.7°) · the decisive failure is contact over-trust, not latency: σc=0.05 finishes 10/12 @ 98° yaw — in-loop VIO rescues it to 12/12 @ 17°
    ▸ navigation deep dive
04 MEASURED NUMBERS docs/STAGE2_VIO_DESIGN.md · docs/STAGE1_ESKF_REVIEW.md · run_vio.py · walk_dataset.npz · model
0.15 %
VIO loop drift (5-seed median) — honest 2 mrad
beats ESKF ~0.49% on every seed · IRLS-refit front-end · pins bg,z · stage 2
0.19 mrad/s
bg,z error w/ vision (5-seed median) — was 1.66 blind
provably unobservable from IMU+contact · run_vio.py sweep
~2 mrad
front-end rotation accuracy · median (IRLS refit)
2.06 mrad · ~34 SO(3) meas/lap · run_frontend.py
7.5→4.2 mrad
weak-axis funnel σ with a ~5° neck scan
mount error 15.5→7.3 mrad · zero front-end cost · stage 3b · run_neckscan.py
+0.6 ms
td recovered from a 10 ms injected clock offset — no scan needed
σ 0.5 ms · the gait ripple excites it · stage 3b
6.46→0.23 %
drift at 15 ms latency · naive → replay-compensated
flat to 20 ms · 3-seed medians hold 0.23–0.24% · stage 4b · run_timing.py
26→2.5
position NEES at 15 ms latency — honesty restored
clean is 2.7 · confidently-wrong → calibrated · stage 4b
12/12
waypoints · 3-circuit closed loop, replay-compensated 5 ms latency
ties clean (yaw 3.7° vs naive 5.7°) · contact over-trust is what breaks it, not latency · stage 5b · run_nav5b.py
0.32 %
ESKF drift · straight walk · stage 1
1.8 cm / 5.8 m · beats 0.54% dead reckoning
+0.11 mrad/s
gyro-bias y error — was +2.53
slip bias bc de-biased it · run_nees.py
0.03 %
leg-odom drift floor · true attitude
the attitude gap stages 1–2 closed in on
0.045 m/s
ESKF velocity RMSE (stage 1)
the fused deliverable · run_estimator.py
M=10
seeds · NEES/NIS consistency harness
per-block ANEES + NIS whiteness · caught the slip
~1e-7
FD check — every Jacobian verified
stage-1 blocks · VIO fusion H to ~1e-10
0.56 m/s
sustained walk speed
10–12 s runs · STAGE0_REVIEW
44 % BW
offloaded by torso support (crane)
load-bearing dev stand-in · falls @ 0.74 s without
~7 mm
foot slip per stance
the stage-1 culprit — now estimated online as bc
27 DOF
articulated joints (incl. 2 passive toes)
+ 6-DoF floating base · model
15
estimator-visible encoders
12 leg + waist + 2 neck · sensors.py
500 Hz
physics + IMU rate
dt = 2 ms · model.opt
1.25 Hz
gait frequency
0.8 s cycle · gait CSV
32.4 kg
total robot mass
Σ body_mass · model
05 WHAT EXISTS TODAY · WHAT'S NEXT

BUILT — STAGES 0 → 5

  • ✓ scene.py — head camera via MjSpec (absent upstream) + firm foot contacts + visual-only feature room
  • ✓ walk.py — PD gait black box + support · post-step-aligned logger · loop_heading (24 s / 360° lap)
  • ✓ sensors.py — estimator-visible vs eval-only split + LSM6DSOX-scale ImuNoise
  • ✓ estimator.py — 18-dim contact-aided ESKF: strapdown + no-slip update + online bg·ba·bc
  • ✓ vision.py — KLT front-end: bucketed corners · FB-checked tracks · anchored essential-matrix rotation (IRLS-refit)
  • ✓ vio.py — VioESKF: stochastic clone (18→21) + gauge-safe SO(3) update · χ²(3) gate
  • ✓ calib.py — CalibVioESKF: mount extrinsic δφHC + time offset td (21→25), FD-verified
  • ✓ embedded.py — quantization · CAN stagger · latency · jitter noise model + ablation
  • ✓ timing.py — StampedStream + ReplayFilter: buffer-and-replay fusion of stamped delayed measurements (zero delay ⇒ bit-identical to naive)
  • ✓ nav.py — WaypointNavigator → VelocityCommand(vx, vy, vyaw) closed-loop
  • ✓ scripts/ — run_estimator · run_nees (M=10) · run_frontend · run_vio (+ multilap) · run_calib · run_neckscan · run_embedded · run_timing · run_nav · run_nav5b · run_livedrift · check_eskf/vio/calib_jacobian
  • ✓ tests/ — pytest: head_cam present · walks ≥1.5 m/4 s upright, no NaNs · log schema

DATASET — walk_dataset.npz

4000 samples · 8 s @ 500 Hz · settle 1.5 s trimmed · IMU noise ON · seed 0
estimator-visible  t · gyro(3) · accel(3) · enc_q(15) · enc_qd(15) · contact(2) · contact_force(2)
eval-only GT  gt_pos(3) · gt_quat(4) · gt_linvel(3) · gt_angvel(3)
meta  joint_names(15) · frame_t

Self-consistent: sensors + GT logged from the same post-step state (mj_forward after mj_step) — protects Stage-3 td calibration.

+ loop_tracks.npz  stage-2 front-end persistence — per-keyframe track ids · uv · bearings + per-pair R̃ · inliers (tracks, not frames: 720 frames ≈ 660 MB stay out).

NEXT — BEYOND THE ARC

  • ▸ swap the dev gait for the released RL locomotion policy on the same harness — first casualties: σcontact, slip-bias magnitude (re-measure; Stage-4 order: timestamps first)
  • ▸ extend the NEES/NIS harness to the vision path (VioESKF/CalibVioESKF) — the stated next validation task
  • ▸ reprojection layer to reach the mount translation pHC (per-keyframe bearings already persisted) — rotation + td landed in 3b
  • ▸ motion-scaled σcontact (turn-rate-aware Rc) — formalize the stage-2 turn-slip lesson
  • ▸ (parked) stage 1.5 InEKF rebuild — colored contact NIS carried, unchanged by vision
  • ▸ anchor → keyframe map: loop-closure relocalization for an absolute-yaw bound