Abstract
This paper investigates the formation control problem of multi-UAV systems in the presence of switched trajectories and time-varying communication topologies. A distributed formation control protocol is proposed to enable UAVs to track piecewise continuous trajectories while the underlying communication network switches among a finite set of directed graphs. Sufficient and necessary conditions for achieving accurate formation tracking under dual-switching scenarios are derived through stability analysis while the stability of the overall switched system is proven by using multiple Lyapunov functions. To ensure collision avoidance during both trajectory and topology transitions, control barrier functions (CBFs) are employed to construct safety sets, and a quadratic programming(QP)-based optimization framework is designed to modify control inputs in real time. Simulation results demonstrate that the proposed approach effectively coordinates formation tracking, topology switching, and inter-agent safety, offering a solution for UAV collaboration in dynamic and uncertain environments.