How to Program Collision Avoidance for Your Robot