See also: Inference & Deployment Guide for all deployment options
This guide provides a complete workflow for running locomotion policies in MuJoCo simulation.
The sim-to-sim workflow allows you to replay IsaacSim/IsaacGym-trained locomotion checkpoints inside MuJoCo for evaluation and testing.
- MuJoCo environment set up (
scripts/source_mujoco_setup.sh) - Holosoma inference environment set up (
scripts/source_inference_setup.sh) - ONNX model checkpoint
- Keyboard or joystick for control
Note: Always use --task.interface lo (loopback) when inference and MuJoCo run on the same machine.
In one terminal, launch the MuJoCo environment:
For keyboard control:
source scripts/source_mujoco_setup.sh
python src/holosoma/holosoma/run_sim.py robot:g1-29dofFor joystick control:
source scripts/source_mujoco_setup.sh
python src/holosoma/holosoma/run_sim.py robot:g1-29dof \
--simulator.config.bridge.enabled=True \
--simulator.config.bridge.use-joystick=TrueThe robot will spawn in the simulator, hanging from a gantry.
In another terminal, run the policy inference:
For keyboard control:
source scripts/source_inference_setup.sh
python3 src/holosoma_inference/holosoma_inference/run_policy.py inference:g1-29dof-loco \
--task.model-path src/holosoma_inference/holosoma_inference/models/loco/g1_29dof/fastsac_g1_29dof.onnx \
--task.no-use-joystick \
--task.interface loFor joystick control:
source scripts/source_inference_setup.sh
python3 src/holosoma_inference/holosoma_inference/run_policy.py inference:g1-29dof-loco \
--task.model-path src/holosoma_inference/holosoma_inference/models/loco/g1_29dof/fastsac_g1_29dof.onnx \
--task.use-joystick \
--task.interface lo- In MuJoCo window, press
8to lower the gantry until robot touches ground - In MuJoCo window, press
9to remove gantry
In policy terminal, press ] (or A button on joystick) to activate the policy.
In policy terminal, press = (or Start button on joystick) to enter walking mode.
- Use keyboard (
wasdfor linear,qefor angular) or joystick to control velocity - Left joystick: Move forward/backward/left/right
- Right joystick: Turn left/right
In one terminal, launch the MuJoCo environment:
For keyboard control:
source scripts/source_mujoco_setup.sh
python src/holosoma/holosoma/run_sim.py robot:t1-29dof-waist-wristFor joystick control:
source scripts/source_mujoco_setup.sh
python src/holosoma/holosoma/run_sim.py robot:t1-29dof-waist-wrist \
--simulator.config.bridge.enabled=True \
--simulator.config.bridge.use-joystick=TrueThe robot will spawn in the simulator, hanging from a gantry.
In another terminal, run the policy inference:
For keyboard control:
source scripts/source_inference_setup.sh
python3 src/holosoma_inference/holosoma_inference/run_policy.py inference:t1-29dof-loco \
--task.model-path src/holosoma_inference/holosoma_inference/models/loco/t1_29dof/ppo_t1_29dof.onnx \
--task.no-use-joystick \
--task.interface loFor joystick control:
source scripts/source_inference_setup.sh
python3 src/holosoma_inference/holosoma_inference/run_policy.py inference:t1-29dof-loco \
--task.model-path src/holosoma_inference/holosoma_inference/models/loco/t1_29dof/ppo_t1_29dof.onnx \
--task.use-joystick \
--task.interface lo- In MuJoCo window, press
8to lower the gantry until robot touches ground - In MuJoCo window, press
9to remove gantry
In policy terminal, press ] to activate the policy.
In policy terminal, press = to enter walking mode.
Use keyboard to control velocity:
wasdfor linear movement (forward/backward/left/right)qefor angular movement (turn left/right)
Enter these commands in the MuJoCo window (not the policy terminal):
7: Lift the gantry8: Lower the gantry9: Disable/remove the gantry
Backspace: Reset simulation
Enter these commands in the policy terminal (where you ran run_policy.py):
| Action | Keyboard | Joystick |
|---|---|---|
| Start the policy | ] |
A button |
| Stop the policy | o |
B button |
| Set robot to default pose | i |
Y button |
| Action | Keyboard | Joystick |
|---|---|---|
| Switch walking/standing | = |
Start button |
| Adjust linear velocity | w a s d |
Left stick |
| Adjust angular velocity | q e |
Right stick |
- Reset anytime: Press
Backspacein the MuJoCo window to reset the simulation - Interface: Always use
lo(loopback) for sim-to-sim on the same machine - Standing mode: The robot starts in standing mode - press
=orStartto switch to walking mode - Default pose: Press
iorYbutton to return the robot to standing pose