It is often done in simulation, where the robot can fail millions of times safely. It is widely used for walking and balance.