Local-only Vite + Vue demo for MuJoCo trajectory playback.
- Node.js 18+
- Git (for bootstrap script)
From repo root:
python scripts/bootstrap_mujoco_models.pyThis downloads model assets on demand (sparse checkout from MuJoCo Menagerie), creates symlinks, and regenerates:
webdemo/public/examples/scenes/files.json
Model provenance is documented in:
models/mujoco/README.md
cd webdemo
npm install
npm run devThis demo runs MuJoCo dynamics; it is not pure kinematic teleporting.
- Default behavior in this GTD fork:
control_mode: "position" - Meaning:
ctrlis sent as desired joint positions for MuJoCo<position>actuators - MuJoCo still resolves forces/torques, contacts, and friction physically
Optional fallback for custom models:
control_mode: "torque_pd"uses explicit torque-like PD in JS before writingctrl
Per-robot controller mode is configured in:
webdemo/public/examples/configs/<robot>.json
Note:
- If a clip includes
root_pos/root_quat, the root can be replayed directly from the clip. - For fully dynamic locomotion evaluation, use clips/controllers that do not hard-impose root motion every tick.
- Scene assets (symlinked by bootstrap script):
webdemo/public/examples/scenes/<model>/...
- Scene preload list:
webdemo/public/examples/scenes/files.json
- Robot configs:
webdemo/public/examples/configs/<robot>.json
- Motion assets:
webdemo/public/examples/motions/<robot>/motions.jsonwebdemo/public/examples/motions/<robot>/motions/<clip>.json
- Put clip JSON files in:
webdemo/public/examples/motions/<robot>/motions/
- Register them in:
webdemo/public/examples/motions/<robot>/motions.json
Supported clip keys:
joint_posorjointPosroot_posorrootPos(optional)root_quatorrootQuat(optional)
Use the exporter in the main repo:
python scripts/export_motion_clip.py \
--input /path/to/trajectory.json \
--output webdemo/public/examples/motions/g1/motions/my_clip.json \
--joint-names left_hip_pitch_joint right_hip_pitch_joint ... \
--fps 60Then add my_clip.json to webdemo/public/examples/motions/g1/motions.json.
- Direct code structure origin: Axellwppr/humanoid-policy-viewer Qingzhou Lu (Axellwppr on Github) said: "The framework code will be MIT-licensed (I’ll update the repo shortly). Mjlab and any motion datasets remain under their respective licenses."
- Runtime dependencies: