In view of the problem that path planning and trajectory tracking are rarely solved simultaneously in the current research, which hinders their practical implementation, this paper focuses on enhancing the autonomous flight planning capability of unmanned aerial vehicles (UAVs) by investigating integrated path planning and trajectory tracking technologies. The autonomous flight process is divided into two sub-problems: waypoint designing/optimizing and waypoint tracking. Firstly, an improved DB-RRT* algorithm is proposed for waypoint planning to make the algorithm have higher planning efficiency, better optimization results, and overcome the defects of accidental and low reliability of single RRT* planning results. Secondly, the scheme of “offline design + online flight” is adopted to lead the UAV to fly online according to the waypoints’ instructions by using the sliding mode guidance based on angle constraint with finite-time convergence so that it can fly to the destination autonomously. In order to check the performance of the proposed algorithm, a variety of simulations are conducted to verify the feasibility of the proposed algorithm.