By Kevin McAleer, 5 Minutes
Page last updated November 24, 2026

This is the moment the whole course has been building to. Your duck is built, tested and calibrated. Let’s make it walk.
A walking robot can fall, and a falling robot can break. Before every walking session:
The runtime repo has a checklist.md. Open it and work through it before your first walk. It’s there to catch the things that are easy to forget, and it’s kept up to date with the code.
The runtime repo comes with a pretrained policy, BEST_WALK_ONNX_2.onnx. This is the walking brain, already trained in simulation. The walk command below expects it in your home folder, so find it in the repo and copy it there:
find ~/Open_Duck_Mini_Runtime -name BEST_WALK_ONNX_2.onnx
cp <path printed above> ~/
Then, from the Open_Duck_Mini_Runtime folder:
cd scripts/
python v2_rl_walk_mujoco.py --duck_config_path ~/duck_config.json --onnx_model_path ~/BEST_WALK_ONNX_2.onnx
There are two important parts to that command:
| Option | What it points to |
|---|---|
--duck_config_path |
Your config from lesson 10, with your offsets and imu_upside_down setting |
--onnx_model_path |
The policy file the duck will run |
So the same script will run any policy you give it. In lesson 13 you’ll point it at one you trained yourself.
Once it starts, the runtime loops many times a second: read the servos, IMU and foot switches, ask the policy what to do, and send new positions to the servos.
| Control | What it does |
|---|---|
| Left stick | Walk |
| A | Pause or unpause |
| Hold LB | Walk faster |
| X | Toggle the projector |
| B | Play a random sound |
| LT and RT | Move the antennas |
| Y | Head control. Very experimental. Leave it off |
Y turns on head control. It’s very experimental, and it can break the head. Leave it off, at least until your duck is walking well and you’re happy to take the risk.
If it looks wrong, press A to pause it, and catch it if you need to.
Congratulations! You’ve built a robot that walks using a neural network trained in a simulator. That’s the same idea used in some of the most advanced walking robots in the world, and it’s walking on your floor.
Now that it walks, watch it closely. These are clues to what to fix:
| What you see | What it usually means |
|---|---|
| Wobbling side to side that gets worse | Check imu_upside_down |
| Drifting or leaning one way | Check your offsets |
| One foot stamping harder than the other | The foot switches may not be in sync |
| Jerky, laggy steps | Check the FTDI latency rule from lesson 8 |
Lesson 14 goes through each of these in detail.
Problem: The script stops with a file not found error.
Solution: Check both paths in the command. ~/duck_config.json and ~/BEST_WALK_ONNX_2.onnx must exist in your home folder.
Why: The script needs both your config and a policy file to run.
Problem: The duck falls straight over.
Solution: Pause it, then check your offsets and imu_upside_down in lesson 10.
Why: The policy expects a duck that matches the simulated one. Big differences make it fall.
Problem: The controller doesn’t do anything.
Solution: Run xbox_controller.py again, as in lesson 9, to check it’s connected.
Why: The walk script can only follow a controller the Pi can see.
Comments