Obstacle avoidance and light source detection