Safe obstacle avoidance in real environments