# Physical AI robots learn safely through 'sim-to-real transfer' - training in physics simulators then deploying to real hardware

**Date:** 2025-12-18  
**Tags:** Robotics, AI, Simulation  
**URL:** https://kelexine.is-a.dev/til/sim-to-real-transfer

---

TIL: Physical AI robots learn safely through 'sim-to-real transfer' - training in physics simulators then deploying to real hardware. The key challenge is the 'reality gap' where simulated physics doesn't perfectly match reality. Domain randomization (varying simulation parameters) helps models generalize.


```python
# Domain randomization for sim-to-real
for episode in training:
    sim.randomize({
        'friction': uniform(0.5, 1.5),
        'mass': uniform(0.8, 1.2),
        'lighting': random_lighting(),
        'noise': gaussian(0, 0.1)
    })
    policy.train_episode(sim)
```




---

*This content is available at [kelexine.is-a.dev/til/sim-to-real-transfer](https://kelexine.is-a.dev/til/sim-to-real-transfer)*
