Improved the performance of the obstacle avoidance