| With the rapid development of UAVs in recent years,new demands have been put forward for UAVs.As a tool,UAV has been put into our production and life.However,due to the limitation of technological development,the safe operation of UAV needs stable location information.Therefore,this paper designed a UAV autonomous positioning and obstacle avoidance system based on 3D Lidar,The main work of this paper is as follows:Firstly,this paper studies the overall scheme and hardware selection of UAV control system.Taking the six rotor UAV as an example,the flight principle,control algorithm,onboard SDK and ROS system are introduced.Secondly,the principle of laser data generation and the coordinate system of each part are studied,the laser point cloud is obtained by coordinate transformation,and the filtering algorithm used in point cloud preprocessing is analyzed.The operation of removing discrete points and down-sampling is realized,which reduces the complexity of point cloud.This paper introduces the basic principle of KD tree,and uses KD tree to complete the processing of establishing the spatial topological relationship of point cloud,which establishes the basis for the next search of the nearest neighbor of point cloud.It studies the feature description and extraction of point cloud,and proposes a method of feature description and extraction based on the roughness of point cloud.Thirdly,A laser SLAM algorithm based on L-M algorithm is realized.The motion model of lidar is analyzed,using the iterative closest point method,the registration between point clouds is realized and the motion transformation relationship between point clouds is estimated.Then,the basic principle of L-M algorithm is introduced.Based on L-M algorithm,the real nonlinear optimization process in point cloud registration and mapping is realized.Then,experiments are carried out and the effect of the algorithm is analyzed.The results show that the positioning accuracy of the algorithm can meet the needs of UAV positioning.Finally,This paper studies the working principle of differential RTK,introduces the format type of RTK data,completes the acquisition of RTK data and realizes the analysis of RTK data according to the data format,and finally designs the program based on the onboard SDK,builds the UAV control platform,and designs the related ROS nodes.The results show that the algorithm designed in this paper can well complete the analysis and transmission of RTK data. |