MicroDuck RL: From Simulation to the Real Robot — Part 13 of 14
This installment records the complete hands-on test process and provides a map of the most important source files, making it easier to reproduce the setup and continue exploring the codebase.
Test Timeline: RTX 5080 16 GB, September 2026
| Step | Result |
|---|---|
pip install uv |
Installed uv 0.12.9 |
git clone + uv sync |
Managed Python 3.12.14 interpreter and all dependencies; about 6 minutes and roughly 2 GB |
| Environment verification | PyTorch CUDA ✓, list-envs ✓, pytest: 166 passed and 1 skipped |
| Start training | 4,096 environments, TensorBoard logger, about 1.13 seconds per iteration, roughly 7.3 GB of VRAM |
| Visualization | viser 3D viewer on port 8080 and TensorBoard on port 6006 |
| Training output | One model_*.pt checkpoint every 250 iterations; hot-switching in the viewer makes progress easy to see |
A few additional notes:
- System Python 3.13 is fine;
uvautomatically uses its managed Python 3.12.14 interpreter. - If you do not have a W&B account, use
--agent.logger tensorboardthroughout. You still get all of the training curves locally. - Under GNOME on Wayland, the native viewer may encounter an OpenGL error. Use
--viewer viserinstead.
Key Files and How to Read Them
| Path | Contents | How to use it |
|---|---|---|
src/mjlab_microduck/tasks/microduck_velocity_env_cfg.py |
Main task configuration, roughly 950 lines | The best learning resource in the series; extensively commented |
src/mjlab_microduck/tasks/mdp.py |
More than 7,000 lines of custom reward, observation, and event functions | Pick a reward that interests you and study it alongside the equation |
src/mjlab_microduck/robot/microduck_constants.py |
Robot configuration, HOME pose, and BAM parameters | Companion source for Part 06 |
src/mjlab_microduck/robot/microduck/*.xml |
MJCF models for walking, ground contact, roller-skating, and backlash variants | Companion material for Part 08 |
AGENTS.md |
Project experience guide covering reward design, curricula, and common pitfalls | Original source for Part 10 |
logs/rsl_rl/velocity/<timestamp>_velocity/ |
Training-run directory containing checkpoints, TensorBoard event files, and params/ |
A complete snapshot of each training run |
scripts/export.py / scripts/infer_policy.py |
ONNX export and CPU-based rehearsal | Companion source for Part 09 |
Bookmark this installment as your guide to the source tree. Part 14 concludes the series with an FAQ and troubleshooting notes.