MicroDuck RL: From Simulation to the Real Robot — Part 07 of 14
Training can feel like a black box, but this project gives you excellent tools for looking inside it. This part covers two of them: the 3D viewer and TensorBoard.
3D Viewer: The Browser-Based viser Backend
In our testing, viser was the most reliable option.
uv run play Mjlab-Velocity-Flat-MicroDuck \
--checkpoint-file logs/rsl_rl/velocity/<RUN_DIR>/model_250.pt \
--viewer viser
# Open http://localhost:8080 in a browser.
The viewer lets you:
- Watch the current policy control the robot in real time, with controls for pause, single-step, playback speed, and reset
- Use the Commands panel to send velocity and head-pose commands and observe how well the robot tracks them
- Hot-switch checkpoints. A drop-down lists every
model_*.ptfile. Training produces a new checkpoint every 250 iterations, and switching to the latest one lets you see progress immediately. This is the most intuitive way to judge how learning is developing.
--viewer autoselects the native GLFW viewer when a display is available. Under GNOME on Wayland, however, we encounteredOpenGL error 0x502, and the native window sometimes failed to appear. The browser-basedviserviewer was more reliable.
TensorBoard: Reward Curves and Training Metrics
uv run tensorboard --logdir logs/rsl_rl/velocity --port 6006
# Open http://localhost:6006 in a browser.
A productive workflow is to leave training running in the background, keep the 3D viewer open on port 8080, and keep TensorBoard open on port 6006. Switch to the latest checkpoint periodically. You can literally watch the learning happen.
Other Useful play Options
| Option | Purpose |
|---|---|
--checkpoint-file <path> |
Loads a local checkpoint. This is the correct option when you are not using W&B. |
--video True |
Records a policy rollout to <RUN_DIR>/videos/play/ |
--num-envs N |
Displays multiple environment instances at the same time |
--viewer {auto,native,viser} |
Selects the viewer backend |
Part 08 takes a different approach: no training, just exploring the robot model itself—the fastest way to understand MJCF.