docs: add AI agent workflow guide and clean up residual single-robot references
Checks / Layout, translation and Colab checks (push) Has been cancelled
Checks / Ruff (push) Has been cancelled
Checks / Framework tests (native backend, CPU) (push) Has been cancelled
Checks / Portable Rust controller (push) Has been cancelled

This commit is contained in:
2026-11-05 11:52:07 +08:00
parent c32df70326
commit d5e9004f6c
45 changed files with 252 additions and 231 deletions
+8 -11
View File
@@ -213,11 +213,10 @@ FEATURES = "web"
#:
#: **Not only the crate's directory, either.** This was `Cargo.toml`,
#: `Cargo.lock` and `src/` until 2026-09-28, and the controller was also built
#: from files outside them: `build.rs`, which compiles in every task's deploy
#: hook -- so a commit that changed only `tasks/example_robot/deploy/lib.rs`
#: shipped a different arm under the previous commit's name, and an uncommitted
#: one without `-dirty` -- the dictionary `src/vocabulary.rs` includes, the IDL
#: the board's bus is generated from, and the NPU header `vendor/` holds.
#: from files outside them: `build.rs`, which compiles in optional task deploy
#: hooks (`tasks/**/deploy/lib.rs`), the dictionary `src/vocabulary.rs`
#: includes, the IDL the board's bus is generated from, and the NPU header
#: `vendor/` holds.
#: `tests/test_bundle.py` holds this list to what rustc and `build.rs` actually
#: read.
SOURCES = (
@@ -963,9 +962,8 @@ def write_reference(out: Path, extension: Path | None,
# The mode the cascade runs with nobody touching anything -- the one these
# frames converge on and infer in -- rather than the first mode by name,
# whose home may be another policy's entirely: `robot`'s `claw_left` sorts
# first and carries an arm 1.6 rad from the walking stance, so the frames
# converged on a pose the warm start never reaches and not one inferred.
# whose home pose may belong to another policy entirely, so the frames
# would converge on a pose the warm start never reaches.
import tomllib
cfg = tomllib.loads((out / "controller.toml").read_text("utf-8")).get("fsm", {})
@@ -1507,8 +1505,7 @@ def assemble(out: Path, modes: dict[str, Path], fsm_path: Path | None, meta: dic
if name.endswith(f"/{BOARD_BINARY}"):
(out / name).chmod(0o755)
# One copy of a model per export directory. `claw_left` and `claw_right`
# are one export carried on two sides, and shipped them twice.
# One copy of a model per export directory when two modes share an export.
stored: dict[Path, dict[str, str]] = {}
listed: dict[str, dict] = {}
unconverted: list[str] = []
@@ -2074,7 +2071,7 @@ def validate_app(out: Path) -> None:
#: be held against the one shipped last week.
ZIP_EPOCH = (1980, 1, 1, 0, 0, 0)
#: What a bundle's archive is called: `robot/` travels as `example_robot.app`.
#: What a bundle's archive is called: `<bundle_id>/` travels as `<bundle_id>.app`.
#:
#: The bytes are an ordinary zip, and any zip reader opens one. The name says
#: what the file is rather than how it is packed, as `.jar` does for a zip of
+11 -12
View File
@@ -11,10 +11,10 @@ choices for both. The backend comes from `--backend` / `--device`, or is
auto-detected, exactly as in train.
The environment is built in **replay mode** (`play=True`): external disturbances
are off and episodes run on rather than timing out (the one-shot jumps keep
theirs, so a replay loops whole attempts), so what you see is the policy rather
than the randomisation. Observation noise is the exception: `--obs-noise`, on by
default, puts training's back, because a clean replay flatters the policy.
are off and episodes run on rather than timing out, so what you see is the
policy rather than the randomisation. Observation noise is the exception:
`--obs-noise`, on by default, puts training's back, because a clean replay
flatters the policy.
A replay is **one environment** unless `--num_envs` or `MJRL_PLAY_NUM_ENVS` says
otherwise. `MJRL_NUM_ENVS` is training's batch size, and play does not read it.
@@ -43,14 +43,13 @@ without a display needs ``MUJOCO_GL=egl`` set before Python starts):
python scripts/play.py --checkpoint <path>/model_N.pt --headless \
--steps 500 --video replay.mp4 --video-fps 30
**It is the one MP4 recorder** (`mjrl/viewer/video.py`): the README clips, the
dance export and the Colab notebook all run this command rather than drawing for
themselves. The camera is placed from the robot's first frame (`--video-azimuth`,
`--video-elevation`, `--no-video-follow`), `--stop-on-done` records one attempt
of a one-shot motion rather than looping it, and `--command-script` hands the
command terms a script of time where the README clips need a walk that starts and
a posture that changes -- written where the operator writes, so the pad does not
drive a scripted term.
**It is the one MP4 recorder** (`mjrl/viewer/video.py`): evaluation clips and
the Colab notebook all run this command rather than drawing for themselves. The
camera is placed from the robot's first frame (`--video-azimuth`,
`--video-elevation`, `--no-video-follow`), `--stop-on-done` stops when an
episode terminates, and `--command-script` hands the command terms a script of
time -- written where the operator writes, so a connected pad does not drive a
scripted term.
"""
from __future__ import annotations