path planning and obstacle avoidance