An obstacle avoidance method, used for an unmanned aerial vehicle, the unmanned aerial vehicle characterized by comprising a camera apparatus and the camera apparatus supporting optical zoom, wherein the method comprises: obtaining (S102) detection images of at least two different focal lengths from the camera apparatus; determining (S103), according to the detection images of the at least two different focal lengths, that an obstacle exists in a detection area; and obtaining (S104) position information of the obstacle according to the detection images of the at least two different focal lengths, wherein the position information comprises a distance S between the obstacle and the unmanned aerial vehicle and a height difference H between the obstacle and the unmanned aerial vehicle; and the obtaining position information of the obstacle according to the detection images of the at least two different focal lengths comprises: calculating the distance S between the obstacle and the unmanned aerial vehicle and the height difference H between the obstacle and the unmanned aerial vehicle: S = f 1 f 2 h 2 − h 1 + h 1 h 2 f 1 − f 2 tan θ f 2 h 1 − f 1 h 2 H = h 1 h 2 f 2 − f 1 f 2 h 1 − f 1 h 2 cos θ wherein θ is an angle between a flight direction of the unmanned aerial vehicle and a horizontal direction, f1 is a distance between an image plane and an optical center when the camera apparatus is at a first focal length, h1 is an imaging height of the obstacle above the center line of the image plane when the camera apparatus is at the first focal length, f2 is a distance between the image plane and the optical center when the camera apparatus is at a second focal length and h2 is an imaging height of the obstacle above the center line of the image plane when the camera apparatus is at the second focal length, wherein 0°≤θ<90°. obtaining (S102) detection images of at least two different focal lengths from the camera apparatus; determining (S103), according to the detection images of the at least two different focal lengths, that an obstacle exists in a detection area; and obtaining (S104) position information of the obstacle according to the detection images of the at least two different focal lengths, wherein the position information comprises a distance S between the obstacle and the unmanned aerial vehicle and a height difference H between the obstacle and the unmanned aerial vehicle; and the obtaining position information of the obstacle according to the detection images of the at least two different focal lengths comprises: calculating the distance S between the obstacle and the unmanned aerial vehicle and the height difference H between the obstacle and the unmanned aerial vehicle: S = f 1 f 2 h 2 − h 1 + h 1 h 2 f 1 − f 2 tan θ f 2 h 1 − f 1 h 2 H = h 1 h 2 f 2 − f 1 f 2 h 1 − f 1 h 2 cos θ wherein θ is an angle between a flight direction of the unmanned aerial vehicle and a horizontal direction, f1 is a distance between an image plane and an optical center when the camera apparatus is at a first focal length, h1 is an imaging height of the obstacle above the center line of the image plane when the camera apparatus is at the first focal length, f2 is a distance between the image plane and the optical center when the camera apparatus is at a second focal length and h2 is an imaging height of the obstacle above the center line of the image plane when the camera apparatus is at the second focal length, wherein 0°≤θ<90°. <EOS>