Next Article in Journal
AI-Based Predictive Maintenance Framework for Industrial Saw Blade Wear Monitoring Using Low-Cost Vibration Sensors
Previous Article in Journal
The Validity of Stryd Leg Stiffness Against the Morin (2005) Sine-Wave Method: A Level-1 Assessment of Flat and Uphill Treadmill Running
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Multilayer Decision-Making Method for UAV Formation Cooperative Flight in Complex Urban Environments

1
School of Science, Shenyang Ligong University, Shenyang 110159, China
2
School of Equipment Engineering, Shenyang Ligong University, Shenyang 110159, China
*
Author to whom correspondence should be addressed.
Sensors 2026, 26(10), 3245; https://doi.org/10.3390/s26103245
Submission received: 2 April 2026 / Revised: 12 May 2026 / Accepted: 18 May 2026 / Published: 20 May 2026
(This article belongs to the Section Navigation and Positioning)

Abstract

To address the challenges of dynamic obstacles, limited perception, and multi-UAV coordination constraints in complex urban environments, a hierarchical control framework based on a virtual leader-follower architecture is proposed, covering global planning, local obstacle avoidance, and formation coordination. In the global planning layer, a dynamic adaptive strategy rapidly exploring random tree star (DASRRT*) algorithm is proposed. To address the low sampling efficiency and limited path extension in dense environments that affect traditional RRT*, a hybrid guided sampling strategy, inefficient node optimization strategy, and perception-based adaptive step size strategy are designed. Additionally, a multi-objective cost function is introduced to provide smoother trajectories that better comply with dynamic constraints for trajectory tracking. In the local obstacle-avoidance layer, a distributed controller is constructed based on an improved artificial potential field method, integrating collision avoidance control laws derived from a spring-damper model, dynamic obstacle-avoidance laws that account for obstacle velocities, and formation coordination control laws grounded in consensus theory. In the coordination control layer, a real-time local target selection strategy is established to guide the virtual leader to precisely track the global path, and a dual-mode switching mechanism based on environmental complexity is constructed to dynamically adjust the priority between formation maintenance and autonomous obstacle-avoidance tasks. Comparative experimental results show that the proposed DASRRT* algorithm reduces path planning time by an average of 34.78% and shortens path length by 1.15%. Simulation results for formation flight demonstrate that the proposed hierarchical control framework can adaptively adjust control modes in response to changes in environmental complexity, exhibiting strong adaptability to complex environments and a good ability to generalize to various scenes.

1. Introduction

With the rapid development of unmanned aerial vehicle (UAV) technology, collaborative control strategies for UAV clusters have attracted significant attention [1,2]. Multi-UAV systems improve the intelligence and decision-making capability of individual agents through inter-agent coordination, offering advantages such as high flexibility, efficiency, low cost, and strong fault tolerance capability. Consequently, they are widely applied in both civil and military domains, including coordinated strikes [3,4,5], monitoring [6], logistics and transportation [7,8], and disaster relief [9]. To maintain an efficient formation configuration while ensuring safe mission execution, the system must be capable of rapid decision-making and accurate control under uncertain disturbances [10]. Although existing cooperative control theories have achieved substantial progress, traditional planning and control methods may fail when operating environments shift from open airspace to more complex and constrained scenarios.
With the rapid development of the low-altitude economy and smart cities, urban environments have become a core scenario for multi-UAV systems to execute missions. In applications such as civil urban air mobility and military low-altitude penetration, the safety and timeliness of UAV formations are crucial. However, urban airspace is characterized by significant unstructured and highly dynamic features. UAVs must maintain a compact formation to ensure cooperative effectiveness while also possessing high agility to avoid complex obstacles. Traditional methods struggle to balance the effectiveness of global path planning with the real-time requirements of local dynamic obstacle avoidance, often resulting in collisions or formation breakup when faced with sudden threats. Therefore, complex urban low-altitude formation tasks are inherently a “planning—control—coordination” coupling problem. The global layer needs to provide safe and feasible reference paths. The local layer must implement real-time obstacle and collision avoidance. The coordination layer must dynamically balance formation maintenance with autonomous obstacle avoidance and quickly restore the formation after obstacle avoidance. Thus, constructing a hierarchical cooperative framework that covers global planning, local obstacle avoidance, and formation coordination across three layers is an effective approach to improving the continuity and stability of formation tasks in complex urban environments.
Current multi-UAV path-planning methods mainly include graph-search methods, heuristic algorithms, deep reinforcement learning (DRL), and random sampling approaches [11,12,13,14,15]. Graph-search algorithms, such as A* and Dijkstra, can identify optimal paths on discretized grid maps. Reference [16] combined A* with the dynamic window approach and introduced an adaptive evaluation function to improve path quality; however, such methods incur high computational cost in complex or high-dimensional environments, and the resulting paths often lack smoothness. Heuristic algorithms, including genetic algorithms (GA) and ant colony optimization, address multi-constraint optimization problems by mimicking the behavior of biological populations. Reference [17] proposed a hierarchical framework based on an improved genetic algorithm and used time-dimensional path points for trajectory replanning, effectively resolving temporal conflicts in multi-UAV trajectories; nevertheless, such methods are prone to local optima and often exhibit limited solution stability. In recent years, DRL methods such as Proximal Policy Optimization and Deep Deterministic Policy Gradient (DDPG) have shown significant advantages in highly dynamic and unknown environments. Reference [18] introduces a multi-step smoothness metric as an auxiliary optimization objective, effectively suppressing trajectory oscillations by adaptively adjusting weight coefficients through an alternating hierarchical gradient descent strategy. However, DRL training is extremely time-consuming, and the resulting models lack interpretability. In addition, random sampling algorithms, such as RRT* and PRM, avoid full-map preprocessing by constructing path trees through spatial sampling, making them advantageous in high-dimensional spaces. The exploration-RRT* algorithm proposed in [19], for example, effectively balances information gain and travel cost in unknown environments. Nonetheless, such methods generally suffer from slow convergence and low sampling efficiency in narrow, constrained regions. The need to balance planning efficiency, path smoothness, and trajectory trackability in the constrained spaces of complex urban environments exacerbates the aforementioned shortcomings. Moreover, the global path must be capable of supporting subsequent path tracking and formation coordination control.
For cooperative formation flight control of multiple UAVs, efficient control strategies mainly include behavior-based methods, virtual structure methods, leader–follower methods, and artificial potential field (APF) approaches [20,21]. Behavior-based methods, inspired by biological swarm behavior, are highly distributed and well suited to large-scale swarms. Reference [22] simulated the flocking mechanism of starlings and achieved efficient formation control by using visual localization to resolve mutual perception. However, such methods generally lack rigorous mathematical guarantees for system stability and convergence. Virtual structure methods treat the formation as a rigid body and maintain the configuration by tracking virtual nodes. Reference [23] designed a sliding-mode tracker that computes tracking points according to the desired trajectory and terrain feature structure, thereby achieving high-precision formation maintenance. Nevertheless, the rigid constraints of this approach limit system flexibility, making it difficult to handle dynamic obstacle avoidance and formation reconfiguration in complex environments. Leader–follower methods maintain the formation by having followers track the leader’s state. Based on this framework, Reference [24] designed a three-channel robust controller to suppress dynamic uncertainties. Compared with the virtual structure approach, this method is more amenable to obstacle avoidance, but it suffers from the risk of single-point failure of the leader and lacks global coordination because the leader does not account for follower states. In addition, APF-based methods achieve formation control by constructing attractive fields toward the target and repulsive fields from obstacles. Reference [25] proposes an improved APF method that integrates predicted states and input thresholds, enhancing the control safety and real-time performance of large-scale swarm systems under delay constraints. However, in complex unstructured terrains such as three-point collinearity or semi-enclosed environments, APF is highly prone to local minima and may induce system oscillations. For urban constrained spaces, this means that formation control must not only be capable of obstacle avoidance but also require a control strategy that can adapt to different complex environments.
To address the inherent limitations of the above classical methods, extensive efforts have recently been devoted to targeted improvements. Although RRT* achieves asymptotic optimality through its rewiring mechanism, it still suffers from slow convergence and low sampling efficiency in narrow, constrained spaces [26,27]. To improve planning efficiency, Reference [28] proposed FRRT*, which integrates a risk network and a feedback module to constrain random-tree growth using situational information. Reference [29] further proposed the goal-biased PF-RRT*, which optimizes parent-node generation in obstacle neighborhoods through a bisection strategy, significantly reducing path cost and improving sampling quality. Traditional APF methods are prone to stagnation due to the balance between attractive and repulsive forces, and they may induce trajectory oscillations in complex terrains [30,31]. To address this issue, Reference [32] combined bionic swarm mechanisms with consensus theory and introduced a rotational potential function, effectively alleviating the local-minimum and oscillation problems in multi-UAV formations. In addition, to overcome the leader-failure problem in the leader–follower architecture, Reference [33] introduced a Virtual Leader combined with switching-topology communication, thereby effectively reducing computational burden. Reference [34] designed a finite-time consensus control law and incorporated an improved APF for dynamic obstacle avoidance, resolving the divergence of tracking errors in complex environments. Overall, existing research has made progress in areas such as planning efficiency, local obstacle avoidance, and consistency coordination. However, in complex urban scenarios, there is a need to further develop a hierarchical cooperative framework that can provide high-quality global reference trajectories while simultaneously ensuring formation maintenance, real-time obstacle avoidance, and formation recovery under local dynamic constraints.
Although multilayer decision-making and hierarchical control methods for UAVs have been widely studied, existing approaches mainly focus on one or two aspects, such as global path planning, local obstacle avoidance, formation maintenance, or constraint control. In contrast, this paper focuses on cooperative formation flight tasks in complex dynamic environments, with an emphasis on the collaborative design and improvement of global path planning, formation tracking control, and local obstacle avoidance. The main contributions of this paper are as follows:
(1)
A dynamic adaptive strategy rapidly exploring random tree star (DASRRT*) algorithm is introduced. Unlike traditional RRT* and its variants, which primarily focus on search feasibility or path cost, DASRRT* combines guided sampling, adaptive step size, suboptimal node optimization, and path optimization strategies to improve search efficiency in complex, narrow environments while generating shorter, smoother global reference paths to enhance path traceability.
(2)
A distributed control law based on an improved APF was designed. Compared with traditional APF or consensus control methods, this paper introduces a relative velocity damping term for collision avoidance and a target attraction factor and velocity adaptive weight for obstacle avoidance. Furthermore, a distributed formation cooperative control law based on consensus theory is developed to mitigate issues with traditional APF, such as local minima, oscillations, and insufficient response to dynamic obstacles. A stability analysis based on the Lyapunov method is also provided.
(3)
A cooperative mechanism for formation control in complex environments is established. Unlike hierarchical control methods with fixed weights or a single mode, this paper establishes an environment complexity-based dual-mode switching and dynamic control weight adjustment method. This allows the formation to prioritize consistency in open areas, prioritize collision and obstacle avoidance in narrow or dynamically threatened regions, and quickly recover the desired formation once the risk is mitigated. In addition, a curvature-driven dynamic step size and local target selection strategy are designed, enabling the virtual leader to generate effective local guidance targets in real time along the global path.

2. Theoretical Foundation

This section introduces the fundamental concepts of algebraic graph theory, followed by the UAV dynamic model and its associated constraints. The content covered in this section pertains to the fundamental theory of cooperative control in multi-agent systems, with relevant definitions drawn from existing research on multi-agent consensus and graph theory-based control.

2.1. Graph Theory

Algebraic graph theory can be used to describe the information interaction among multiple UAVs and is widely applied in modeling UAV formation cooperative control [35,36]. The considered formation system consists of one virtual leader and n followers, where an undirected graph G represents the communication topology among followers, as illustrated in Figure 1. During formation flight, each UAV is assumed to receive the leader’s position and velocity information without delay or packet loss. In addition, followers can access information from neighboring agents only when they are within the prescribed communication range.
The graph G = V , E consists of a node set V = 1,2 , , n and an edge set E = i , j i , j V , i j . For the i-th follower, the set of its neighboring UAVs is defined as N i = j V , i , j E . Let A denote the adjacency matrix of G , where a i j represents the weight of the edge i , j . Defining the communication topology as an undirected graph implies that the i-th UAV and the j-th UAV can mutually exchange state information. Specifically, if i , j E , then a i j = 1 ; otherwise, a i j = 0 . It is further assumed that the graph contains no self-loops, such that a i i = 0 . The degree matrix is given by D = d i a g d 1 , d 2 , , d n , where d i = j = 1 , j i n a i j , and the corresponding Laplacian matrix is defined as L = D A . In the context of this leader–follower multi-UAV system, the leader is designated as UAV 0. In the virtual leader–follower multi-UAV system, the virtual leader UAV is denoted as UAV 0. Let H R n × n represent the connection matrix between the followers and the leader, defined as H = d i a g ( h 1 , h 2 , , h n ) . If the i -th follower exchanges information with the leader, then h i = 1 ; otherwise, h i = 0 .

2.2. Models and Constraints

2.2.1. UAV Dynamics Model

To account for aerodynamic drag and inertial effects during actual flight, the i-th UAV is modeled as a second-order point mass dynamical system with damping characteristics [37,38]. Let p i ( t ) = x i , y i , z i T R 3 and v i ( t ) = [ v i x , v i y , v i z ] T R 3 denote the position and velocity vectors of the UAV at time t , respectively.
p i ˙ t = v i t v i ˙ t = u i ˙ t γ v i ˙ t
where u i t R 3 represents the control input vector, and γ > 0 denotes the air damping coefficient, which reflects the energy dissipation characteristics of the actual flight environment. Given a sampling time step Δ t , the state update equations at time t + 1 are formulated as follows:
v i t + 1 = 1 γ Δ t v i t + u i t Δ t p i t + 1 = p i t + v i t + 1 Δ t

2.2.2. UAV Constraints

In practical applications, the maneuverability of a UAV is restricted by its physical actuators and must adhere to safe flight constraints [39]. This research incorporates the following three categories of constraints:
(1)
Saturation Constraints
To ensure that control commands remain within the feasible operational range of the actuators, saturation constraints are imposed on flight velocity and control input magnitude.
Specifically, the flight speed of a UAV must not exceed the maximum allowable velocity v m a x .
v i t v m a x ,     i n
Furthermore, the control input is bounded by the maximum acceleration u m a x .
u i t u m a x ,     i n
(2)
Obstacle Avoidance Safety Constraints
The flight environment comprises a set of static obstacles O s and dynamic obstacles O d . Let Ω k denote the geometric region occupied by the k-th obstacle. To guarantee flight safety, the distance between a UAV and any obstacle must be maintained above a safety margin δ s a f e .
min o Ω k p i t p o δ s a f e ,     k O s O d
A collision is considered to have occurred whenever the distance between the UAV and an obstacle is less than this safety margin.
(3)
Inter-agent Collision Avoidance Constraints
To prevent internal collisions within the formation, the distance between any two UAVs must consistently remain greater than a minimum safety interval r s .
p i t p j t > r s ,     i , j n ,   i j
A collision is deemed to have occurred if the distance between two UAVs falls below this safety interval.

3. Methodology

This study introduces a novel hierarchical decision and control framework based on the virtual leader–follower strategy, designed to collaboratively resolve the challenges of global path planning, local obstacle avoidance, and formation cooperative control for UAVs within complex dynamic environments. The operational flight scenario in a complex environment is shown in Figure 2.

3.1. Global Path Planning

To generate high-quality global reference paths, the DASRRT* algorithm is developed. Building upon the traditional RRT, it integrates four synergistic optimization strategies to improve planning efficiency and path quality in narrow and complex environments. The overall framework of DASRRT* is illustrated in Figure 3.

3.1.1. Hybrid Guided Sampling Strategy

To improve the low sampling efficiency of traditional RRT algorithms, a hybrid guided sampling mechanism is introduced. At each iteration, dynamic focused sampling is selected with probability P f , while global uniform sampling is applied with probability 1 P f . The dynamic focused strategy guides the sampling point q r a n d within a concentric spherical region that adapts according to the iteration index k .
q r a n d = dynamic   focused   sampling ,   with   probability   P f global   uniform   sampling ,   with   probability   1 P f
where q r a n d denotes the geometrically guided sampling point, and P f represents the sampling bias weight.
(1)
Global Uniform Sampling
Uniformly distributed sampling points q r a n d are generated within the map space as follows:
q r a n d = x r a n d y r a n d z r a n d ,     x r a n d x m i n , x m a x y r a n d y m i n , y m a x z r a n d z m i n , z m a x
where x m i n , x m a x × y m i n , y m a x × z m i n , z m a x defines the environmental boundaries.
(2)
Dynamic Focused Sampling
The center of the focused region, q c is adaptively adjusted via a bias weight P g .
q c = q g o a l ,     with   probability   P g q s t a r t + q g o a l 2 ,     with   probability   1 P g
where q s t a r t denotes the starting point, q g o a l is the target point, and P g represents the target bias weight. Furthermore, the radius of the focused region, r ( k ) , evolves dynamically as a function of the iteration index k and the environmental scale q g o a l q s t a r t .
r k = ρ q g o a l q s t a r t i k k λ
where, ρ is the scale factor, i k U ( 0,1 ) is a random variable, and λ is the shape parameter controlling the concentration of the sampling distribution. When λ = 1 3 , sampling is uniformly distributed within the sphere; for λ > 1 3 , sampling points concentrate toward the sphere center. For representative cases λ = 1 3 and λ = 1 , the distribution of 10,000 samples within a unit sphere is shown in Figure 4.
Once the sampling center and radius are determined, sampling points are randomly generated within the spherical domain as follows:
q r a n d = q c + r k v θ , v θ = s i n ϕ c o s θ , s i n ϕ s i n θ , c o s ϕ T
where, θ U [ 0,2 π denotes the azimuth angle, and ϕ = a r c c o s ( 2 η 1 ) denotes the polar angle, where η U [ 0,1 ] . This formulation ensures uniform sampling within the corresponding spherical region in 3D space.
To ensure that the hybrid guided sampling point q r a n d remains within the environmental boundary B = x m i n , x m a x × y m i n , y m a x × z m i n , z m a x , coordinate-wise boundary constraints are enforced as follows:
q r a n d i = m a x m i n q r a n d i , B m a x i , B m i n i ,     i x , y , z
When λ > 1 3 , dynamic focused sampling yields an adaptive distribution that is dense near the center and sparse near the boundary, accelerating exploration of the target region and facilitating rapid discovery of an initial feasible path.

3.1.2. Perception-Based Adaptive Step Size Strategy

The limitations of conventional RRT* in narrow passages are shown in Figure 5. Owing to the stochastic nature of sampling and the use of a fixed expansion step size, the effective expansion rate remains low in obstacle-dense regions. When nodes approach obstacles, an excessively large step size often causes newly generated nodes to collide with obstacles, resulting in invalid expansions. In contrast, an overly small step size reduces pathfinding efficiency.
To prevent expansion failures caused by excessively large step sizes near obstacles, a dynamic obstacle-aware step size strategy is proposed. The expansion step size δ is adaptively adjusted according to the minimum Euclidean distance d o b s from the neighboring node q n e a r to the closest obstacle.
δ q = m a x δ m a x 1 e β d o b s q n e a r , δ m i n
where, δ m a x and δ m i n denote the upper and lower bounds of the step size, respectively; d o b s ( q n e a r ) is the distance from the node to the nearest obstacle; and β ( 0,1 ) is a sensitivity parameter. When d o b s is small, indicating proximity to obstacles or narrow passages, δ decreases to improve expansion precision and feasibility. Conversely, in open regions, a larger step size is maintained to accelerate exploration.

3.1.3. Inefficient Node Optimization Strategy

To alleviate the rapid growth in computational cost caused by neighborhood search and rewiring during tree expansion, an optimization mechanism for the rewiring process is introduced. After identifying an initial feasible path, each newly generated node q i is evaluated using:
Φ q i = q i q s t a r t + q i q g o a l
The set satisfying Φ ( q i ) = c b e s t forms an ellipsoidal surface with q s t a r t and q g o a l as the foci. Nodes within or on this ellipsoid are considered efficient. If Φ ( q i ) > c b e s t , any path passing through q i will exceed the current optimal path length, as Φ ( q i ) provides a lower bound on feasible path length via q i . Therefore, such nodes are discarded to reduce memory usage and computational overhead.
Moreover, whenever the optimal path is updated, all existing nodes are re-evaluated. Nodes satisfying Φ ( q i ) > c b e s t are labeled as inefficient and excluded from subsequent nearest-neighbor and near-neighbor searches.
To further analyze the computational complexity of DASRRT*, the algorithm’s final node count is denoted as N node , and the average obstacle detection value is represented as C col . The number of nodes in the i -th iteration of the search tree is denoted as N i , and the number of nodes in the neighboring search area is k i . For the base RRT*, each iteration requires searching in the current node set and nearby nodes, where the number of nodes is related to N i ; similarly, the parent nodes need to choose and re-connect to the nearby nodes to perform collision detection. Therefore, the total computational complexity of the base RRT* is expressed as:
T R R T = O i = 1 N n o d e N i + k i C c o l
where:
i = 1 N n o d e N i = 1 + 2 + + N n o d e = N n o d e N n o d e + 1 2
Under normal conditions, k i < N i , and since the collision detection in each iteration is constant, the time complexity of RRT* is approximately:
T R R T = O N n o d e 2
DASRRT* incorporates low-efficiency node optimization into the base algorithm. In the i -th iteration, the number of effective nodes is denoted as N i a , where N i a N i . Ineffective nodes are no longer considered in the subsequent search or nearby search operations. Therefore, the actual search complexity of DASRRT* can be expressed as:
T D A S R R T = O i = 1 N n o d e N i a + k i a C c o l + u = 1 U N u
where U represents the number of times the optimal path has been updated, and N u represents the number of nodes updated each time. Compared with RRT*, DASRRT* updates the nodes of the optimal path after each update and then performs low-efficiency node pruning. Since the number of optimal path updates is typically much smaller than the total number of iterations, this term does not dominate the overall complexity in practice. Let the proportion of valid nodes be:
α i = N i a N i ,     0 < α i < 1
The actual search complexity of DASRRT* is approximated as:
T D A S R R T = O α i N n o d e 2
From a strict asymptotic perspective, if α i is considered constant, the worst-case time complexity of DASRRT* remains O ( N n o de 2 ) . Inefficient node optimization primarily reduces the node size and complexity coefficient in the actual search, thereby decreasing the computational overhead to some extent.
The implementation of the inefficient node optimization strategy is shown in Figure 6. By pre-screening and eliminating inefficient nodes, the total number of nodes is reduced, thereby improving computational efficiency. Since these nodes no longer participate in subsequent expansions, the growth of the tree is restrained, leading to improved memory utilization.

3.1.4. Path Optimization Strategy

Path Pruning
Utilizing the maximum leap method, an initial path π = { q 1 , q 2 , , q N } is pruned by traversing backward from the end node q N for each node q i to identify the furthest collision-free node q j ( j > i ) for direct connection, thereby significantly shortening the total path length. The optimized path π is defined as follows:
π = i = 1 N q i
where q i + 1 = m a x { j ( i , N ] C ( q i , q j ) = True } . C ( q i , q j ) = True indicates that the straight-line segment connecting q i and q j is collision-free.
The specific steps are as follows:
Step 1: Initialization. Set π = { q 1 } and initialize the current index i = 1 .
Step 2: Backward Search. Traverse backward from the end point q N to find the furthest node q j ( j > i ) that satisfies C ( q i , q j ) = True .
Step 3: Path Update. Append q j to π and update the current index i = j .
Step 4: Termination. Repeat Steps 2 and 3 until q j = q N .
The aforementioned path pruning operation selects the maximum feasible leap at each step, ensuring that the total path length decreases monotonically and that optimality is effectively improved, as illustrated in Figure 7.
Path Smoothing
To mitigate the issue of sharp turns within the pruned path, an iterative path smoothing algorithm is proposed. By optimizing path continuity and smoothness, this method effectively enhances the path-tracking performance of the UAV formation.
(1)
Objective Function Design
Given a set of discrete, collision-free path points after pruning, π = { q 1 , q 2 , , q N } , the objective is to solve for a new trajectory that ensures both smoothness and obstacle avoidance.
To guarantee trajectory smoothness, the second-order difference of path points—representing discrete acceleration—is minimized. For a sequence of discrete points, this second-order difference is approximated as Δ 2 q i = q i 1 2 q i + q i + 1 . Accordingly, the objective function of the smoothing term is defined as follows:
J s π = i = 1 N q i 1 2 q i + q i + 1 2
To prevent over-smoothing that might cause the trajectory to penetrate obstacles, a penalty is imposed on the distance between the optimized point q i n e w and the original reference point q i . Accordingly, the objective function of the penalty term is defined as follows:
J p π = i = 1 N w i q i q i n e w 2
The final composite objective function to be minimized is formulated as follows:
J π = λ s J s π + λ p J p π
(2)
Solution Methodology
To facilitate an efficient solution, the aforementioned summation is reformulated into a matrix representation. Let π = [ q 1 , q 2 , , q N ] T denote the trajectory matrix to be determined.
For the smoothness term, the second-order difference operator can be expressed in the following tridiagonal matrix form:
A = 1 h 2 2 1 0 0 1 2 1 0 1 2 0 1 0 0 1 2 n × n
where h denotes the spatial discretization step size, N denotes the number of path points, and n = N 2 (as the start and end points of the path cannot serve as intermediate nodes for acceleration calculations). Accordingly, the smoothness objective function is expressed as follows:
J s = π T A T A π
For the distance penalty term, the weight assigned to each path point is represented in the following matrix form:
W = w 1 0 0 0 0 w 2 0 0 0 w 3 0 0 0 0 0 w n n × n
where w i denotes the distance deviation weight for the i -th path point. Let the updated path trajectory be denoted by π new . The objective function for the distance deviation is calculated as follows:
J p = π π n e w T W π π n e w T
To obtain the optimal trajectory, we seek π such that J ( π ) = 0 . Expanding the total cost function and differentiating with respect to π yields:
J π = λ S A T A π + λ P W π π n e w = 0
Rearranging the terms results in the following system of linear equations:
λ S A T A + λ P W π = λ P W π n e w
The final solution for π minimizes the combined sum of the second-order differences and the distance deviations of the path points.
(3)
Solution Procedure
The iterative procedure for smoothing the initial path is summarized as follows:
Step 1: Initialization. Assign initial values to the weights w i for all path points.
Step 2: Optimization. Solve the system of linear equations based on the current weight matrix W to obtain the trajectory π new .
Step 3: Collision detection. Traverse each point in π new to determine if it resides within any obstacle O . Points found to be in collision are added to the set C .
Step 4: Weight update. If C is non-empty, increase the distance deviation penalty weights for the colliding nodes and their neighboring points.
Step 5: Termination condition. Repeat Steps 2 through 4 until C = or the maximum number of iterations is reached.

3.2. Local Cooperative Control

This section develops internal collision avoidance, external obstacle avoidance, and formation cooperative control laws. Under the governance of these control laws, each UAV tracks the virtual leader. The integrated formation flight control architecture is illustrated in Figure 8.

3.2.1. Collision-Avoidance Control Law

To prevent collisions caused by close proximity and velocity differences among UAVs during formation flight, a collision-avoidance control law is designed. By introducing a relative-velocity damping term on the basis of the conventional distance-based repulsive force, the proposed method suppresses oscillations while maintaining a safe separation distance, thereby improving stability during dense formation maneuvers.
The repulsive potential energy is defined as:
U c p j i = 1 2 k 1 c p j i r s 2
The repulsive force exerted by the j -th UAV on the i -th UAV is derived as:
F j i c = p i U c = d U c d p j i d p j i d p i = k 1 c p j i r s 3 p j i p j i
Consequently, the total collision-avoidance force F i c acting on the i -th UAV is given by:
F i c = j = 1 , j i N k 1 c p j i r s 3 p j i p j i k 2 c v j i
where k 1 c , k 2 c denote the repulsive gain coefficients, which regulate the influence of the position error and velocity damping terms, respectively. p j i denotes the position difference vector between UAV j and i , and v j i denotes their relative velocity difference vector. r s denotes the safety distance of the UAV formation. In the expression, the first term represents the positional repulsion responsible for maintaining inter-UAV distances, while the second term provides velocity damping to effectively suppress relative velocities and minimize oscillations.

3.2.2. Obstacle-Avoidance Control Law

To enhance the obstacle-avoidance capability of the formation in complex environments with dynamic obstacles, an obstacle-avoidance control law is designed. Based on the artificial potential field method, the proposed law incorporates a goal-attraction factor and a velocity-adaptive mechanism, effectively alleviating the problems of target inaccessibility, local stagnation, and insufficient responsiveness to dynamic obstacles.
The repulsive potential energy exerted by obstacle o on UAV i is defined as:
U i o = 1 2 k 1 o 1 p i o 1 r s 2 p i g n ,     0 < p i o r u 0 ,     p i o > r u
where p i o denotes the distance from UAV i to obstacle o , r u denotes the detection radius of the UAV, and p i g denotes the distance from UAV i to the goal point g .
(1)
Target Attraction Factor
By introducing the term p i g n , the repulsive force decays concurrently with the attractive force as the UAV approaches the goal ( p i g 0 ). Upon reaching the destination, the repulsive force becomes zero, effectively resolving the issues of target unreachability and local stagnation.
(2)
Velocity-Adaptive Weighting
k 1 o = k 2 o 1 + k 3 o e 1 1 + v k o
where k 2 o and k 3 o are weight adjustment parameters. The gain k 1 o is coupled with the obstacle’s velocity; a higher obstacle velocity v k o results in a larger gain k 1 o , enabling a rapid response to high-speed dynamic obstacles.
Based on the modified repulsive potential function, the corresponding obstacle-avoidance control force can be derived as follows:
F i o f = p i U i o = U i o p i o p i o p i + U i o p i g p i g p i
To ensure system stability, a velocity damping term is incorporated:
F i o v = k 4 o v i
The total control force for the i -th UAV is then obtained as:
F i o = F i o f + F i o v
The repulsive force analysis of UAV i under the obstacle-avoidance control law is illustrated in Figure 9.

3.2.3. Formation Cooperative Control Law

To ensure stable tracking and formation consistency in complex environments, a distributed cooperative controller based on a virtual leader is designed. By integrating position errors, velocity errors, and communication topology information, the proposed method enhances formation consistency maintenance and formation recovery during obstacle-avoidance maneuvers.
The virtual leader is the core of global path tracking, with position p 0 and velocity v 0 . The desired position of UAV i is defined as p i d = p 0 d i , where d i = [ d i x , d i y , d i z ] T denotes the position offset of the i -th UAV relative to the leader. The position and velocity tracking errors of UAV i are defined as:
e i p = p i p i d e i v = v i v i d
Based on the distributed architecture and multi-agent consensus theory, the formation control input F i f is designed as:
F i f = k 1 f j = 1 n a i j e i p e j p k 2 f j = 1 n a i j e i v e j v k 1 f a i 0 e i p k 2 f a i 0 e i v
where a i j is an element of the adjacency matrix, indicating the communication link between UAVs i and j ( a i j = 1 if connected, otherwise 0); a i 0 denotes the connection status between UAV i and the virtual leader; k 1 f > 0 is the position error feedback gain, which primarily adjusts the convergence speed of the formation position; k 2 f > 0 is the velocity error feedback gain, which mainly adjusts velocity consistency and damping characteristics, used to suppress oscillations and improve convergence stability.
Figure 10 illustrates the evolution of the UAV formation state under the coordinated action of the three control laws. In open areas, the cooperative formation controller ensures stable formation maintenance. When dynamic obstacles appear, the external obstacle-avoidance control law dominates trajectory adjustment to achieve safe avoidance. Upon entering a narrow passage, the internal collision-avoidance control and the cooperative formation control act jointly, driving the formation to transition from its original configuration to a compact shape suitable for passage. After clearing the obstacle region, the formation returns to a stable state.

3.3. System Cooperative Mechanism

3.3.1. Virtual Leader

In conventional leader–follower architectures, maneuvering errors or failures of a physical leader propagate to followers, posing a threat to overall formation stability. To mitigate this single-point-of-failure risk, a virtual leader–follower strategy is adopted. The virtual leader generates the formation trajectory in real time based on environmental information and the path produced by the DASRRT* algorithm (Section 3.1), while follower UAVs track its motion via the cooperative formation control law (Section 3.2.3). Driven by multi-objective control inputs, the virtual leader dynamics are formulated as follows:
p 0 ˙ = v 0 v 0 ˙ = γ 1 v 0 + F v i r t u a l = γ 1 v 0 + F a t t + F r e p + F f o r m
F a t t = k a t t s l o c a l p 0
F f o r m = k f o r m 1 N i = 1 N p i p 0
where γ 1 denotes the velocity damping factor used to suppress oscillations, F a t t represents the target attraction force, s l o c a l denotes a local target point dynamically selected along the global path in real-time (Section 3.3.2), k a t t denotes the attractive gain coefficient, F r e p denotes the obstacle repulsive force, and F f o r m denotes the formation center regression force. The dynamic gain coefficient k f o r m is computed as follows:
k f o r m = k f o r m 0 e γ 2 1 p 0 p g o a l ,     p 0 p g o a l > δ g o a l 0 ,     otherwise
where k f o r m 0 denotes the baseline regression gain, γ 2 denotes the attenuation factor, and δ g o a l denotes the target distance threshold. As the leader approaches the final destination, formation constraints are gradually relaxed to avoid target inaccessibility.
The forces acting on the virtual leader are illustrated in Figure 11.

3.3.2. Local Target Selection Strategy

To address the limited adaptability of fixed-step local target switching in complex environments, a curvature-driven dynamic step-length strategy is proposed to smooth formation speed, mitigate oscillations caused by a constant step size, and improve overall formation stability.
(1)
Curvature-driven step-length adjustment
When the virtual leader tracks the global path, the local target point p l o c a l is adjusted dynamically according to the local path curvature k . An adaptive step length Δ s is designed to select p l o c a l in real time.
s = s m i n + s m a x s m i n 1 1 + e α k s k
where Δ s m i n is the minimum step length, Δ s m a x is the maximum step length, α is the curvature coefficient, and k is the curvature threshold. k ( p a t h ) denotes the path curvature, which characterizes the degree of bending; s is the arc length. Larger k ( s ) indicates sharper turns, while k ( s ) 0   implies the path approaches a straight line. In high-curvature regions k ( s ) k t h , denser sampling is required to improve obstacle-avoidance accuracy and ensure dense waypoints at sharp turns to prevent collisions; in low-curvature regions k ( s ) < k t h , sampling can be sparser to improve efficiency and accelerate tracking along straight segments.
(2)
Local Target Selection
For path tracking, the virtual leader moves along the optimized global path and dynamically selects the local target point p l o c a l . The procedure is as follows.
First, compute the Euclidean distance from the virtual leader’s current position p 0 to the path π and determine the nearest path point:
p n e a r e s t = a r g min k p 0 p k 2
Then, starting from p n e a r e s t , move forward along the path by the adaptive step length Δ s :
p t a r g e t = p n e a r e s t + Δ s
where p t a r g e t is the local target point. When the distance between p n e a r e s t and the goal is less than Δ s ( p n e a r e s t ) , the next local target is the goal.

3.3.3. Dual-Mode Switching Mechanism

To meet formation control requirements in complex terrain, a dual-mode switching mechanism is proposed, and mode switching is triggered by the environmental complexity η . The environmental complexity η is defined as the obstacle density within a local region:
η = 1 N o b s o O i 1 p i p o + ε
where N o b s is the number of obstacles within the sensing range, ε is a small positive constant to avoid a zero denominator, and O i is the set of obstacles within the sensing radius r u of UAV i , i.e., O i = { o p i p o R s e n s e } . A larger η indicates a more complex environment, meaning obstacles are denser around the UAV (e.g., narrow corridors or obstacle clusters).
The switching logic is defined as:
M o d e = formation maintenance   mode ,     η η 1   and   e i p δ s a f e emergency avoidance   mode ,     η > η 1   or   e i p > δ s a f e    
where η 1 is the environmental complexity threshold; e i p = p i ( p 0 + d i ) is the position error between the actual and desired locations; δ s a f e is the safety threshold for formation distance.
Formation Maintenance Mode (Mode 1)
The total control input of each UAV, F i ( t ) , is a weighted sum of the formation control force, the internal collision-avoidance force, and the external obstacle-avoidance force:
F i t = k u 1 F i f t + k u 2 j = 1 , j i N F j i c t + k u 3 o = 1 K F i o o t
where F j i c is the collision-avoidance control force between UAV i and its neighbor j ; F i o o is the obstacle-avoidance control force on UAV i from obstacle o ; F i f is the formation consensus control force. k u 1 , k u 2 , and k u 3 are weighting coefficients that balance the priorities between formation maintenance and collision/obstacle avoidance.
k u 1 is the weight of formation control. Its primary role is to enforce formation maintenance; in open environments it strengthens formation consensus to ensure accurate tracking of the desired shape led by the virtual leader. In narrow or obstacle-dense regions, reducing k u 1 weakens formation constraints and enhances collision/obstacle avoidance. Therefore, k u 1 is designed as an inverse proportional saturation function that adapts to the environmental complexity η :
k u 1 = m a x k 1 m a x 1 η η 1 , k 1 m i n
where k 1 m a x and k 1 m i n are the maximum and minimum weights of the formation control force, and η 1 is the environmental complexity threshold. As η 0 , k u 1 k 1 m a x , so formation control dominates; as η η 1 , 1 η / η 1 0 and k u 1 k 1 m i n , thereby reducing the formation control strength.
k u 2 and k u 3 are the weights for collision avoidance and obstacle avoidance, respectively, and are designed with linear and exponential variations:
k u 2 = k 2 0 1 + η η 1
k u 3 = k 3 0 η η 1 σ
where k u 2 increases linearly to enhance inter-UAV collision avoidance, and k u 3 increases exponentially to strengthen obstacle repulsion. The parameter σ controls the growth rate of the gain. For small σ (e.g., σ = 0.3 ), k u 3 rises sharply once η 1 is exceeded, which suits highly dynamic obstacle scenarios; for larger σ (e.g., σ = 1.0 ), the gain varies smoothly, which is suitable for environments with uniformly distributed obstacles.
Considering variations in environmental complexity across scenarios, the dynamic adjustment of k u 1 , k u 2 , and k u 3 balances safety and formation efficiency. Formation maintenance is prioritized in open environments, while collision and obstacle avoidance are prioritized in confined environments. The total control force of UAV i is shown in Figure 12.
Emergency-Avoidance Mode (Mode 2)
Using only the control law of formation maintenance mode may be insufficient in extreme, highly complex environments. Therefore, an emergency-avoidance mode is introduced to strengthen the goal-attractive and obstacle-repulsive forces. The control input is adjusted as:
F i t = k u 1 F i a t t t + k u 2 j = 1 , j i N F j i c t + k u 3 o = 1 K F i o o t
In this mode, the attractive force F i a t t consists of two components:
F i a t t = F i a t t 1 + F i a t t 2 = k a t t 1 p 0 p i + k a t t 2 p n e a r e s t p i
where F i a t t 1 is the attraction toward the virtual leader, driving the UAV to follow the leader’s position p 0 and maintain formation coherence; F i a t t 2 is the attraction toward the local path point, providing global-path guidance by steering the UAV toward the nearest reachable path point p n e a r e s t , thereby enhancing path-tracking robustness. k a t t r 1 and k a t t r 2 are the attraction gains.
In high-curvature regions, path points are dense and p n e a r e s t updates frequently, so the attraction direction adapts quickly to the path; in low-curvature regions, points are sparse and the attraction direction is more stable, reducing control oscillations. As the core driving force in the emergency-avoidance mode, F i a t t combines attraction to the virtual leader and the local path to ensure formation coherence and real-time avoidance in complex terrain.
The proposed dual-mode switching mechanism temporarily switches to the emergency-avoidance mode in particularly complex environments, where F i a t t dominates the cooperative control input to guide the UAVs to rapidly and effectively exit obstacle regions under the combined guidance of the virtual leader and the global path; otherwise, the formation maintenance mode is used.

4. Stability and Convergence Analysis

This chapter conducts a rigorous stability analysis of the control law proposed in Section 3.
Lemma 1 (LaSalle Invariance Principle). 
For a differentiable function  V  defined on  R n , if  V ( x ) 0  and  V ( x ) = 0  if and only if  x = 0 , and if  V ˙ ( x ) 0  for all  x R n , then as  t  the system trajectory  x ( t )  converges to the set  S = { V ˙ ( x ) = 0 } . If  S  contains no invariant set other than  0 , then the trajectory  x ( t )  is asymptotically stable [40].

4.1. Stability Analysis of the Collision-Avoidance Control Law

The collision-avoidance control law accounts for the relative positions and relative velocities among UAVs, ensuring that no collisions occur between any two UAVs. To rigorously establish the stability of the proposed control law and verify that the safety-distance constraint is always satisfied, we construct the following Lyapunov function:
V c t = 1 2 i = 1 N j = 1 , j i N U c p j i + 1 2 i = 1 N v i T v i
This Lyapunov function consists of a potential-energy term and a kinetic-energy term. Taking the time derivative yields
V c ˙ t = 1 2 i = 1 N j = 1 , j i N d U c d p j i d p j i d t + 1 2 i = 1 N v i ˙ T v i + v i T v i ˙ = 1 2 i = 1 N j = 1 , j i N k 1 c p j i r s 3 p j i T p j i ˙ p j i + i = 1 N v i T v i ˙ = 1 2 i = 1 N j = 1 , j i N k 1 c p j i r s 3 p j i T p j i ˙ p j i i = 1 N j = 1 , j i N v i T k 1 c p j i r s 3 p j i p j i i = 1 N j = 1 , j i N v i T k 2 c v j i
For the second term on the right-hand side of the last equality in (57), we analyze the subsystem composed of UAV i and UAV j . For a pair i , j without an edge, when i is included in the outer summation and j in the inner summation, the contribution to the subsystem total energy is
v i T k 1 c p j i r s 3 p j i T p j i
When j is included in the outer summation and i in the inner summation, the contribution to the subsystem total energy is
v j T k 1 c p i j r s 3 p i j T p i j = v j T k 1 c p j i r s 3 p j i T p j i
Since the forces acting on the two UAVs have equal magnitude and opposite direction, we have:
v i T k 1 c p j i r s 3 p j i T p j i = 1 2 v i T + v j T k 1 c p j i r s 3 p j i T p j i = 1 2 k 1 c p j i r s 3 p j i T p j i v j i
Substituting (60) into (57) yields
V c ˙ t = i = 1 N j = 1 , j i N v i T k 2 c v j i = i , j E k 2 c v i T v j v i + v j T v i v j = i , j E k 2 c v j v i T v j v i = i , j E k 2 c v j i 2 0
From (61), it follows that V ˙ c ( t ) 0 , and from (56), V c ( t ) > 0 . According to LaSalle’s invariance principle, the system asymptotically converges to the largest invariant set satisfying V ˙ c ( t ) = 0 , and V c ( t ) V c ( 0 ) . When p j i r s , V c ( t ) , which contradicts the boundedness established above. Therefore, if the initial inter-UAV distances exceed the prescribed safety distance, collisions will not occur.

4.2. Stability Analysis of the Obstacle-Avoidance Control Law

To demonstrate that the UAV can safely avoid obstacles under the obstacle-avoidance control law and ultimately converge to the target point, the following Lyapunov function is constructed:
V o , i t = U i o p i + 1 2 v i T v i
The first term represents the obstacle-repulsive potential energy, while the second term corresponds to the kinetic energy. Taking the time derivative gives
V ˙ o , i ( t ) = U i o p i + 1 2 v i T v i = p i U i o v i + v i T p i U i o k 4 o v i = k 4 o v i 2 0
From (63), the system energy is non-increasing, i.e., V ˙ o , i ( t ) 0 , and V o , i ( t ) > 0 . Consequently, the system asymptotically converges to the largest invariant set satisfying V ˙ o , i ( t ) = 0 , with V o , i ( t ) V o , i ( 0 ) . Hence, the potential energy term remains bounded. When the distance between the UAV and the obstacle approaches zero, V o , i ( t ) , which contradicts the boundedness established above. It follows that, during formation flight, the obstacle-avoidance control law guarantees that the UAV does not collide with obstacles.

4.3. Stability Analysis of Formation Errors Under the Control Law

In actual formation flight, UAVs are not solely influenced by a single type of control force, but instead move under the combined influence of formation coordination control forces, inter-UAV collision-avoidance forces, and external obstacle-avoidance forces. Therefore, this section introduces collision-avoidance and obstacle-avoidance forces as active evasion inputs into the formation error system, and combines them with the formation coordination control law. The boundedness and convergence recovery of the errors under the overall control law are analyzed from the perspective of the overall closed-loop system.
According to Equation (50), the total control force on the i -th UAV during formation flight is:
F i = k u 1 F i f + k u 2 j = 1 , j i N F j i c + k u 3 o = 1 K F i o o
The avoidance inputs are expressed as:
d i = k u 2 j = 1 , j i N F j i c + k u 3 o = 1 K F i o o
Define position error as e p = [ ( e 1 p ) T , ( e 2 p ) T , , ( e N p ) T ] , and velocity error as e v = [ ( e 1 v ) T , ( e 2 v ) T , , ( e N v ) T ] . The main avoidance input is d = [ d 1 T , d 2 T , , d N T ] . Combining the concepts in Section 2, the formation error system is written as:
e p ˙ = e v   e v ˙ = k 1 f L + H I 3 e P k 2 f L + H I 3 e v + d
where L is the Laplacian matrix of the communication topology, and H represents the connection matrix between the leader and followers. The symbol indicates the Kronecker product, and I 3 is the 3D identity matrix. When the UAVs are in communication and can efficiently receive the leader’s information, L + H is positive definite, i.e., λ min ( L + H ) > 0 .
First, analyze the avoidance input when d = 0 , so the formation error system can be written as:
e p ˙ = e v e v ˙ = k 1 f L + H I 3 e P k 2 f L + H I 3 e v
For the Lyapunov function corresponding to Equation (67), we construct:
V f = 1 2 k 1 f e p T L + H I 3 e p + 1 2 e v T e v
Since L + H is positive definite and k 1 f > 0 , we have:
V f > 0
From Equation (68), we get:
V f ˙ = k 1 f e p T L + H I 3 e p ˙ + e v T e v ˙ = k 1 f e p T L + H I 3 e v + e v T k 1 f L + H I 3 e P k 2 f L + H I 3 e v = k 2 f L + H I 3 e v 0
As seen from (70), V f is not an increment. According to LaSalle’s invariance principle, the system’s trajectory will eventually converge to the largest invariant set where V f = 0 . When e v = 0 , we substitute into Equation (67) to get k 1 f ( L + H ) I 3 e P = 0 . Since k 1 f > 0 , and ( L + H ) I 3 is positive definite, it follows that e p = 0 . Therefore, under the condition of zero avoidance input, the formation control law’s stability can be ensured:
lim t   e p t = 0 ,     lim t e v t = 0
Next, we analyze the case with non-zero avoidance input, d 0 . In this case, from Equation (66), the formation error system can be written as:
V f ˙ = k 2 f L + H I 3 e v + e v T d
From Equation (64), when active collision-avoidance forces and obstacle avoidance forces are present, the term e v ) T d acts as an external input to the error system. Under these conditions, it cannot be deduced that V ˙ f 0 , nor can it be directly proven that the tracking error strictly asymptotically converges to zero throughout the entire obstacle-avoidance process. In fact, during the obstacle-avoidance phase, the UAVs need to temporarily deviate from the desired formation to satisfy the constraints on inter-UAV safety distance and obstacle safety distance. Therefore, the occurrence of short-term fluctuations in the tracking error is reasonable.
To further demonstrate the role of avoidance input in affecting the error dynamics, Equation (66) is rewritten in state-space form as:
ξ ˙ = A f ξ + B f d
This leads to:
e p ˙ e v ˙ = 0 I 3 N k 1 f L + H I 3 k 2 f L + H I 3 e p e v + 0 I 3 N d
From the analysis of the error system above, it is known that when L + H is positive definite and k 1 f > 0 , k 2 f > 0 , the matrix A f is a Hurwitz matrix. Therefore, there exist positive constants c > 0   and α > 0 such that:
e A f t c e α t
If the avoidance input is bounded, i.e., there exists a positive constant d ¯ satisfying:
d t d ¯
Then Equation (73) yields:
ξ t = e A f t ξ 0 + 0 t e A f t τ B f d τ d τ
Then we have:
ξ t c e α t ξ 0 + 0 t e A f t τ B f d τ d τ c e α t ξ 0 + c B f α d ¯
From Equation (78), it can be seen that the formation tracking error will not diverge, but remains within a bounded neighborhood related to d ˉ .
In summary, the overall control law designed exhibits the following stability characteristics in the closed-loop system: in the absence of evasion inputs, the formation error asymptotically converges to zero; when evasion inputs are present, the control force—as an external input—causes the UAVs to temporarily deviate from the desired formation, but the formation error remains bounded; once the UAVs move away from the obstacle, the formation tracking error recovers and asymptotically converges to zero. This conclusion aligns with actual flight behavior: when the formation enters an area with complex obstacles, it cannot fully maintain its original formation and must prioritize obstacle avoidance; the formation tracking error may temporarily increase but remains within a controlled range; after leaving the obstacle area, the formation is able to recover and maintain its original formation.

5. Simulation Experiments

The simulations were conducted on a laptop running the Windows 11 operating system (Intel(R) Core(TM) i7-10750H processor). All programs were implemented in MATLAB R2022b. In addition, to further verify the feasibility and closed-loop operational capability of the proposed method under conditions closer to practical system deployment, a Gazebo-based hardware-in-the-loop simulation platform was established, as shown in Figure 13. The platform consists of a host computer, a Pixhawk 2.4.8 flight controller, an RK3588-based onboard computing unit, the QGroundControl (QGC) ground control station, and the Gazebo simulation environment. Specifically, the host computer is responsible for running the Gazebo scenario, ROS/MAVROS communication nodes, and the state-monitoring interface; the RK3588 onboard computing unit is used to deploy the formation control, trajectory tracking, and obstacle-avoidance algorithms; the Pixhawk flight controller handles low-level attitude stabilization and position control; and QGC is used for flight-state monitoring and mission management. Closed-loop interaction of state information, control commands, and simulation data among the modules is achieved through MAVLink and ROS communication, thereby forming an integrated verification chain of “simulation environment–onboard computing–flight control–ground monitoring.”
Considering the characteristics of low-altitude combat environments, a three-dimensional integrated simulation scenario containing multiple heterogeneous obstacles was constructed. The scene replicates a typical complex terrain characterized by constrained spatial structures and dynamic threats. The static environment includes U-shaped obstacles, narrow passages, walls with windows, and clusters of tree-like obstacles. In addition, randomly moving cylindrical dynamic obstacles are introduced to emulate unknown threats.

5.1. Simulation Validation of the Path Optimization Algorithm

5.1.1. Comparative Experiments

In this section, the proposed DASRRT* algorithm is compared with the RRT* algorithm, the Informed RRT* algorithm [41], the RRT*-APF algorithm [42], the RRT*-PRIME algorithm [43], and the BIT* algorithm. The simulation is conducted in a three-dimensional space of 150 m × 60 m × 20 m . The leader UAV starts from 2   m , 30   m , 5   m and the target position is set to 145 m , 30 m , 5 m . To ensure the fairness and reproducibility of the comparison experiments, the common parameters for the RRT* series algorithms are given as follows: maximum number of iterations N max = 7000 , base extension step size δ max = 2 m , neighborhood rewire radius r rewire = 10   m , goal arrival threshold ϵ goal = 3 m , and obstacle safety margin δ safe = 0.8 m . In addition, the specific parameters for each comparison algorithm are listed in Table 1.
In Table 1, P g is the target bias sampling probability; γ I R R T is the dynamic neighborhood radius adjustment coefficient for Informed RRT*; k APF , r u , and α APF are the APF repulsive gain, obstacle influence radius, and APF sampling point correction step size in RRT-APF*, respectively. w 1 , w 2 , and w 3 are the weights for distance, direction consistency, and obstacle distribution; P tar is the heuristic probability threshold; K cand is the number of candidate directions; and θ bias is the angular bias range. w 4 , w 5 , and w 6 are the weights for path length, obstacle safety, and smoothness; C th and E th are the cost growth threshold and emergency adjustment threshold, respectively; γ 1 , γ 2 , and κ are used for obstacle density estimation. In BIT*, N s is the maximum number of sampling points, N b is the batch size for sampling, η BIT is the connection radius adjustment coefficient, and r min and r max are the minimum and maximum connection radii, respectively. In DASRRT*, P f is the hybrid guided sampling probability, ρ and λ are the scaling factor and shape parameter in dynamic focus sampling, β is the perceptual adaptive step size sensitivity parameter, Δ s smooth is the path smoothing sampling interval, and δ min is the adaptive step size lower limit.
Regarding the termination conditions, RRT*, Informed RRT*, RRT-APF*, RRT-PRIME*, and DASRRT* all stop after reaching the maximum iteration count of N max = 7000 . For the BIT* algorithm, due to its use of batch sampling and graph search mechanism, which differs from the point-by-point sampling strategy of the RRT* series algorithms, the termination condition is set to a cumulative number of sampling points reaching 7000 to align the total sampling scale with that of the RRT* series algorithms.
As shown in Figure 14, although all comparative algorithms are able to find feasible paths in a complex three-dimensional environment, the resulting paths exhibit pronounced piecewise polyline characteristics. Owing to the large turning-angle discontinuities along these paths, UAVs are often required to perform frequent aggressive acceleration, deceleration, and large attitude adjustments during tracking, which not only increases control difficulty but also leads to higher energy consumption. In contrast, the path generated by DASRRT* is smoother. By introducing a path optimization strategy, the proposed algorithm effectively eliminates abrupt turns while maintaining a relatively short path length, making it more suitable as a reference trajectory for UAV formation tracking control.
To further reveal the fundamental differences among the algorithms in spatial search behavior, Figure 15 presents the evolution of the expansion trees at 1/3, 2/3, and 3/3 of the total iterations. Although Informed RRT* reduces the search region through elliptical heuristic sampling, its expansion tree still exhibits a relatively high node density. RRT*-APF shows a certain degree of directionality under potential-field guidance, but its overall expansion process remains highly stochastic. Although RRT*-PRIME has an advantage in path length, its expansion tree becomes extremely dense at the final iteration stage, indicating that a substantial amount of computational resources is consumed by repeated exploration in non-optimal regions. In contrast, the expanded trees of BIT* and DASRRT* exhibit a more pronounced goal-oriented nature, with DASRRT* demonstrating superior performance in terms of path length and smoothness. Consequently, DASRRT* not only significantly reduces tree size and computational overhead but also generates smooth, high-quality paths while maintaining high search efficiency.
Given the inherent randomness of sampling-based algorithms, results from a single trial are insufficient for an objective assessment of robustness. Therefore, a Monte Carlo simulation was conducted, where each algorithm was independently repeated 50 times under the same environment. For each performance metric, the mean, standard deviation, and 95% confidence interval were calculated, and a t-test was performed between DASRRT* and each comparison algorithm. A difference was considered statistically significant when p < 0.05 . The statistical results are shown in Table 2 and Table 3.
As shown in Table 2 and Table 3, the average path length of DASRRT* is 161.13 m, which is reduced by 3.54%, 2.66%, 1.84%, and 1.36% compared with RRT*, Informed RRT*, RRT*-APF, and BIT*, respectively. The path cost differences between DASRRT* and RRT*, Informed RRT*, and RRT*-APF are statistically significant. While RRT*-PRIME has the shortest average path, its node count and solving time are 5276.53 and 49.83 s, which are significantly higher than those of DASRRT*. DASRRT* has an average node count of 2479.27, which is significantly lower than all comparison algorithms, and the solving time is the shortest, with corresponding p-values all less than 0.05. This indicates that the proposed inefficient node optimization strategy effectively suppresses redundant node growth and improves solving speed. Regarding memory requirements, taking RRT* as an example, both RRT* and DASRRT* need to store node positions, parent node indices, and path costs, so the theoretical memory complexity is O ( N node ) . DASRRT* introduces an additional inefficient node marking variable, slightly increasing memory usage per node. However, since the number of nodes is reduced by about 42.27%, the overall memory requirement is reduced. In terms of path smoothness, the average curvature and maximum turning angle of DASRRT* are significantly lower than those of all comparison algorithms, indicating that the proposed path optimization strategy effectively reduces the angularity and sharp turns in the sampled path, making the generated path more suitable as a reference trajectory for subsequent UAV formation tracking and cooperative control.

5.1.2. Ablation Studies

To systematically evaluate the individual contributions and synergistic effects of the improved modules in the DASRRT* algorithm, comprehensive ablation experiments were conducted under the same simulation environment. All methods used identical parameter settings and were independently executed 50 times in the same scenario, and the averaged results are computed to mitigate the impact of randomness. For clarity, the following five modules are defined: A: baseline RRT* algorithm; B: hybrid guided sampling strategy; C: perception-based adaptive step size strategy; D: inefficient node optimization strategy; E: path optimization strategy.
Table 4 quantitatively compares the results of 12 ablation combinations, where Group 12 (A + B + C + D + E) corresponds to the complete DASRRT* algorithm. Figure 16 provides an intuitive illustration of the comparison results of 12 groups under different indicators.
By analyzing the results of the ablation experiment, using Group 1 as the reference, the incremental effects of each individual module are as follows:
Module B (Hybrid Guided Sampling): It provides some improvement in path length, but its main contribution lies in guiding the sampling points to focus on effective regions, laying the foundation for multi-module collaboration.
Module C (Perception-Adaptive Step Size): It shows good improvement in node count and solving time, indicating that this strategy effectively reduces invalid expansion in complex environments and improves search efficiency.
Module D (Inefficient Node Optimization): Significant improvements are seen in node count and solving time, validating the effectiveness of real-time redundant node pruning in suppressing the expansion of the search tree. This significantly reduces computational overhead while maintaining the path quality largely stable.
Module E (Path Optimization): It mainly affects the trajectory post-processing phase, with the most notable improvements in the maximum turning angle and average curvature, as well as further improvement in path length.

5.2. Simulation Validation of the Formation Control Algorithm

In this section, the proposed control algorithm is validated through simulations. The UAV formation consists of five UAVs, denoted as follower U1, follower U2, follower U3, follower U4, and follower U5. The virtual leader U0 flies along the trajectory planned by DASRRT*. U1 tracks the virtual leader, while the remaining followers track U1 and maintain a V-shaped formation with a rear included angle of 45 . The formation information is listed in Table 5, the parameters of the dynamic obstacles are given in Table 6.
Figure 17a illustrate the flight trajectories of the UAV formation in three-dimensional space. Using the proposed algorithm, the UAVs successfully and safely traversed the complex environment, with a total flight time of 158 s. In the initial stage, the environment is relatively open, allowing the UAV swarm to maintain the V-shaped formation. Upon entering the obstacle region, under the dual-mode switching mechanism, each UAV responds rapidly to environmental changes and independently plans its obstacle-avoidance trajectory. After passing through the obstacle region, the UAVs quickly regain and maintain the desired V-shaped formation and reach the target point. The coordinated effect of the proposed dual-mode switching mechanism and the control law ensures both individual flight safety and formation integrity at the mission level. Figure 17b presents snapshots of key moments during the formation flight on the Gazebo platform. It can be seen that the UAV formation successfully completes takeoff, obstacle traversal, and arrival at the destination, indicating that the proposed method can be reproduced on the Gazebo platform. This further verifies the implementability of the algorithm and its potential for engineering applications.
Figure 18, Figure 19 and Figure 20 illustrate the dynamic relationship among the environmental complexity η , mode switching, and the control-weight coefficients during flight. As shown in Figure 19, the formation flight undergoes two distinct transitions between obstacle avoidance and formation recovery. When the formation approaches a narrow passage or a densely cluttered mixed-obstacle region, the local environmental complexity increases and η exceeds the threshold, causing the system to switch from the formation maintenance mode to the Emergency-Avoidance Mode. After passing through the obstacle region, η falls below the threshold, and the system returns to the formation maintenance mode. As further illustrated in Figure 20, the variation in environmental complexity not only triggers mode switching, but also directly affects the allocation of control weights. In the formation maintenance mode, k u 1 dominates, while k u 2 and k u 3 remain relatively small, so the system mainly focuses on maintaining the V-shaped formation. In the Emergency-Avoidance Mode, as η increases, k u 1 decreases whereas k u 2 and k u 3 increase, with k u 3 showing a more pronounced response in highly cluttered regions. This indicates that the control focus shifts from formation constraints to obstacle avoidance and collision avoidance. After clearing the obstacle region, the formation reconverges to the desired configuration. The results show that the designed dual-mode switching mechanism and dynamic weight adjustment strategy can autonomously adjust the control law weights based on environmental complexity, achieving an efficient balance between formation maintenance and flight safety.
The environmental complexity threshold is set based on multiple simulation experiments and an analysis of formation flight risk changes. To verify whether this switching strategy leads to frequent mode switching and control oscillations, the state changes during the flight were further statistically analyzed. Throughout the entire flight process, the system only experienced 4 mode switches, with an average of one switch every 39.4 s, and no high-frequency oscillation near the threshold was observed. The average formation recovery time was 2.8 s, and the maximum oscillation amplitude was 0.032946 m, indicating that the mode switching process did not cause significant control oscillations or flight instability. These results suggest that the set threshold effectively meets the stable switching requirements in this simulation scenario. In subsequent engineering deployments, the threshold switching logic can be further combined with a hysteresis interval to enhance robustness against sensor noise and transient disturbances.
As shown in Figure 21a, within the obstacle region, the minimum inter-UAV distance remains around 1 m, and no inter-agent collisions occur throughout the flight. This verifies the effectiveness of the inter-UAV collision-avoidance control law. Figure 21b shows that when the UAVs enter the densely cluttered area, the minimum distance between the formation and obstacles stays at approximately 2.5 m and never drops to zero at any time. This indicates that the improved obstacle-avoidance control law—by incorporating a distance-adaptive factor and a dynamic velocity weighting—provides sufficient repulsive action to ensure safety while maintaining motion toward the goal.
As shown in Figure 22, during the initial stage, the tracking errors of all UAVs rapidly converge to a small range near zero, verifying the fast convergence of the proposed control law. After entering the densely cluttered region, the system switches to the emergency-avoidance mode, and the priority on obstacle avoidance induces fluctuations in the tracking errors. Even during the narrow-passage traversal and dynamic avoidance phases, the mean error remains within a controlled range, while higher tracking accuracy is achieved in open areas. Notably, U1 exhibits a relatively large error around 90 s because it waits at the end of the narrow passage to avoid the first dynamic obstacle. The other UAVs perceive U1’s lag, move toward U1, and enter a waiting state. Once the dynamic obstacle passes, U1 immediately accelerates under the control input to catch up. Owing to the rapid convergence of the control law, the formation quickly returns to the prescribed configuration. The formation waiting stage is shown in Figure 23.
As shown in Figure 24a, the flight speed of all UAVs is strictly limited to a maximum of 3.5 m/s throughout the process. From Figure 24b,c, it can be observed that during the formation maintenance phase, the heading changes of all UAVs are generally consistent. However, during the obstacle-avoidance phase, both the heading angle and angular velocity show significant fluctuations, reflecting the UAVs’ rapid attitude adjustments to adapt to local obstacle constraints. The orderly parameter Φ is a core indicator of the degree of consistency in the formation’s speed and direction. As shown in Figure 24d, in the formation maintenance mode, Φ remains close to 1, indicating that the flight directions of all UAVs are highly consistent. In the obstacle-avoidance mode (e.g., around 18 s and 100 s), Φ significantly decreases, indicating that the UAVs have adopted differentiated avoidance actions. After the obstacle avoidance is completed, Φ quickly recovers to near 1, showing that the designed control framework has good cooperative recovery capability.
As shown in Figure 25a, the UAV formation becomes stalled while attempting to traverse the obstacle region formed by narrow windows. From Figure 25b, U4 fails to pass through the window in time and consequently departs from the formation. After t 100 s, all position errors converge to nearly constant values, indicating that the system enters a deadlock state: the resultant force becomes zero, causing the formation to halt. This demonstrates that, without the dual-mode switching mechanism, the cooperative control law alone cannot balance formation maintenance and obstacle avoidance in extremely constrained spaces.
To validate the effectiveness of the proposed improved APF in mitigating the issue of unreachable targets caused by local minima in the traditional APF, a standard APF control group was constructed, and a comparative experiment was conducted under the same conditions. This control group removed the dual-mode switching strategy, adaptive weight allocation, and the target distance and velocity coupling terms in the improved potential field, relying solely on the traditional APF repulsive force for external obstacle avoidance and inter-UAV collision avoidance.
As shown in Table 7 and Figure 26, although the APF does not lead to any collision, it fails to reach the target point and becomes trapped in the obstacle region, indicating that the traditional APF is prone to falling into local minima in complex obstacle environments. Its minimum obstacle distance is only 0.1187 m, and the average formation error is 6.9879 m, suggesting a low obstacle-avoidance safety margin and difficulty in balancing obstacle avoidance with formation maintenance. In contrast, the improved APF successfully reaches the target point, with the minimum obstacle distance increased to 1.9698 m and the average formation error reduced to 4.1844 m, indicating that the improved APF provides better obstacle-avoidance safety and formation maintenance capability in complex dynamic environments. The maximum oscillation amplitude of the improved APF is higher than that of the traditional APF, mainly because the improved APF successfully enters and traverses the subsequent narrow passage and dynamic-obstacle region, during which local trajectory variations become relatively larger due to obstacle avoidance. By contrast, the traditional APF becomes trapped before entering the subsequent obstacle region; therefore, the oscillation amplitudes of the two methods are not measured at the same motion stage, and a direct comparison is not entirely fair. The maximum oscillation amplitude of the improved APF remains within an acceptable range and does not cause collisions or mission failure, and can therefore be regarded as a necessary maneuvering response during complex obstacle avoidance. Overall, compared with the traditional APF, the improved APF demonstrates superior performance in task completion, local-minimum suppression, obstacle-avoidance safety margin, and formation maintenance capability.
To further verify the adaptability of the proposed hierarchical cooperative control framework under environmental disturbances and formation configuration changes, experiments are conducted from three aspects: initial disturbance, dynamic obstacle velocity variation, and formation scale variation. The results are shown in Table 8. Here, the average formation recovery time is defined as the average time it takes for the formation’s mean error to drop within the set threshold and remain there for several sampling steps after the system switches from Mode 2 to Mode 1.
In the initial disturbance experiment, Groups B and C achieved average formation errors of 3.5799 m and 3.703 m, respectively, both lower than the 4.15 m in the baseline scenario. The average recovery times were also shortened to 1.6 s and 0.9 s, indicating that the system can quickly absorb the formation deviation caused by the initial disturbance and restore cooperative flight. Although the minimum inter-UAV distances in both groups decreased, no collisions occurred, demonstrating that the controller maintains reliable safety constraints even under initial biases.
In the dynamic obstacle speed variation experiment, after adjusting the obstacle speed to 0.7 times and 1.3 times the baseline value in Groups D and E, the system still maintained zero collisions, with average formation errors further decreasing, and recovery times staying within a short range. In conditions with more frequent dynamic interactions, although the number of mode switches increased, the system was still able to quickly recover formation after safely avoiding obstacles. This indicates that the proposed dual-mode cooperative mechanism can adjust the control focus in response to time-varying environments and shows strong adaptability to changes in obstacle motion speed.
In the formation scale variation experiment, when the formation size was expanded from 3 UAVs to 7 and 9 UAVs, although the local interaction complexity increased significantly and both the minimum inter-UAV distance and minimum obstacle distance decreased, no collisions occurred in any of the scenarios. The average formation error and recovery time remained within acceptable ranges, demonstrating that the framework retains good task maintenance and cooperative recovery capabilities under scale variation conditions, reflecting a certain level of system scalability.

6. Conclusions

This paper addressed the coupling issues among global planning, local obstacle avoidance, and cooperative control for multi-UAV formations in complex urban dynamic environments. A hierarchical cooperative control framework based on a virtual leader–follower architecture was proposed. In the global planning layer, the DASRRT* algorithm was developed to overcome the limitations of traditional algorithms, including slow convergence, low expansion efficiency in narrow passages, and excessive turning angles in dense obstacle environments. The generated high-quality reference trajectories provided effective guidance for subsequent formation flight control. In the local obstacle avoidance layer, a distributed controller based on the improved APF method was designed to coordinate the control conflicts among inter-UAV collision avoidance, external obstacle avoidance, and formation maintenance. This controller improved formation consistency, stable tracking, and reconfiguration capability in complex dynamic environments. In the cooperative control layer, an environmental-complexity-based dual-mode switching mechanism was constructed to adaptively coordinate formation maintenance and emergency obstacle avoidance. Meanwhile, the real-time local target selection strategy enhanced tracking smoothness and robustness under complex path conditions. Simulation results show that DASRRT* achieved a maximum turning angle of only 5.11° and a final tree node count of 2479, representing an approximately 34–53% reduction compared with the other algorithms. These results indicate that the proposed method improved search efficiency and reduced the large attitude adjustments required to track paths with excessive turning angles. In complex urban scenarios with initial disturbances, obstacle speed changes, and formation scale variations, all test cases maintained collision-free operation, and the average formation error remained within 3.33–4.15 m. The average formation recovery time after mode switching was also relatively short. These results demonstrate that the proposed hierarchical cooperative control framework achieved strong robustness, environmental adaptability, and scalability.
Future work will focus on the real-time onboard implementation of the proposed framework in complex scenarios. In particular, computational efficiency, communication delay, sensor uncertainty, and hardware resource constraints will be further considered to improve the feasibility of deploying the method in real multi-UAV systems. In addition, learning-based alternatives, such as deep reinforcement learning methods for dynamic obstacle avoidance and adaptive decision-making, will be further investigated and compared with the proposed framework to evaluate their respective advantages in complex and uncertain environments.

Author Contributions

Conceptualization, Y.H.; methodology, J.W. and D.Y.; software, H.M.; validation, J.W. and D.Y.; formal analysis, J.W.; writing—original draft preparation, J.W. and D.Y.; writing review and editing, J.W. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by the Science Research Foundation of Educational Department of Liaoning Province under Grant No. JYTMS20230202.

Data Availability Statement

Dataset available on request from the authors.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Chung, S.-J.; Paranjape, A.A.; Dames, P.; Shen, S.; Kumar, V. A Survey on Aerial Swarm Robotics. IEEE Trans. Robot. 2018, 34, 837–855. [Google Scholar] [CrossRef]
  2. Song, J.; Zhao, K.; Liu, Y. Survey on Mission Planning of Multiple Unmanned Aerial Vehicles. Aerospace 2023, 10, 208. [Google Scholar] [CrossRef]
  3. Wang, X.; Zhao, Z.; Yi, L.; Ning, Z.; Guo, L.; Yu, F.R.; Guo, S. A Survey on Security of UAV Swarm Networks: Attacks and Countermeasures. ACM Comput. Surv. 2025, 57, 74. [Google Scholar] [CrossRef]
  4. Zheng, D.; Zhang, Y.; Li, F.; Cheng, P. UAVs Cooperative Task Assignment and Trajectory Optimization with Safety and Time Constraints. Def. Technol. 2023, 20, 149–161. [Google Scholar] [CrossRef]
  5. Gu, Y.; Guo, K.; Guo, L.; Qiao, J.; Jia, J.; Yu, X.; Xie, L. An Enhanced UAV Safety Control Scheme against Attacks on Desired Trajectory. Aerosp. Sci. Technol. 2021, 119, 107212. [Google Scholar] [CrossRef]
  6. Halder, S.; Ghosal, A.; Conti, M. Dynamic Super Round-Based Distributed Task Scheduling for UAV Networks. IEEE Trans. Wirel. Commun. 2023, 22, 1014–1028. [Google Scholar] [CrossRef]
  7. Rigatos, G.; Abbaszadeh, M.; Siano, P.; AL-Numay, M.; Cuccurullo, G.; Gao, Z. Nonlinear optimal and multi-loop flatness-based control for dual-UAV cooperative load transportation. J. Field Robot. 2025, 43, 2125–2158. [Google Scholar] [CrossRef]
  8. Wang, Z.; Hu, T.; Long, L. Multi-UAV Safe Collaborative Transportation Based on Adaptive Control Barrier Function. IEEE Trans. Syst. Man Cybern. Syst. 2023, 53, 6975–6983. [Google Scholar] [CrossRef]
  9. Han, D.; Jiang, H.; Wang, L.; Zhu, X.; Chen, Y.; Yu, Q. Collaborative Task Allocation and Optimization Solution for Unmanned Aerial Vehicles in Search and Rescue. Drones 2024, 8, 138. [Google Scholar] [CrossRef]
  10. Wu, J.; Luo, C.; Min, G.; McClean, S. Formation Control Algorithms for Multi-UAV Systems with Unstable Topologies and Hybrid Delays. IEEE Trans. Veh. Technol. 2024, 73, 12358–12369. [Google Scholar] [CrossRef]
  11. Debnath, D.; Vanegas, F.; Sandino, J.; Hawary, A.F.; Gonzalez, F. A Review of UAV Path-Planning Algorithms and Obstacle Avoidance Methods for Remote Sensing Applications. Remote Sens. 2024, 16, 4019. [Google Scholar] [CrossRef]
  12. Gao, J.; Pan, W. Research, Analysis, and Improvement of Unmanned Aerial Vehicle Path Planning Algorithms in Urban Ultra-Low Altitude Airspace. Aerospace 2024, 11, 704. [Google Scholar] [CrossRef]
  13. Zheng, Z.; Huang, H.; Li, C.; Yu, Y.; Wang, X.; Cai, J.; Huang, X.; Hu, S. A Hybrid Search Behavior-Based Adaptive Grey Wolf Optimizer for Cooperative Path Planning for Multiple UAVs. Sensors 2025, 25, 7657. [Google Scholar] [CrossRef]
  14. Merei, A.; Mcheick, H.; Ghaddar, A.; Rebaine, D. A Survey on Obstacle Detection and Avoidance Methods for UAVs. Drones 2025, 9, 203. [Google Scholar] [CrossRef]
  15. Ge, G.; Sun, M.; Xue, Y.; Pavlova, S. Transformer-Based Soft Actor–Critic for UAV Path Planning in Precision Agriculture IoT Networks. Sensors 2025, 25, 7463. [Google Scholar] [CrossRef]
  16. Bai, X.; Jiang, H.; Cui, J.; Lu, K.; Chen, P.; Zhang, M. UAV Path Planning Based on Improved A∗ and DWA Algorithms. Int. J. Aerosp. Eng. 2021, 2021, 4511252. [Google Scholar] [CrossRef]
  17. Xu, H.; Niu, Z.; Jiang, B.; Zhang, Y.; Chen, S.; Li, Z.; Gao, M.; Zhu, M. ERRT-GA: Expert Genetic Algorithm with Rapidly Exploring Random Tree Initialization for Multi-UAV Path Planning. Drones 2024, 8, 367. [Google Scholar] [CrossRef]
  18. Yu, J.; Piao, H.; Hou, Y.; Mo, L.; Yang, X.; Zhou, D. DOMA: Deep Smooth Trajectory Generation Learning for Real-Time UAV Motion Planning. Proc. Int. Conf. Autom. Plan. Sched. 2022, 32, 662–666. [Google Scholar] [CrossRef]
  19. Lindqvist, B.; Patel, A.; Löfgren, K.; Nikolakopoulos, G. A Tree-Based Next-Best-Trajectory Method for 3-D UAV Exploration. IEEE Trans. Robot. 2024, 40, 3496–3513. [Google Scholar] [CrossRef]
  20. Peng, Y.; Zhang, X.; Xie, H.; Xu, X. Hybrid Distributed and Decentralised Reinforcement Learning for Formation Control of Multi-Robots with Obstacle Avoidance. CAAI Trans. Intell. Technol. 2025, 10, 1337–1349. [Google Scholar] [CrossRef]
  21. Guerrero-Castellanos, J.F.; Vega-Alonzo, A.; Durand, S.; Marchand, N.; Gonzalez-Diaz, V.R.; Castañeda-Camacho, J.; Guerrero-Sánchez, W.F. Leader-Following Consensus and Formation Control of VTOL-UAVs with Event-Triggered Communications. Sensors 2019, 19, 5498. [Google Scholar] [CrossRef]
  22. Petracek, P.; Walter, V.; Baca, T.; Saska, M. Bio-Inspired Compact Swarms of Unmanned Aerial Vehicles without Communication and External Localization. Bioinspir. Biomim. 2021, 16, 026009. [Google Scholar] [CrossRef] [PubMed]
  23. Ding, W.; Zhang, L.; Zhang, G.; Wang, C.; Chai, Y.; Yang, T.; Mao, Z. Research on Obstacle Avoidance of Multi-AUV Cluster Formation Based on Virtual Structure and Artificial Potential Field Method. Comput. Electr. Eng. 2024, 117, 109250. [Google Scholar] [CrossRef]
  24. Sheng, H.; Zhang, J.; Yan, Z.; Yin, B.; Liu, S.; Bai, T.; Wang, D. New multi-UAV formation keeping method based on improved artificial potential field. Chin. J. Aeronaut. 2023, 36, 249–270. [Google Scholar] [CrossRef]
  25. Zhang, T.; Dong, D.; Du, Z.; Long, J.; Yu, D.; Wang, Z.; Chen, C.L.P. Swarm Control Based on Artificial Potential Field Method with Predicted State and Input Threshold. Eng. Appl. Artif. Intell. 2023, 125, 106567. [Google Scholar] [CrossRef]
  26. Fan, J.; Chen, X.; Liang, X. UAV Trajectory Planning Based on Bi-Directional APF-RRT* Algorithm with Goal-Biased. Expert Syst. Appl. 2023, 213, 119137. [Google Scholar] [CrossRef]
  27. Zheng, Y.; Li, A.; Chen, Z.; Wang, Y.; Yang, X.; Im, S.-K. MPN-RRT*: A New Method in 3D Urban Path Planning for UAV Integrating Deep Learning and Sampling Optimization. Sensors 2025, 25, 4142. [Google Scholar] [CrossRef] [PubMed]
  28. Guo, J.; Xia, W.; Hu, X.; Ma, H. Feedback RRT* Algorithm for UAV Path Planning in a Hostile Environment. Comput. Ind. Eng. 2022, 174, 108771. [Google Scholar] [CrossRef]
  29. Fan, J.; Chen, X.; Wang, Y.; Chen, X. UAV Trajectory Planning in Cluttered Environments Based on PF-RRT* Algorithm with Goal-Biased Strategy. Eng. Appl. Artif. Intell. 2022, 114, 105182. [Google Scholar] [CrossRef]
  30. Zhang, W.; Xu, G.; Song, Y.; Wang, Y. An Obstacle Avoidance Strategy for Complex Obstacles Based on Artificial Potential Field Method. J. Field Robot. 2023, 40, 1231–1244. [Google Scholar] [CrossRef]
  31. Zhang, P.; He, Y.; Wang, Z.; Li, S.; Liang, Q. Research on Multi-UAV Obstacle Avoidance with Optimal Consensus Control and Improved APF. Drones 2024, 8, 248. [Google Scholar] [CrossRef]
  32. Guo, J.; Qi, J.; Wang, M.; Wu, C.; Ping, Y.; Li, S.; Jin, J. Distributed Cooperative Obstacle Avoidance and Formation Reconfiguration for Multiple Quadrotors: Theory and Experiment. Aerosp. Sci. Technol. 2023, 136, 108218. [Google Scholar] [CrossRef]
  33. Yan, Z.; Zhang, C.; Zhang, K.; Cai, S. Research on Guaranteed Cost Formation Tracking Control of Multi-AUV with Virtual Leader. In Proceedings of the OCEANS 2023-Limerick, Limerick, Ireland, 5–8 June 2023; IEEE: New York, NY, USA, 2023; pp. 1–6. [Google Scholar]
  34. Liu, Y.; Chen, C.; Wang, Y.; Zhang, T.; Gong, Y. A Fast Formation Obstacle Avoidance Algorithm for Clustered UAVs Based on Artificial Potential Field. Aerosp. Sci. Technol. 2024, 147, 108974. [Google Scholar] [CrossRef]
  35. Wang, X.; Ye, D.; Wei, F. Optimized Bipartite Formation Control for Multiagent Systems with Obstacle and Collision Avoidance. Inf. Sci. 2024, 662, 120122. [Google Scholar] [CrossRef]
  36. Li, Y.; Zhang, P.; Wang, Z.; Rong, D.; Niu, M.; Liu, C. Multi-UAV Obstacle Avoidance and Formation Control in Unknown Environments. Drones 2024, 8, 714. [Google Scholar] [CrossRef]
  37. Shao, S.; Zhang, J.; Wang, T.; Shankar, A.; Maple, C. Dynamic Obstacle-Avoidance Algorithm for Multi-Robot Flocking Based on Improved Artificial Potential Field. IEEE Trans. Consum. Electron. 2024, 70, 4388–4399. [Google Scholar] [CrossRef]
  38. Du, Z.; Zhang, H.; Wang, Z.; Yan, H. Model Predictive Formation Tracking-Containment Control for Multi-UAVs with Obstacle Avoidance. IEEE Trans. Syst. Man Cybern. Syst. 2024, 54, 3404–3414. [Google Scholar] [CrossRef]
  39. Khial, N.; Mhaisen, N.; Ismail, L.; Mabrok, M.; Mohamed, A. Multi-Target Path Planning with Probabilistic Detection in Cluttered Environments. In Proceedings of the ICC 2025-IEEE International Conference on Communications, Montreal, QC, Canada, 8–12 June 2025; IEEE: New York, NY, USA, 2025; pp. 1298–1303. [Google Scholar]
  40. Shevitz, D.; Paden, B. Lyapunov stability theory of nonsmooth systems. IEEE Trans. Autom. Control 1994, 39, 1910–1914. [Google Scholar] [CrossRef]
  41. Gammell, J.D.; Srinivasa, S.S.; Barfoot, T.D. Informed RRT*: Optimal Sampling-Based Path Planning Focused via Direct Sampling of an Admissible Ellipsoidal Heuristic. In Proceedings of the 2014 IEEE/RSJ International Conference on Intelligent Robots and Systems, Chicago, IL, USA, 14–18 September 2014; IEEE: New York, NY, USA, 2014; pp. 2997–3004. [Google Scholar] [CrossRef]
  42. Yan, Y.; Liu, S.; Hao, R. RRT*-APF Path Planning and MA-AADRC-SMC Control for Cooperative 3-D Obstacle Avoidance in Multi-UAV Formations. Drones 2025, 9, 611. [Google Scholar] [CrossRef]
  43. Miao, Y.; Liu, H.; Zhang, Z.; Liang, Y. Leveraging RRT*: Probabilistically Interpreted Mechanisms Enhanced with P-HOPE and FLEX-OPT for Complex Path Planning. IEEE Access 2025, 13, 15965–15980. [Google Scholar] [CrossRef]
Figure 1. UAV formation topology.
Figure 1. UAV formation topology.
Sensors 26 03245 g001
Figure 2. Urban flight scenario diagram.
Figure 2. Urban flight scenario diagram.
Sensors 26 03245 g002
Figure 3. Framework of the DASRRT* algorithm.
Figure 3. Framework of the DASRRT* algorithm.
Sensors 26 03245 g003
Figure 4. Sampling distributions for two different values of λ .
Figure 4. Sampling distributions for two different values of λ .
Sensors 26 03245 g004
Figure 5. Limitations in narrow passages.
Figure 5. Limitations in narrow passages.
Sensors 26 03245 g005
Figure 6. Schematic of the inefficient node optimization strategy.
Figure 6. Schematic of the inefficient node optimization strategy.
Sensors 26 03245 g006
Figure 7. Schematic diagram of path pruning.
Figure 7. Schematic diagram of path pruning.
Sensors 26 03245 g007
Figure 8. Formation flight control framework.
Figure 8. Formation flight control framework.
Sensors 26 03245 g008
Figure 9. Schematic diagram of obstacle-avoidance control force.
Figure 9. Schematic diagram of obstacle-avoidance control force.
Sensors 26 03245 g009
Figure 10. Schematic of formation-state transitions under the coordinated action of the control laws.
Figure 10. Schematic of formation-state transitions under the coordinated action of the control laws.
Sensors 26 03245 g010
Figure 11. Force analysis of the virtual leader.
Figure 11. Force analysis of the virtual leader.
Sensors 26 03245 g011
Figure 12. Force analysis in formation mode.
Figure 12. Force analysis in formation mode.
Sensors 26 03245 g012
Figure 13. Gazebo-based hardware-in-the-loop simulation platform.
Figure 13. Gazebo-based hardware-in-the-loop simulation platform.
Sensors 26 03245 g013
Figure 14. Planning results of the six algorithms.
Figure 14. Planning results of the six algorithms.
Sensors 26 03245 g014
Figure 15. Comparison of the expansion-tree evolution of the algorithms.
Figure 15. Comparison of the expansion-tree evolution of the algorithms.
Sensors 26 03245 g015aSensors 26 03245 g015b
Figure 16. Comparison chart of ablation experiments.
Figure 16. Comparison chart of ablation experiments.
Sensors 26 03245 g016
Figure 17. Formation flight validation results.
Figure 17. Formation flight validation results.
Sensors 26 03245 g017
Figure 18. Top view of the formation flight trajectories.
Figure 18. Top view of the formation flight trajectories.
Sensors 26 03245 g018
Figure 19. Mode switching and variations in environmental complexity.
Figure 19. Mode switching and variations in environmental complexity.
Sensors 26 03245 g019
Figure 20. Variations in control-force weights and environmental complexity.
Figure 20. Variations in control-force weights and environmental complexity.
Sensors 26 03245 g020aSensors 26 03245 g020b
Figure 21. Analysis of the minimum safety distances during formation flight.
Figure 21. Analysis of the minimum safety distances during formation flight.
Sensors 26 03245 g021
Figure 22. Error analysis of the formation control system.
Figure 22. Error analysis of the formation control system.
Sensors 26 03245 g022
Figure 23. Snapshot of the formation during the waiting stage.
Figure 23. Snapshot of the formation during the waiting stage.
Sensors 26 03245 g023
Figure 24. UAV flight data.
Figure 24. UAV flight data.
Sensors 26 03245 g024
Figure 25. Experiment without the dual-mode switching mechanism.
Figure 25. Experiment without the dual-mode switching mechanism.
Sensors 26 03245 g025
Figure 26. Formation flight experiment using the traditional APF.
Figure 26. Formation flight experiment using the traditional APF.
Sensors 26 03245 g026
Table 1. Core parameters specific to the algorithms.
Table 1. Core parameters specific to the algorithms.
AlgorithmSpecific Parameters
RRT*No additional parameters
Informed RRT* P g = 0.3 ,   γ I R R T = 1.1
RRT*_APF k A P F = 1.5 ,   r u = 8 m ,   α A P F = 0.3
RRT*_PRIME w 1 = 0.5 , w 2 = 0.2 , w 3 = 0.3 , P t a r = 0.6 , K c a n d = 10 , θ b i a s = π / 3 , w 4 = 2 , w 5 = 3 , w 6 = 1 , C t h = 20 , E t h = 60 ,     γ 1 = 0.6 , γ 2 = 0.4 , κ = 5
BIT* N s = 7000 ,   N b = 150 , η B I T = 1.3 ,   r m i n = 2 m ,   r m a x = 20 m
DASRRT* p f = 0.3 , P g = 0.3 ,   ρ = 1 ,     λ = 1 3 , β = 0.8 ,   Δ s s m o o t h = 0.2 m ,   δ m i n = 0.4 m
Table 2. Performance statistics for different path planning algorithms.
Table 2. Performance statistics for different path planning algorithms.
IndicatorsRRT*Informed RRT*RRT*_APFRRT*_PRIMEBIT*DASRRT*
Path length (m)mean167.04165.54164.16158.33163.35161.13
Standard deviation2.481.902.601.472.312.74
Confidence interval[165.67, 168.42][164.49, 166.59][162.72, 165.60][157.51, 159.14][162.07, 164.63][159.62, 162.65]
Number of nodesmean4295.073796.874511.605276.532879.132479.27
Standard deviation482.69587.53434.90238.23100.57275.51
Confidence interval[4027.76, 4562.37][3471.51, 4122.23][4270.76, 4752.44][5144.61, 5408.46][2823.44, 2934.83][2326.70, 2631.84]
Solution time (s)mean17.4112.7223.3949.8324.458.03
Standard deviation2.362.064.205.512.300.78
Confidence interval[16.10, 18.71][11.58, 13.86][21.06, 25.72][46.78, 52.88][23.18, 25.73][7.60, 8.46]
Mean   curvature   ( m 1 )mean0.06490.07090.05750.05700.05130.0403
Standard deviation0.01340.01850.00690.01090.00560.0028
Confidence interval[0.0575, 0.0723][0.0606, 0.0811][0.0537, 0.0613][0.0510, 0.0631][0.0482, 0.0544][0.0388, 0.0419]
Maximum turning angle (°)mean72.0976.2279.1171.9079.495.11
Standard deviation12.7914.2416.2111.2315.941.84
Confidence interval[65.01, 79.18][68.33, 84.10][70.14, 88.09][65.68, 78.12][70.66, 88.32][4.09, 6.13]
Table 3. p-values of the t-test between DASRRT* and comparison algorithms.
Table 3. p-values of the t-test between DASRRT* and comparison algorithms.
Comparison AlgorithmsPath Length (m)Number of NodesSolution Time (s)Mean Curvature (m−1)Maximum Turning Angle (°)
RRT*1.48 × 10−52.71 × 10−91.49 × 10−99.13 × 10−67.21 × 10−12
Informed RRT*1 × 10−43.36 × 10−72.18 × 10−63.17 × 10−51.96 × 10−11
RRT*_APF0.0215.47 × 10−111.51 × 10−94.31 × 10−77.77 × 10−11
RRT*_PRIME0.00297.04 × 10−136.22 × 10−141.09 × 10−44.17 × 10−12
BIT*0.0581.48 × 10−41.41 × 10−147.97 × 10−64.46 × 10−11
Table 4. Ablation experiment results.
Table 4. Ablation experiment results.
GroupIncluded ModulesPath Length (m)Number of NodesFirst Found Path Time (s)Solution Time (s)Average CurvatureMaximum Turning Angle (°)
Group 1A167.141733.3616.220.060673.56
Group 2A + B165.2141284.5117.790.066575.18
Group 3A + C166.3932265.3112.370.067568.28
Group 4A + D165.6234733.3211.570.061974.18
Group 5A + E162.6740443.1716.480.03833.59
Group 6A + B + C164.9334776.4112.370.070167.21
Group 7A + B + D164.3230865.3911.610.068373.55
Group 8A + B + E161.4339874.8317.530.04014.29
Group 9A + C + D165.1931355.1711.390.052970.59
Group 10A + C + E163.0532834.3116.420.04155.09
Group 11A + D + E161.7838503.749.790.04033.87
Group 12A + B + C + D + E161.0626724.318.560.03893.62
Table 5. Formation information of the UAV swarm.
Table 5. Formation information of the UAV swarm.
ParameterValueParameterValue
Number of UAVs5Initial position of U3[2, 28, 5]
Maximum flight speed3.5Initial position of U4[2, 34, 5]
Maximum acceleration6.0Initial position of U5[2, 26, 5]
Desired spacing2.0Desired relative offset of U2 w.r.t. U1[−2, 2, 0]
UAV sensing radius5Desired relative offset of U3 w.r.t. U1[−2, −2, 0]
Initial position of U1[2, 30, 5]Desired relative offset of U4 w.r.t. U1[−4, 4, 0]
Initial position of U2[2, 32, 5]Desired relative offset of U5 w.r.t. U1[−4, −4, 0]
Table 6. Information of dynamic obstacles.
Table 6. Information of dynamic obstacles.
ObstacleInitial Center Coordinate (m)Radius (m)Height (m)Velocity (m/s)
Dynamic obstacle 1[82.8, 65, 10]320[0, −0.325, 0]
Dynamic obstacle 2[95, −5, 10]320[0, 0.4, 0]
Table 7. Quantitative comparison results of APF and improved APF.
Table 7. Quantitative comparison results of APF and improved APF.
MethodTarget ReachedCollisionMinimum Obstacle Distance (m)Average Formation Error (m)Trapped in Local MinimaMaximum Oscillation Amplitude (m)
APF××0.11876.98790.0069
Improved APF×1.96984.1844×0.0329
Table 8. Adaptability verification results of the control algorithm under different environmental disturbances and formation configurations.
Table 8. Adaptability verification results of the control algorithm under different environmental disturbances and formation configurations.
GroupChange TypeMin UAV Distance (m)Min Obstacle Distance (m)Average Formation Error (m)Average Formation Recovery Time (s)Mode Switch Count
Astandard scenario0.59761.89614.153.34
Binitial disturbance in y (+5 m)0.42231.65953.57991.64
Cinitial disturbance in y (−5 m)0.52711.47943.7030.94
D obstacle   speed   × 0.70.61621.89613.49120.566718
E obstacle   speed   × 1.30.61621.89613.32740.64
F3 UAV formation0.82572.10743.67524
G7 UAV formation0.38111.09053.54280.88
H9 UAV formation0.41691.33383.59080.754
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wang, J.; Yan, D.; Hao, Y.; Miao, H. A Multilayer Decision-Making Method for UAV Formation Cooperative Flight in Complex Urban Environments. Sensors 2026, 26, 3245. https://doi.org/10.3390/s26103245

AMA Style

Wang J, Yan D, Hao Y, Miao H. A Multilayer Decision-Making Method for UAV Formation Cooperative Flight in Complex Urban Environments. Sensors. 2026; 26(10):3245. https://doi.org/10.3390/s26103245

Chicago/Turabian Style

Wang, Junjie, Dongyu Yan, Yongping Hao, and Han Miao. 2026. "A Multilayer Decision-Making Method for UAV Formation Cooperative Flight in Complex Urban Environments" Sensors 26, no. 10: 3245. https://doi.org/10.3390/s26103245

APA Style

Wang, J., Yan, D., Hao, Y., & Miao, H. (2026). A Multilayer Decision-Making Method for UAV Formation Cooperative Flight in Complex Urban Environments. Sensors, 26(10), 3245. https://doi.org/10.3390/s26103245

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop