
Sim-to-real robotics is the process of training a controller or policy in simulation and making it work on a physical robot. The transfer succeeds when the simulation captures the decisions the policy needs, the real system stays inside the modelled envelope, and deployment is gated by staged tests. Sim-to-real is not a single export button: it is a chain of modelling, randomization, evaluation and hardware tuning.
Microduck publishes that chain for a small biped: mjlab training environments, MuJoCo Warp simulation, PPO policy learning, ONNX export and a 50 Hz onboard runtime. Those details are useful as a worked example, but the principles below apply to arms, quadrupeds and other embodied-AI systems.
The sim-to-real gap is the difference between the conditions represented by a simulator and the conditions a physical robot actually encounters. It comes from both visible differences, such as floor friction, and invisible ones, such as motor heating, communication delay and sensor calibration drift.
A policy can score well in simulation while failing outside it for a simple reason: the policy learned the simulator as much as the task. Sim-to-real work reduces that incidental learning and tests whether the behaviour survives conditions the training run did not explicitly reward.
A simulation policy usually fails on hardware through a combination of model error, distribution shift and integration error. The common causes below are useful diagnostic categories, not a checklist that can guarantee transfer.
| Gap | Typical symptom | Useful mitigation |
|---|---|---|
| Actuator mismatch | The robot drifts, overheats or cannot hold a pose | Identify motor response, torque limits, voltage sag and friction |
| Timing mismatch | The policy becomes unstable or oscillates | Model observation and command latency; test slower loops |
| Contact mismatch | Walking fails on carpet, tile or slopes | Randomize friction, restitution and terrain during training |
| Sensor mismatch | The learned behaviour reacts to noise or bias | Add sensor noise, dropout and calibration error |
| State mismatch | The robot starts from poses the policy never saw | Randomize initial states and include recovery cases |
| Integration mismatch | The exported policy receives a different tensor than training | Verify observation/action shape and preprocessing at runtime |
A practical pipeline has seven stages. Each stage should produce evidence that can be reviewed before the next one runs.
Pipeline advice becomes concrete only when connected to a deployed system. The Microduck training guide shows the robot-specific path, while the policy evaluation guide defines the evidence to collect before hardware testing.
Randomize the physical and computational differences your hardware can actually encounter. Start with a small list tied to observed or measured variation, then expand it as the evaluation suite reveals new failure modes.
Too much overlapping randomization makes failures hard to attribute. Change one category at a time, keep the same evaluation seeds and compare the new policy against a stable baseline.
Evaluate task success, safety and repeatability separately. A policy that finishes the task but falls during half the trials has not transferred successfully, and a policy that stays upright by refusing to move has not completed the task.
Use the same starting-state suite and measurement method across policies. Record more than an average score: preserve per-episode results, intervention counts, failure categories and the exact policy version. The robot policy evaluation framework provides a practical metric and test-gate structure.
Microduck trains in mjlab with MuJoCo Warp and PPO, exports policies to ONNX through the official exporter and runs the resulting controller on the robot at 50 Hz. The current policy contract maps 61 observations to 14 joint targets, and the normalizer is baked into the ONNX graph during export.
The public training code documents actuator modelling, domain randomization and export. The software architecture explains how the runtime protects the motor path, while the policy guide covers loading, testing and publishing behaviours.
Microduck is a compact finished robot, so its most relevant experiments are desk-scale locomotion, recovery and control-policy transfer. It is not a substitute for a high-payload industrial arm or a full-size humanoid platform.
Sim-to-real is a poor fit when the missing physics dominates the task and cannot be modelled or safely explored. Examples include fine manipulation with unmodelled contact geometry, tasks that depend on human safety judgement or experiments requiring hardware the simulator cannot approximate.
It is also the wrong label for a policy that has never been run outside simulation. A successful training curve is an input to transfer testing, not proof that transfer happened.
What does sim-to-real mean in robotics? It means transferring a controller or policy trained in simulation onto a physical robot and validating that it behaves safely and reliably.
Why do simulated robot policies fail in the real world? Simulation cannot capture every actuator, contact, timing and sensor effect. Policies can also overfit to one scene or learn the wrong reward.
Is domain randomization enough for sim-to-real? No. It helps expose the policy to variation, but actuator modelling, delay, systematic evaluation and safe hardware testing remain necessary.
How do I know a policy transferred successfully? Predefine task and safety metrics, run held-out scenarios and require the policy to pass staged simulation, bench and supervised hardware tests.
Can I learn sim-to-real without a robot? You can learn the modelling, training and evaluation workflow in simulation. Hardware transfer requires physical validation and supervision.
How does Microduck train and deploy policies? It uses mjlab, MuJoCo Warp, PPO and ONNX export, then runs the exported policy on its 50 Hz onboard control loop.