Policy hot-swapping
Last updated
Microduck’s runtime hot-swaps between policies: walking, fall recovery and each skill is its own .onnx, loaded by robotd on demand.
It rests on the shared contract
This works because every policy shares one 61-dimensional observation contract. Switching is loading a different network — no state translation, no reshaping.
A concrete case: walk ⇄ roller
After fitting or removing the wheels, hold D-pad up for three seconds:
- The robot quacks once for walking, twice for roller
- Returns to its home pose
- Loads that mode’s policies there
- Drives again
A few seconds, torque on throughout, no restart.
robotd.toml is not touched, so a reboot comes back in the configured mode. Make it stick with robotctl configure and [policy] mode.
It is a hold rather than a press because D-pad up is easy to lean on while driving.
Running your own
No release needed. Point the config at your file:
[policy]
walk = "/home/radxa/my_walking.onnx"
stand = "/home/radxa/my_stand.onnx"
sudo systemctl restart robotd
Those paths survive updates — a release replaces what it ships, not the file pointing elsewhere.
A policy that could not be loaded reports unhealthy, and both robotctl health and the bottom border of monitor name the reason.