Research on obstacle avoidance path planning of UAV in complex environments based on improved Bézier curve

Obstacle avoidance path planning is considered an essential requirement for unmanned aerial vehicle (UAV) to reach its designated mission area and perform its tasks. This study established a motion model and obstacle threat model for UAVs, and defined the cost coefficients for evading and crossing threat areas. To solve the problem of obstacle avoidance path planning with full coverage of threats, the cost coefficients were incorporated into the objective optimization function and solved by a combination of Sequential Quadratic Programming and Nonlinear Programming Solver. The problem of path planning under threat full coverage with no solution was resolved by improving the Bézier curve algorithm. By introducing the dynamic threat velocity obstacle model and calculating the relative and absolute collision cones, a path planning algorithm under multiple dynamic threats was proposed to solve the difficulties of dynamic obstacle prediction and avoidance. Simulation results revealed that the proposed Through-out method was more effective in handling full threat coverage and dynamic threats than traditional path planning methods namely, Detour or Cross Gaps. Our study offers valuable insights into autonomous path planning for UAVs that operate under complex threat conditions. This work is anticipated to contribute to the future development of more advanced and intelligent UAV systems.

In recent years, advancements in technology have made UAVs an essential component of modern-day equipment for human society.The smooth arrival of UAVs at their mission area depends on efficient path planning, which is the core of the flight to the mission area.
Researchers have widely applied Bionic Algorithms to resolve the issue of autonomous path planning for UAVs.Bionic algorithms include particle swarm optimization (PSO) 1-3 , wolf swarm optimization (WSO) [4][5][6][7] , and ant colony optimization (ACO) 8 .Although these algorithms exhibit strong robustness and adaptability, they are susceptible to outcomes that are locally optimal 9 .As it facilitates continual directional adjustments 10 , genetic algorithms remain a top choice among many scholars.On the downside, genetic algorithms demand ample internal computational resources and necessitate high computing power 11 .Apart from theoretical studies, scholars have conducted numerous experimental verifications of UAV path planning algorithms across multiple scenarios and tasks [12][13][14][15] .Wu's research focuses on improving the obstacle avoidance capabilities of UAVs through flexible path planning, particularly in disturbed environments 16,17 .Quan and Ji's research accomplished fast adaptive path planning without maps in unknown environments 18,19 .Furthermore, Zhou investigated the architecture of UAV swarms and accomplished their distributed autonomous navigation 20 .
As a result, intelligent algorithms have become prevalent in autonomous path planning of UAVs for obstacle avoidance, leading to significant research breakthroughs.Nevertheless, certain inadequacies still persist in the available literature.
Firstly, many algorithms are prone to falling into local optima.As a result, researchers are striving to improve algorithms and obtain the globally optimal path.However, improved algorithms often lead to increased computation, thereby reducing planning efficiency.
Secondly, previous studies have not found effective solutions to the challenge of achieving full coverage.In existing literature, the setting of obstacles is mostly scattered, and there are gaps between obstacles [17][18][19][20] .In fact, when UAVs fly over long distances, some continuous mountain ranges can create obstacles throughout a certain www.nature.com/scientificreports/area.When the path is full of threats, the UAV must traverse the threat area with minimal cost.The traditional Detour or Cross Gaps methods are no longer deemed practical.
Thirdly, most studies on path planning only consider the ideal situation of a fixed threat area 13,19 .However, there might be dynamic obstacle areas in real-world situations as well.The straightforward application of the aforementioned algorithms cannot be used to solve path planning issues under dynamic threats.
To resolve the problems mentioned above, this study investigates obstacle avoidance path planning for UAVs in complex conditions.We propose path planning methods for UAVs that encounter both static and dynamic obstacles.The challenge of path planning for UAVs when navigating through dynamic obstacles and full coverage obstructions was addressed using the improved Bézier curve model.Therefore, the proposed method can enhance the ability of UAV path planning and offer a viable approach for UAVs to fly safely even under complex obstacle conditions.

UAV motion model
This study operated under the assumption that the UAV could be modeled as a rigid body with a constant mass.Furthermore, for the sake of simplicity, the curvature of the Earth was disregarded in the analytical framework.The motion model of the UAV is represented as: where v uav is the speed, η is the heading angle, and (x, y) denotes the current coordinate position of the UAV.
This study focuses on medium and large fixed-wing UAVs characterized by a high aspect ratio.The parameters governing the UAVs under investigation in this research were formulated in alignment with the performance metrics mentioned earlier, with a speed range of [100-150] km/h and an acceleration range of [− 5, 5]m/s 221-23 .

Threat area model
This paper focuses on the research of medium and large fixed wing UAVs.The main static obstacles encountered by such UAVs are mountains and tall buildings.In typical scenarios, these obstacles adopt a circular layout.Nevertheless, due to the proximity of certain hindrances, they tend to congregate into clusters, frequently giving rise to non-uniform configurations.The circular threat area, the fan-shaped threat area and coverage angle were set as the radius of r = 15km , radius r = 30km and θ = 120 • , respectively.
For medium to large UAVs, the dynamic threats are primarily manned and UAVs.In this paper, the dynamic threat area was set as a movable circle.Based on common civil aviation aircraft parameters and safe flight interval, the dynamic obstacles area radius, coverage angle and speed range were set at of r = 5km , θ = 360 • and [0, 600]km/h.

Path planning under static full coverage threats
In UAV mission planning, obstacle avoidance is regarded as a top priority.Nevertheless, if crossing a threat area is inevitable, it is critical to cross it while minimizing exposure to the threat.The initial position of UAV was set as (x 0 , y 0 ) , and the central point of the mission area was set as (x f , y f ) .The route to the mission area is punctuated by circular and fan-shaped threat areas.The UAV initiates its journey from the initial position, meticulously fine-tuning control variables while ensuring compliance with constraints.Simultaneously, it strives to fulfill the stipulated objective function, culminating in its successful arrival at the designated mission area.

Bézier curve model
Enhancing flight performance and mitigating the intricacies of autonomous control necessitate the creation of a streamlined, continuous flight path.In pursuit of this, the second-order Bézier curve has been harnessed as a model for path depiction, entailing the definition of data points and control points 24 .Notably, the efficacy and intricacy of Bézier curve path planning is focused on the count and placement of control points.In light of this, the adoption of the second-order Bézier curve emerges as a judicious choice for path modeling, owing to its elevated precision and rapid computational throughput 25 .The mathematical expression for the second-order Bézier curve is as follows: The data points P 0 , and P 2 were coordinated, and the control point P 1 , as shown as follows:

Receding planning framework
Bézier curve model represents a localized path planning approach, confining its operation to the trajectory's initial and terminal points.This tendency yields outcomes of local optimality while neglecting the broader scope of comprehensive planning.In response to this challenge, a backward planning framework was implemented.At each sampling time t, an optimized control variable within the finite programming interval [t, t + T p ] was established based on the objective function and input from the previous sampling time.The next control input (1)

Objective function and constraint conditions
When the UAV embarks on a journey through an area blanketed by full threat coverage, the primary objective becomes the minimization of traversal instances while adhering to the following optimization objective function: where d last−f represents the distance between the end point and the center point of the current of the mission area, L indicates the side length of the task area, √ 2L is its diagonal length, i is the number of planned Bézier curve segments, i is the distance between obstacle and UAV, r obs(i ′ ) denotes the radius of the threat area, θ iji ′ is the angle between the UAV coordinates and the obstacle coordinates, primarily used to judge the sector threat area.θ obs(i ′ ) is the coverage angle of the obstacle i ′ .1(d iji ′ ≤ r obs(i ′ ) , θ iji ′ ≤ θ obs(i ′ ) ) , determines whether the UAV has entered the threat area by analyzing its position and angle, and assigns a value of 1 in the event that the UAV successfully crosses the threat area.If it does not traverse, the result of this function was defined as 0. Parameter α refers to the cost coefficient, which is used to adjust the weight after normalization.
Facilitating effective UAV path planning mandates a nuanced assessment of an array of constraints, encompassing a spectrum of influential factors such as smoothness, acceleration, obstacles, and speed limitations.Smooth constraint.To facilitate a trajectory marked by fluidity and cohesion, the utilization of Bézier curve subdivision planning is commonplace.This approach mandates the congruence of derivatives between adjoining paths at their junctures, and can be mathematically expressed as follows: Acceleration constraint.Constraints must be imposed on the acceleration of UAVs to ensure that their flight performance remains within acceptable parameters.This measure helps to keep the speed changes of UAVs within a reasonable range: Speed constraint.During UAV operations, it is crucial that the vehicle can quickly reach its intended mission area while also maneuvering at lower speeds when necessary to avoid threats.In order to achieve this balance and guarantee optimal performance, an appropriate speed range must be determined for the UAV: Evade threat area constraints.When a UAV is attempting to evade a threat area, the angle and radius of coverage of any sector or circular hazard must be taken into account.By considering these factors, the UAV can avoid danger to the greatest possible extent.When there are no gaps in the threat area, the UAV should try to move around the edge of the area whenever possible.

Solution
Sequential quadratic programming (SQP) algorithm is commonly used to solve nonlinear programming problems due to its high level of computational efficiency and robust boundary exploration capabilities.This approach can be mathematically expressed as follows: (5) min Vol:.( 1234567890 www.nature.com/scientificreports/ The objective function was simplified to a quadratic function at point X k using the Taylor Expansion.
The above objective function requires certain constraints, which can be mathematically expressed as follows:

Simulation experiment design
The mission area encompassed a rectangular expanse measuring 100 km × 100 km, within which both fan-shaped and circular threat areas were strategically situated.The fan-shaped threat area radius, the coverage angle, circular threat area radius, the coverage angle, the central point coordinate of the mission area and the estimated attack position radius were respectively set at r obs(i ′ ) = 30km , θ obs(i ′ ) = 120 • , r obs(i ′ ) = 15km , θ obs(i ′ ) = 360 • , (100,100) and 10 km.After UAV enters the mission area, the path planning was completed.Starting from (0,0), the UAV had a speed range of [100,150]km/h and an acceleration range of [− 5, 5]m/s 2 .The simulation step size was t = 0.1s.
In the context of task scenario 1, the UAV can strategically chart its course through the secure zone nestled between the two fan-shaped threat regions utilizing the "Cross Gaps" method, which serves as a navigation blueprint.However, under task scenario 2, the repositioned fan-shaped threat area obstructs the trajectory of UAVs to the central locus of the mission area.Upon evading this threat area, the UAV's path necessitates autonomous planning through the aid of the selected algorithm, thereby imposing heightened requisites on its planning prowess.

Simulation results and analysis
The simulation experiment was run on a computer that equipped with an eighth-generation i7-6700 K processor, 32 GB RAM, and a 1 TB hard drive.MATLAB-R2018b was adopted as the simulation software.(10) min f (x) Illustrated in Fig. 2a is the outcome of the proposed path planning algorithm for task scenario 1.
The path planning procedure in task scenario 1 was successfully executed in a rapid 5.875 s, yielding a highly favorable outcome.As clearly depicted in Fig. 2a, this plan adeptly circumvents the threat area, achieving comprehensive avoidance.Notably, for the all-encompassing threat area proximate to the central mission locale, the algorithm astutely selects the path with the lowest cost.
Transitioning to task scenario 2, the path planning output generated by the algorithm introduced in this paper is depicted in Fig. 2b.The path planning endeavor for task scenario 2 necessitated a cumulative 8.254 s to yield the optimal plan.While this marked a marginally longer processing time compared to scenario 1, the resultant plan exhibited comparable efficacy.Concretely, the UAV adeptly maneuvers around the fan-shaped threat area, making astute choices among several crossing options while traversing the threat area.

Path planning under dynamic threats
In addition to full coverage of static threats, UAVs may also encounter dynamic threats brought by other manned or unmanned aerial vehicles during flight, which belong to the complex threat environment faced by UAVs.The path planning of UAV under dynamic threat can also be achieved by improving Bézier curve.Because the position of the dynamic threat changes in real time, it is necessary to establish a speed obstacle model to predict its movement, and then use the improved Bézier curve for segmented path planning.

Speed obstacle model of dynamic obstacles
Based on the relative motion relationship between the UAVs and the threat area, it can be determined whether the threat can be avoided or not.According to the speed obstacle method 27 , the coordinate position of UAV is (x 0 , y 0 ) , the central point of the mission area is (x f , y f ) , and there is a moving circular threat area in the mission area.Its central position coordinate is (x obs(i ′ ) , y obs(i ′ ) ) , the radius is r obs(i ′ ) , and the movement speed is v obs(i ′ ) .The speed is v uav , the dynamic obstacles area coordinate is (x obs , y obs ) , the radius is r obs , and the motion speed is v obs .Afterwards, the speed obstacle model can be represented, as shown in Fig. 3.
In Fig. 3, v    is outside the RCC area, that is, ε > δ , the UAV will refrain from entering the threat area without the changes of both the heading and speed.ε, δ could be calculated by ( 13) and ( 14): The angle δ should be smaller than π/2 .When δ = π/2 , it indicates that the UAV is located at the boundary of the threat area.For the dynamic obstacles area in Fig. 3, after translating v obs , the relative collision area RCC can be trans- formed into absolute collision cone (ACC), as shown in Fig. 4.
Figure 4 illustrates the trajectory of the UAV, depicting its trajectory aligned with the current heading, subsequently leading it into the designated threat area, i.e.In scenarios where the mission area comprises multiple dynamic obstacle areas, it becomes imperative to compute the ACC for varying threat domains, and whether the velocity vector ⇀ v uav of the UAV is within the ACC area was judged.If it is within the area, avoidance is required.Otherwise, there is no need to evade.Multiple absolute collision cone (MACC) was defined as MACC = n i=1 ACC i ′ (Fig. 5).The crux of the velocity barrier approach in evading threat zones lies in ensuring that the velocity vector ⇀ v of the UAV remains situated outside the realm of absolute collision.This entails strategic adjustments to the UAV's heading and speed.When confronted with multiple dynamic obstacle areas, a concept known as the Multiple Avoidance Collision Cone (MACC) comes into play.To avert potential collisions, the UAV's velocity vector   www.nature.com/scientificreports/

Optimized model
The remaining distance between the UAV and the central nexus of the mission area was employed as the objective function, while the threat level and ACC were deemed the assessment metrics.Guided by predefined parameters encompassing UAV velocity and heading within the threat evasion area, this study embarked on model optimization and computational analysis.When the UAV evaded the dynamic obstacles area, the following optimization objective function was proposed by combining the evasion strategy and constraints: In (16), the first term indicates that the optimization objective is to minimize the remaining distance between the UAV and the central point of the mission area, and the second term is the objective function to avoid the dynamic obstacles area.Where, µ(cpa) i ′ is the assessed risk of the i ′ th dynamic obstacles area, ⇀ v uav is the current velocity vector of the UAV, and ACC i ′ represents the absolute collision area.Upon fulfillment of the evasion criteria, the UAV adeptly circumvented the designated threat area.The parameter | sin η| max indicates that the UAV adjusts the angle to avoid the maximum heading angle in the dynamic obstacles area.v uav(j) − v uav(j−0.1)represents the speed change of UAV during evasion.The parameters β and γ are cost coefficients.The weight of course angle and speed changes were adjusted, summed them with m i 1 j i ′ ∈D , and then normalized them with 1/IJI ′ .

Simulation experiment design
The task area was as 100km × 100km and 3 circular dynamic obstacles areas were set up within the task area.Threat area radius is r obs(i ′ ) = 5km , coverage angle is θ obs(i ′ ) = 360 • , velocity interval is [0,50]km/h , acceleration interval is [−1, 1]m/s 2 , and angular velocity interval is[− 0.2,0.2]rad/s .The UAV initiated its journey from the origin point (0,0), with its speed range spanning from 100 to 150 km/h , the acceleration interval was [− 5,5]m/s 2 , the detection distance was 45km , and the simulation step size was t = 0.1s.

Simulation results and analysis
For task scenario 1, the path of algorithm planning in this chapter is shown in Fig. 7: From Fig. 7, the contiguous flight path segment of the UAV is depicted by the solid black line.Significantly, the bold solid black line demarcates the ongoing path segment of the UAV.In parallel, the dashed black line signifies the meticulously mapped but as yet untraversed path segment.Within Fig. 7d and e, guided by the movement trajectory of the threat area, the UAV's forthcoming planned path navigates through the prevailing threat area.
( In the scenario depicted in Fig. 7f, the UAV executed the previously outlined path planning strategy, successfully circumventing potential threats.The threat is moving, and the UAV needs to determine the direction of the threat at any time, so we adopt the method of subsection planning.It takes 7.33 s to complete the six section planning shown in Fig. 7.For task scenario 2, the path planned by the algorithm in this paper is shown in Fig. 8.
In the context of task scenario 2, the motion logic governing dynamic obstacle area mirrors that of task scenario 1.To circumvent the dynamic obstacle areas on both the left and right flanks, parameters β = 5 and γ = 10 were defined.As depicted in Fig. 8d, adjustments were notably made to flight speed and heading angle in alignment with the path planning objective function and threat avoidance cost function.This orchestrated adaptation enabled the UAV to adeptly sidestep the dynamic obstacles.It takes 9.56 s to complete the six section planning shown in Fig. 8.
Drawing insights from Figs. 7 and 8, it becomes apparent that the UAV can successfully predict the threat direction and implement obstacle avoidance path planning when dealing with two kinds of dynamic threats in the same and different directions.When the number of dynamic threats is less than 3, the time to complete the obstacle avoidance planning is less than 10 s.This confirms the effectiveness of the path planning algorithm proposed in this article against dynamic threats.

Conclusions and outlook
The Throughout path planning model was proposed to solve the problem that the traditional Cross Gaps method cannot fulfill the path planning requirements in the presence of complex obstacles faced by the UAV.The path planning of UAV in static threat area is analyzed, and the overall framework of UAV path planning is established.Based on Bézier curve and receding planning framework, combined with the actual situation of UAV obstacle avoidance flight, an optimization model is proposed and constraints are set.By setting the optimization variables and cost functions in the optimization model, the UAV can break through the threat of full coverage.In order to solve the optimization model, the sequential quadratic programming method and the nonlinear programming solver Fmincon are used for calculation.Experiments show that the proposed method can select the most reasonable path in seconds and complete the path planning.
Additionally, the problem of path planning for a UAV facing dynamic obstacles was investigated.The cost function for the velocity and heading angle of the UAV was developed to avoid areas with dynamic obstacles, and a new path planning algorithm was introduced.Simulation results show that the algorithm can reasonably predict the threat movement trend and plan a reasonable escape path for the two kinds of dynamic threats with the same direction and different directions.

.
u−o is the relative speed between UAV and dynamic obstacles area, l u−o is a straight line in v u−o direction, d u−o is the distance between the UAV and the center of the threat area, l mo and l no refers to the line between the coordinate position of the UAV and the radius of the threat area.The angle between d u−o and l u−o is ε , and the angle between d u−o and l no is δ .The red area indicates the dynamic obstacles area, which is

Figure 3 .
Figure 3. Schematic diagram of speed obstacle model.
is perpendicular to the boundary of the relative collision area.When δ > π/2 , it indicates that the UAV has entered the threat area.
area.If the UAV changes its course and speed to make ⇀ v uav outside the ACC area, it can avoid the threat area.

Figure 4 .
Figure 4. Schematic diagram of absolute collision area.

Figure 5 .
Figure 5. Schematic diagram of multiple absolute collision areas.