| With the development of the industries related to UAV and its operation getting much simpler,the maneuverability,load capacity,and environmental adaptability improve greatly,while the price and maintenance cost are getting lower by now.The initial purpose of the UAV applications was in military,such as investigation,battle,patrol and so.Now it has been gradually migrated to many industrial and civil scenes,such as power line patrol,military fire,mapping,aerial photography and other fields.This also makes UAV security issues more and more attention.In order to improve the independent performance and the safety of unmanned aerial vehicles,the UAV needs the capability of obstacle avoidance.When encountering something like buildings,trees,electric towers on the flight route,the UAV can detect the presence of the obstacles and avoid them appropriately in time.To realize the function of obstacle avoidance of the UAV,I refer to the traditional obstacle avoidance algorithms such as VFH algorithm(Vector Field Histogram),artificial potential field method,etc.and the algorithms based on machine learning which have been widely applied in recent years.In this paper,I combine the RealSense with a drone to get the depth data in front of the UAV,and propose two sets of different obstacle avoidance algorithms based on the depth information.One is a 3D VFH,which bases on the VFH algorithm,applying the traditional two-dimensional obstacle avoidance algorithm to the three-dimensional space.The other adopts the method of machine learning,training to do the avoidance with reinforcement learning.Both of the algorithms use the depth data as input,and determine the strategies to avoid the obstacles combined with the size and the target direction of the UAV.The test results show that both of the algorithms can avoid the obstacles in the three-dimensional space of UAV in both simulation and real-time environment.The paper mainly focuses on two sets of the obstacle avoidance algorithms.Firstly,talk about the hardware and software structure in the design.Then introduce the 3D VFH algorithm and the obstacle avoidance algorithm based on reinforcement learning in details respectively.While the last part of the paper mainly talks about the test section.In the test part,I test both of the algorithms in the simulation environment at first,optimize the algorithms according to the obstacle avoidance effects,and then migrate the algorithms from the simulation environments to the reality to realize the obstacle aoivdance of the UAV.The simulation environment simulates the indoor situation,while the underground parking lot is the place of the practical test. |