A method lets robots learn from flawed simulations without risking harm in the real world. — Synthesis