§ PERTURBATION
Robustness, the first closed-loop behavior: shove the fly mid-stride and watch a controller that feels its own body steer back on course where an open-loop one walks off crooked.
Same shove, both controllers
One calibrated lateral shove (magnitude 6), fired mid-stride at the identical moment on both controllers. The open-loop v1 fly takes the hit and keeps walking its fixed rhythm — now pointed the wrong way. The closed-loop fly feels the disturbance in its own joint angles and foot contacts and steers back toward its original heading.
How well does it hold course?
There's no destination here. On course just means the heading the fly was already walking before it got shoved — the task is heading retention(keep going the same way), not reaching a place. So “how well is it doing” is the gap between where it ends up pointed and that original line. The scorecard below makes that explicit: it grades both controllers on the three things the reward actually rewards — hold your heading, stay upright, and keep making forward progress.
the objective — scored on the actual reward, not the picture
Shove it yourself
The real closed loop, in your browser: one live MuJoCo fly, a toggle between the two controllers, and a shove button. The closed-loop controller reads 42 joint angles + 6 foot contacts back out of the live sim every control step — no recording. Toggle to v1 and shove again to feel the difference.
The trained controller walking the real fly, live — and reading its own body back every control step (42 joint angles + 6 foot contacts). Shove it and watch it steer back toward its heading.
live MuJoCo · the closed loop reads proprioception from the sim each step · loading controllers… — the side-by-side recorded clips above show both under the identical shove.
What proprioception feeds in
The new sense this behavior adds, exactly as the trained controller uses it: 42 joint angles on the motor block and 6 foot contacts on the bottom row, two extra input channels written fresh from the body each step. Both come straight out of the physics engine, not from a sensor model bolted on top:
The joint angles are MuJoCo's actuator_length — the current length of each of the 42 leg actuators, which is the joint angle the motor spans — read out of the live sim each control step (sim.actuatorLengths()) and normalized θ/3.14 so it lands in roughly [−1, 1]. The foot contactsare a boolean per leg from the sim's contact detection (sim.footContacts()): 1 when that leg's tarsus is touching the ground, 0when it's in swing. So a shove changes the numbers the controller sees the instant it lands a leg wrong or twists a joint — that's the signal it steers on.
conv1 input channels, the placement pinned by the trained closed_loop_controller.json. The recurrent state stays 4 channels; zero these two and the rule is open-loop again.What it senses
Proprioception. The 42 actuated joint angles (normalized θ/3.14) laid topographically onto the motor block, plus 6 per-leg foot contacts on the bottom row — two extra conv1 input channels written back into the 8×8grid each control step. With them zeroed the rule is a plain open-loop NCA; closing the loop is this behavior's whole addition. See how it routes in the Sensing tab.
The reward
Hold heading through a shove.A lateral impulse hits mid-stride; fitness rewards keeping the thorax up and the heading steady through the disturbance and back to a stable gait, averaged over many shoves — not raw forward distance. (The closed-loop fitness scalar isn't comparable to v1's — it's a different objective; the fair comparison is the open-vs-closed table below.)
The result
Course correction. After a magnitude-6 shove the open loop ends a mean 56.6° off heading; the closed loop holds to 26.5° — roughly half the error — while making more forward progress (24.3 vs 20.8 mm post-shove). On the headline single shove, open ends 97° off, closed holds 19°. At this magnitude neither fly falls (both 100% upright) — so this is disturbance rejection / staying on course, not catching a fall. Fall-recovery would need a harsher regime or uneven ground (future work).
Connectome link
Real flies are saturated with proprioceptors— campaniform sensilla (cuticular strain), hair plates (joint position), chordotonal organs (stretch and vibration) — streaming continuous body state into the VNC. Robust walking leans on exactly this feedback. It's the closed-loop rung on the Embodied ladder, between the null model and the real connectome.
The math behind this — equations and constants — is in the appendix.