The goal of this project is to create a fast and simple 3D local planner for obstacle avoidance. This planner accepts a target direction and a stereo disparity image, then generates a safe direction. It implements parts of Baumann, Tanja, “Obstacle Avoidance for Drones Using a 3DVFH* Algorithm”, with some modifications. GitHub - chobitsfan/3dvfh
The hardware setup includes a Raspberry Pi 5 as the companion computer and a Luxonis OAK-D Lite stereo camera. In the following tests, the drone attempts to reach a target located 30 meters ahead of the starting point at a speed of 5 m/s. In the video, the quadcopter attempts to avoid obstacles while flying toward the target.
The planner continuously generates a safe navigation direction that is as close as possible to the target direction, and sends it to the flight controller as the SET_POSITION_TARGET_LOCAL_NED MAVLink message. In the video, the short arrow indicates the target direction, while the long arrow represents the safe direction generated by the 3DVFH algorithm.
A slightly modified ArduPilot branch that supports the MAV_FRAME_BODY_FRD coordinate frame in the SET_POSITION_TARGET_LOCAL_NED message is used in this project. Because the stereo camera is fixed to the drone body, the safe direction returned by the 3DVFH algorithm is expressed in the body-fixed frame. Currently, ArduPilot treats the forward axis of MAV_FRAME_BODY_OFFSET_NED and MAV_FRAME_BODY_NED as aligned with the front of the vehicle in the horizontal plane. At higher speeds, a quadcopter tilts more significantly, making these differences non-negligible. While it is possible to request ArduPilot to send the current attitude and perform the coordinate system translation on the companion computer, this approach requires the current attitude to be sent at a high frequency.
Some parts of this project were contributed by Ludovic Angot. Additional components were developed with assistance from AI-based coding tools, including ChatGPT, Gemini, Copilot, and Claude.
