中文 | English
Overview
This project runs MuJoCo (WASM) simulations in the browser and performs online inference of a Go2 (quadruped) policy using ONNX Runtime Web. The repository also includes several test terrains (steps, slopes, tracks, etc.) to validate control and policy performance. See the live demo here
- Install dependencies:
npm install- Build the frontend bundle:
npm run build- Start the local static server:
python server.py
# Visit http://localhost:8090Note: To use ONNX Runtime Web multithreading / SharedArrayBuffer, the page must be served with COOP/COEP headers (already handled by
server.py). Use a modern browser (latest Chrome/Edge/Firefox recommended).
- After the page loads you will see the simulation area and the GUI (lil-gui).
- Choose different terrains from the Scene dropdown; the page will reload the selected scene.
- In AI Controls select a model (PPO / MOECTS) and click "Enable AI Control" to activate policy inference.
- Use keyboard WASD/QE or joystick to control the
- Add an ONNX model: put the model file in
models/(e.g.my_model.onnx), then add or replace an entry insrc/main.js'smodelConfigs:
modelConfigs: {
"my_model": { url: './models/my_model.onnx', history: 3, stacking: 'frame' }
}- Add a scene: place the scene and its assets in
assets/scenes/go2/and add the scene path to theSceneoptions insrc/mujocoUtils.js.
This repository references from zalo/mujoco_wasm
Contributions are welcome (issues/PRs) to add scenes, models, or improve examples.