try to optimize obstacle avoidance