Step 17 of 38 · Physical AI
Simulation and the sim-to-real gap
Simulation gives you cheap, safe experience. It also lies. Decide what you trust it for and measure the gap on hardware.
Real robots are slow, fragile and few. Simulation lets you run thousands of trials overnight and test situations too dangerous to stage. But policies trained in simulation exploit its errors in physics, sensing and timing, then fail on the machine.
Treat the simulator as a product with an owner and a roadmap. Decide what it is for: training, regression testing, or both. Vary what you cannot model accurately, such as friction, lighting, delays and sensor noise. Above all, measure the gap: run the same scenarios in simulation and on hardware regularly and track how well one predicts the other.
The trap is months of simulated progress with no hardware contact.
Try this week
- Choose five scenarios and run them in simulation and on the real system. Record where the outcomes differ.
- Name an owner for the simulator and list the three modelling gaps that hurt most.
Signs you've got it
- Simulation results come with a stated, measured level of agreement with hardware.
- No learned behaviour goes more than a few weeks without a test on the real machine.
Resources
- paperDomain Randomization for Transferring Deep Neural Networks from Simulation to the Real World (opens in a new tab)Josh Tobin and colleagues
- paperSim-to-Real Transfer in Deep Reinforcement Learning for Robotics: a Survey (opens in a new tab)Wenshuai Zhao, Jorge Peña Queralta and Tomi Westerlund
- articleDomain Randomization for Sim2Real Transfer (opens in a new tab)Lilian Weng
- paperHow to Train Your Robot with Deep Reinforcement Learning; Lessons We've Learned (opens in a new tab)Julian Ibarz and colleagues