Learn / Practice
MuJoCo observation loss: zero force is not a stop
EMBODIED-AI / EXPLORE · Engineering cases
Compare stale feedback, zero force and fading in 27 episodes to distinguish timeout from physical braking.
What was published after this article?
The original conclusions and next-step proposals are retained. These published follow-ups do not imply that every limitation has been resolved.
Related content
- Engineering cases
MuJoCo braking after observation loss: when has the slider stopped?
405 paired simulations test braking from local velocity feedback and track whether the slider stays below the speed threshold.
- Engineering cases
MuJoCo mass transfer: can the same gains still work?
Compare fixed and mass-scaled gains in 36 episodes, including lower mean error without a velocity-contract pass.
On this page 7
Reproduce from a clean checkout · this article’s revision
Windows PowerShell with Python 3.12. Copy and run the whole block. Clone, checkout, installation or execution failures stop the block before auditing the wrong revision. Use a new directory: each article pins its own revision, and the first revision does not contain later experiments.
& {
$ErrorActionPreference = 'Stop'
function Assert-StudyCommand {
if ($LASTEXITCODE -ne 0) { throw "Command failed ($LASTEXITCODE). Read the error before continuing." }
}
if (Test-Path -LiteralPath 'hohoo-embodied-agent-study-1d1faab5') { throw 'Study directory already exists. Choose a new location.' }
git clone https://github.com/VirtualSelect/hohoo-embodied-agent.git 'hohoo-embodied-agent-study-1d1faab5'; Assert-StudyCommand
Set-Location -LiteralPath 'hohoo-embodied-agent-study-1d1faab5'
git checkout --detach 1d1faab57e20b352761e9abc736c6d277b505e6b; Assert-StudyCommand
python -m venv .venv; Assert-StudyCommand
$py = '.\.venv\Scripts\python.exe'
& $py -m pip install -r requirements-lock.txt; Assert-StudyCommand
& $py experiments/planar_reliability/run.py --out outputs/my-run; Assert-StudyCommand
& $py experiments/planar_reliability/audit.py outputs/my-run; Assert-StudyCommand
}Expect raw trajectories, summaries and audit results. The study directory includes the revision; an existing directory stops setup without replacing it. Adjacent articles may share a runner; check the article before rerunning. No model calls are made. Video replay is separate. For later manual commands, specify the interpreter in .venv again: the block-local $py variable is not retained.
Troubleshooting: a missing experiment directory usually means the wrong revision; import failures require checking the interpreter and environment. OpenGL errors concern rendering steps. On Linux/macOS use .venv/bin/python; those platforms have not been retested.
Inspect the pinned code ↗
Correction published · 2026-11-13. Pinned source and run instructions are now available. Statements below about a local branch or unpublished code describe the 2026-11-12 review snapshot. Historical checkout commands still reproduce the original archive, not this correction. From the companion repository root, run
git checkout 335e756bb7e86ded9128b7c9b978636a4069fa61, then follow the linked directory README and use a new output directory. Historical results and AI-assistance disclosures are unchanged.
Pinned code · Archived evidence · Study protocol
Communication stops while the controller continues using its last position and velocity estimate. Does commanding zero force constitute a safe stop? In this frictionless planar model, zero force means no further acceleration, not zero velocity.
Using the development-selected parameters, this experiment compares three stale-observation policies. MuJoCo advances every physical state; nothing teleports the actuator or clears its velocity to manufacture a stop.
Two follow-up studies in the same scene measure stopping distance and time with active braking, then test what happens when local velocity arrives late, carries noise, or goes missing. Local velocity feedback follow-up
Which clock detects staleness?
Each sample carries capture time and becomes usable only after arrival. Age is decision time minus capture time. Reusing the same sample cannot refresh its age.
sample -> 40 ms delay queue -> arrived observation -> estimate/control
|
now minus capture timeDelay is 40 ms, position noise 3 mm, control period 20 ms and physics step 2 ms. Policies activate strictly above 100 ms; the exact boundary remains normal control. Conditions are normal delivery, dropped captures from 0.4 to 1.0 seconds, and permanent loss after 0.4 seconds. Three seeds, conditions and policies give 27 episodes.
Noise is drawn even for dropped samples, then discarded. This preserves matching random-number consumption across policies and dropout conditions.
Three policies change different commands
| Policy | Age at most 100 ms | Older observation |
|---|---|---|
| hold | PD and force clipping | Continue PD from last observation |
| zero | PD and force clipping | Command zero force |
| fade | PD and force clipping | Fade clipped force until observation age reaches 200 ms |
The 200 ms is still measured from sample capture, not another 200 ms after detecting staleness. Above age 100 ms, multiply clipped force by max(0, (0.200-age)/0.100): the fading interval is ages 100–200 ms. Floating-point arithmetic can leave a residual around 1e-15 N at the boundary; use a tolerance rather than fx == 0 to locate fade's endpoint.
Hold does not hold the current physical position: it keeps a stale control computation. The actuator moves while the observed error remains fixed, potentially driving sustained acceleration.
Zero and fade are not closed-loop braking. They add no fresh speed information, friction or brake model. The implementation never clears qvel to obtain a stationary picture.
Temporary loss and permanent loss differ
The following values average final-300ms position RMS over three seeds, in millimetres:
| Communication | hold | zero | fade |
|---|---|---|---|
| Normal | 2.04 | 2.04 | 2.04 |
| Burst loss, 0.4–1.0 s | 2.02 | 2.06 | 2.05 |
| Permanent loss after 0.4 s | 16,025.96 | 2,748.98 | 2,370.92 |
Normal results match because age never triggers the policies. After temporary loss, new observations allow low terminal position error again; terminal averages do not describe the intermediate path.
With permanent loss, hold keeps pushing, zero permits momentum-driven coasting, and fade changes force withdrawal without guaranteeing braking. None of the 27 episodes passes the full position-and-speed contract, including normal episodes with small position error. There is no safety winner in this table.
Why retain such a simple counterexample?
Sending a zero command, stopping controller software, entering actuator braking mode and confirming a stationary object are different events. Verifying only the first cannot justify the fourth. Hardware systems also require actuator semantics, watchdogs, gravity/contact handling, brakes and appropriate safety validation; none is present here.
The 100/200 ms thresholds are teaching parameters, not safety standards. Mass, initial velocity, target and failure phase alter displacement. Testing one loss onset cannot establish a worst-case stopping distance.
Read the trace
Do not search the entire trace for its first zero force: before the first observation arrives, both force and velocity are already zero. Select permanent loss under the zero policy, then find the first control row with a valid captured sample whose age exceeds the limit, and only then inspect force and velocity.
Archived trace 111.csv.gz records 2,000 physics steps for permanent loss with seed 73. The panels below share one simulation clock and show 340–620 ms. Each dot in the top panel is a sample-age check on a 20 ms control tick. The force in the middle panel takes effect at the start of a physics step; velocity in the bottom panel is recorded at the end of that step, at CSV time t. The last sample was captured at 380 ms and reached the controller at 420 ms.
To redraw the figure, check out the companion repository at the revision in the reproduction section below. Run this command from the blog repository, with both checkouts in the same parent directory. The plots use Matplotlib 3.10.8 and a CJK font such as Noto Sans CJK SC. The script checks the archive hashes before generating the three SVGs from the original CSV.
python scripts/research/plot-stale-force-clock.py ../hohoo-embodied-agent-study/evidence/planar-reliability-20261011 --out figuresRun this read-only Python 3.12 snippet from the article's pinned repository root. It needs neither MuJoCo nor a new simulation:
import csv
import gzip
import json
from pathlib import Path
root = Path("evidence/planar-reliability-20261011")
protocol = json.loads((root / "manifest.json").read_text(encoding="utf-8"))["protocol"]
records = json.loads((root / "results.json").read_text(encoding="utf-8"))
record = next(r for r in records if r["section"] == "dropout"
and r["dropout"] == "permanent"
and r["policy"] == "zero" and r["seed"] == 73)
with gzip.open(root / record["trace"], "rt", encoding="utf-8") as stream:
rows = [{k: float(v) for k, v in r.items()} for r in csv.DictReader(stream)]
dt = protocol["timestep"]
stale = next(r for r in rows if r["control_tick"] == 1
and r["capture_t"] >= 0
and r["t"] - dt - r["capture_t"] > protocol["fresh_limit"] + 1e-9)
later = rows[rows.index(stale) + round(0.1 / dt)]
for label, row in (("startup", rows[0]), ("stale", stale), ("later", later)):
print(label, row["t"], row["fx"], row["vx"])This selects 111.csv.gz and prints startup, the first stale control, and another 100 ms later. The table rounds vx to six decimal places:
| CSV t/s | fx/N | vx/(m/s) |
|---|---|---|
| 0.002 | 0 | 0 |
| 0.502 | 0 | 0.853823 |
| 0.602 | 0 | 0.853823 |
The last sample was captured at 0.380 s. At decision time 0.480 s its age is exactly 100 ms, so the policy has not triggered. The 0.500 s decision reaches 120 ms, recorded after the step at 0.502 s. Force becomes zero while velocity stays nonzero: that is the intended counterexample. The original independent audit also checks F=m*a from physical rows. If your trajectory stops instantly, check for additional damping or cleared state rather than substituting startup's zero velocity for the post-loss result.
For burst loss under fade, inspect capture times after recovery: receiving an old sample again is not fresh sensing. A future braking design must specify available observations and actuator capabilities rather than secretly reading simulator truth to replace missing sensors.
Before changing configuration, check what actually executes
The pinned revision reproduces the original frozen protocol. It records fresh_limit/fade_end in JSON while the controller still uses fixed 100/200 ms boundaries. Physics timestep, actuator limits, position/speed acceptance and development conditions have similar mismatches. The original defaults match these constants, so the published tables remain valid. Editing protocol.json at that revision alone does not reliably change the experiment.
The local runner, controller and independent audit now apply these settings to execution and acceptance, rejecting incompatible timestep combinations before running. Replaying the default 153 episodes produced identical results and all decompressed CSV traces. This correction is not published; the fixed links above and commands below still reference the historical version. New threshold studies require matching corrected code and a new output directory. Do not rewrite the old manifest or treat regression fixtures as research outcomes.
Reproduce the protocol
Run from a fresh checkout in PowerShell. The output directory must not exist. All three articles in this study share one frozen protocol; run it once and inspect the section relevant to each article.
git clone https://github.com/VirtualSelect/hohoo-embodied-agent.git hohoo-embodied-agent-study
cd hohoo-embodied-agent-study
git checkout 1d1faab57e20b352761e9abc736c6d277b505e6b
python -m venv .venv
$py = '.\.venv\Scripts\python.exe'
& $py -m pip install -r requirements-lock.txt
& $py -m unittest discover -s experiments/planar_reliability -p "test_*.py"
& $py experiments/planar_reliability/run.py --out outputs/reliability-my-run
& $py experiments/planar_reliability/audit.py outputs/reliability-my-runTested on Windows with Python 3.12.14 + MuJoCo 3.3.7 + NumPy 2.2.6; 3 unit tests, 153 episodes and 306000 rows. The independent audit should print PASS. Other operating systems have not been rechecked. To inspect the archived result without rerunning the experiment, pass evidence/planar-reliability-20261011 to the same audit command. Source hashes normalize LF; evidence hashes use original bytes. Do not rewrite the manifest to conceal a mismatch.
If an import fails, verify that installation and execution use the same $py. Preserve failed outputs and choose a new directory for reruns. Seconds here refer to simulation time, not the computer's wall-clock execution time; check physical trajectories against the frozen protocol and numerical tolerances.
Code and writing are AI-assisted; the findings are limited to the archived, auditable runs. No new paid model requests were made, and this does not claim author-performed manual review.
A note to your future selfBefore you move on, keep one thought of your own.
Your private reading note stays in this browser; it is never uploaded or published. Clearing browser data removes it, so export a copy to keep. This article’s translations share the same note.
Recommended next reading:MuJoCo braking after observation loss: when has the slider stopped? →
Related study material
EXPLORE / Getting started with embodied AI
Focused reading. Use the prerequisites and published follow-ups above to choose what to read next.
Related content
- LAB / 044
Planar control tuning, observation loss and transfer
153 episodes and 306000 physics steps. The selected controller passes 7/18 holdouts; zero force coasts, and mass scaling lowers mean error without passing the velocity contract.
- PROJECT / 003
Hohoo Embodied Experiments
Two MuJoCo teaching scenes—pick-and-place and planar force control—record contracts, tuning, clearance and delayed-feedback outcomes, including failures.
Article revision trail
Clarified sample age and the decay interval, adding the distinction between control and CSV time, read-only verification steps and revision-code notes.
View change evidence ↗
Only verified publication and revision records appear here. Dates come from Git commits, not deployment time or revalidation today. Provider state, model behaviour and costs depend on actual calls.
View count unavailable