Path following and obstacle avoidance for an autonomous UAV using a depth camera