Abstract
An offline and online bi-level structure-based dynamic path planning algorithm is proposed for an unmanned aerial vehicle (UAV) in low-altitude complex urban environment. First, an improved Hunger Games Search (HGS) algorithm is developed to generate an offline optimized path under the UAV’s performance constraints and the known static obstacles’ constraints. The individuals of the proposed algorithm will be divided into multiple groups to increase the population diversity. And then, a dynamic grouping strategy and a quantum-behaved behavior are proposed to solve the premature convergence’s problem and the imbalance problem between exploration and exploitation ability in HGS. To improve the dynamic obstacle avoidance efficiency of the algorithm, the dynamic obstacles are classified into three categories: newly added no-fly zone, known and unknown dynamic obstacles. Then, utilizing the information of the offline optimized path and the airborne sensors, three kinds of online planning strategies—an improved rapid-exploring random tree (RRT), a changing speed strategy, and a novel three-dimensional rolling windows—are introduced to dynamically update the path or speed of the UAV. Simulation results indicated that the improved HGS can enhance the performances of the traditional HGS and outperform other compared algorithms on the benchmark functions. Meanwhile, the online planning strategies can effectively achieve dynamic obstacle avoidance within the constraints of offline path. More specially, the planning time and angles of the local path to avoid the no-fly-zone’s influence are improved by 11.3% and 56.8% through utilizing the improved RRT.
Keywords
Introduction
In the past few decades, much attentions have been paid to the applications of the unmanned aerial vehicle (UAV) in military and civil domains, such as the target tracking (Yao et al., 2015), logistics delivery (Song et al., 2018), and environment monitoring (Shen et al., 2004). During the missions, autonomous flight technologies have played a very important role (Li et al., 2022; Yang et al., 2015). To some extent, the realization of autonomy and intelligence mainly depends on the flight control and path planning techniques (Li et al., 2020). And the successful execution of the UAV’s missions is up to the reasonability and effectiveness of the planned path. In low-altitude complex urban environment, there exist not only various static obstacles, such as buildings and trees, but also a variety of dynamic obstacles, such as birds, cooperative/noncooperative agents or UAVs. The security and effectiveness is threatened by the incomplete environment information and limited detection range of airborne sensors, which also bring great challenges to path planning problem with obstacle avoidance for the UAV (Zhou et al., 2021). Therefore, it is crucial to plan a collision-free flight path with lower energy consumption under the related constraints in complex and changing environments. Two requirements should be satisfied for the path planning of the UAV in low-altitude complex environment: one is to find the optimal path under the UAV’s performance constraints and the constraints of the known static obstacles, and the other is to avoid the dynamic obstacles’ threat under the optimal path constraint, the UAV’s performance constraints and the sensors’ information.
According to the time-domain type, path planning with obstacle avoidance of the UAV can generally be classified into two categories, that is, offline planning and online planning (Zhao et al., 2018). If the information of global environment is completely known to the UAV, the problem is known as the offline path planning. The offline planning focus on the optimality and stability of the generated path. It is a complex global optimization problem with multiple specific constraints essentially. A series of methods have been proposed to deal with this complex global optimization problem, such as sampling-based techniques (Sucan and Kavraki, 2012), artificial neural networks (Duan and Huang, 2014), and heuristic methods (Mac et al., 2016). Whereas, it is difficult to consider the related constraints of the UAV into these above algorithms. Among all kinds of path planning technologies, swarm intelligence optimization algorithms (SIOAs) can conquer these difficulties. It is very effective to deal with the complex global optimization problems including offline planning problem (Heidari and Pahlavani, 2017). “No free lunch theorem” has pointed out that no algorithm can solve all types of optimization problems, and each algorithm has its superiority only for some specific problems (Wolpert and Macready, 1997). Therefore, a variety of new or improved algorithms are proposed to obtain more promising results with respect to different problems (Chrouta et al., 2018; Liu et al., 2020; Yang et al., 2021). Yang et al. (2021) indicated that there exists a research gap in all previous SIOAs, and it compels users to focus on improving operations of algorithms based on specific evolutionary process. A general-purpose algorithm named Hunger Games Search (HGS) was designed to focus more on performance rather than metaphor change. Moreover, it has already been proved to be well-performed when solving some engineering problems (Nguyen and Bui, 2021; Onay and Aydemır, 2022). However, offline planning cannot guarantee the security in the uncertain environment. The calculation time and overhead of them always increase exponentially with the scale and complexity of the environments. Thus, it is impossible to dynamically update the path of the UAV by only utilizing offline planning.
Online planning is a dynamic multi-objective optimization problem (Zhao et al., 2018), which is defined under the condition that the global environment information is partially or completely unknown. Some algorithms are widely used to address the online planning problem, such as rolling windows method (Xi and Zhang, 2003), rapid-exploring random tree (RRT) (Huang and Sun, 2020), artificial potential field (APF) (Lin et al., 2021) and so on. Xi and Zhang (2003) proposed a rolling windows method based on local information for dynamic path planning problem of mobile robots. To solve the real-time tracking path planning problem for a solar-powered UAV with the constraint of energy-optimal, a planning method based on particle swarm optimization (PSO), rolling optimization and model predictive control (MPC) was proposed in Huang et al. (2016). Huang and Sun (2020) proposed a greedy strategy–based bi-direction RRT algorithm for the UAV. They aimed to replan path in real-time according to the complex dynamic environment information. Online planning algorithms can make quick reactions to the changes of environmental information. Nevertheless, they usually overlook the optimization of the whole environment, which will lead to the failure of finding the ideal or feasible path.
Therefore, multiple hybrid path planning algorithms which combine offline and online planning are proposed to overcome the limitations or constraints of them. They aim to realize dynamic path planning of the UAV in low-altitude dynamic environment (Aldao et al., 2022; Chen et al., 2020; Elmokadem and Savkin, 2021; Wu and Hu, 2020). In Chen et al. (2020), a hybrid algorithm based on A* and cubic spline method was proposed to solve the path planning problem for the UAV in a dynamic environment. But the speeds of the dynamic obstacles are set to a constant value, and this algorithm has been studied in the two-dimensional environment. Wu and Hu (2020) proposed a A* and RRT based hybrid algorithm to realize dynamic planning in low-altitude dynamic urban area. And it pointed out that it was necessary to classify the dynamic obstacles and design corresponding online planning strategies for the UAV. In Elmokadem and Savkin (2021), a hybrid algorithm based on an improved RRT and a sliding mode control’s reactive control law based was proposed. It aims to realize the UAV’s autonomous navigation in low-attitude dynamic environment with partially unknown information. Aldao et al. (2022) presented a hybrid obstacle avoidance algorithm based on A* and optimal control to address the path planning problem of the UAV in dynamic building environments. First, the above references didn’t consider the performance constraints of the UAV comprehensively. The generated path usually contains many sharp turns which will be hard for the UAV to track, ad it increases the energy consumption. Second, only the flight direction and attitudes will be adjusted to avoid the threat of the dynamic obstacles in the most of the existing literatures. The constant speed assumption of them will restrict the flexibility and effectiveness of the UAV to avoid the dynamic obstacles’ influence. Moreover, most of the existing literatures didn’t classify the dynamic obstacles according to their different characteristics. A universal planning strategy is utilized to avoid all kinds of dynamic obstacles’ threat. However, single strategy cannot guarantee the effectiveness of online planning in terms of computation time, obstacle avoidance and energy consumption.
Inspired by the existing results, this paper proposes a novel bi-level structure algorithm to address the dynamic path planning problem for the UAV in low-altitude complex environment. First, an improved HGS is utilized to generate an offline optimized path. Then, utilizing the offline optimized path’s information and the airborne sensors’ information, three kinds of online planning strategies are proposed to avoid the threat of dynamic obstacles by updating the path or speed of the UAV in real-time. The main contributions are described as follows:
An improved HGS based on dynamic grouping strategy (noted as DGSHGS) is proposed to generate an offline optimized path for the UAV under its performance constraints and the static obstacles’ constraints. A multiple-groups division strategy, a dynamic grouping strategy, and an improved quantum-behaved foraging behavior are developed in DGSHGS to solve the premature convergence problem and the imbalance problem between exploration and exploitation ability in the traditional HGS.
To improve the dynamic obstacle avoidance efficiency, the dynamic obstacles are classified into three categories: newly added no-fly zone, known and unknown dynamic obstacles. Then, utilizing the information of the offline optimized path which is generated by DGSHGS and the airborne sensors’ information, three kinds of online planning strategies—an improved rapid-exploring random tree (RRT), a changing speed strategy, and a novel three-dimensional rolling windows—are proposed to achieve dynamic obstacle avoidance. After avoiding the threat of no-fly zone and unknown dynamic obstacles, the generated local optimal path will return to the offline optimized path as soon as possible to reduce both the modification degree of the offline path and the calculation time. More especially, the planning time and path angles of local path to avoid the no-fly-zone’s threat are improved by 11.3% and 56.8%, respectively, compared with the variation of RRT in Wu and Hu (2020) under the improved RRT based online planning strategy.
Path planning model of the UAV
During the flight process in low-altitude urban areas, the security of the UAV is influenced by its performance constraints, the external environment constraints and the airborne sensors’ limited detection range. Therefore, it is crucial to plan a collision-free flight path with lower energy consumption under the related constraints in complex dynamic environments. In this section, the planning environment, the related constraints, and the cost function of path planning are modeled as follows.
Environment modeling
Environment modeling is the foundation before path planning of the UAV. In this section, the grid-based method is utilized to build the physical model of flying space. First, a three-dimensional rectangular coordinate system is established, with the vertex in the bottom-left of the map as the origin point. Then, the space of three-dimensional path planning is obtained by taking the maximum length of the map along the coordinate axes. As shown in Figure 1, m planes

Three-dimensional space division.
Problem formulation
UAV performance constraints
The generated path points must meet the related constraints to ensure the security of the UAV. To generate a more feasible path, the related angles or attitudes constraints must be taken into account. The mathematical equations of the
where the coordinate of the

Turning and climbing angle calculation.
Moreover, the minimum distance that UAV can fly is set as the minimum length of path segment
where,
Environment constraints
Since the UAV is not a mass point but rather a rigid body that occupies space, it is important to ensure that the generated path points and the path segments keep some certain distances from the obstacles. Inspired by Wu and Hu (2020), the position constraints of the path points and the path segments are modeled as
where
Overall cost function
In this paper, planning strategies are proposed to update the UAV’s speed or path to avoid the obstacles’ threat. It is assumed that the UAV’s speed remains constant in changing path strategies. Therefore, the path length can be considered as the evaluation index of the energy consumption. Inspired by Qu et al. (2020), the number of the path points and the angles are also considered as the evaluation indexes of the energy consumption. Based on the related constraints above, a novel path quality cost function J is shown as
where turns is the number of generated path’s turning points. If the angle constraints are not satisfied during the mission execution process, A will be set as a relatively large number. Otherwise, A will be set as a relatively small number to balance the proportion of the angle part. B represents the threat of the obstacles, and it will be set as a relatively large number while the distance between the
Proposed method
An offline and online bi-level structure algorithm is proposed in this paper to solve the dynamic planning problem of the UAV in low-altitude complex urban areas. First, an improved HGS is proposed to generate an offline optimized path under the static obstacles’ constraints. And then three online planning strategies are proposed to avoid three kinds of dynamic obstacles under the offline path’s constraints, the UAV’s performance constraints, and the sensors’ information.
Offline path planning strategy
Standard hunger games search algorithm
With the path quality evaluation function defined in equation (7), the offline planning problem becomes a complex global optimization problem which aims to find the path that minimizes this function. In this section, HGS is adopted to realize the offline planning due to its well performance in solving the complex optimization problems. Inspired by the activities driven by hunger and behavioral choice of social animals, the search games are categorized into two types in HGS. The criteria of classification are whether social animals are involved in the cooperation or not during foraging (Clutton-Brock, 2009). For a d-dimensional optimization problem, the HGS algorithm will create a population which is composed by several random individuals for initialization. Then, it constantly finds the optimal candidate solution according to the evaluation function value during the iteration course. The mathematical models of HGS are proposed in Yang et al. (2021):
Approaching food. The mathematical updating model of social animals’ foraging position is expressed as
where
As it can be seen in equation (8), the search pattern is switched randomly with the parameters u and E to enrich the flexibility of HGS. The first pattern expresses the activities of a few social animals, which search for food independently.
Hunger role. In equations (9) and (10),
where SHungry is the total hunger extent of the population;
In equation (11),
where WF refers the worst evaluation function value in the current iteration process (so far);
Proposed improved HGS algorithm (dynamic grouping strategy based HGS algorithm)
It is known that keeping balance on the abilities of global exploration and local exploitation is of great importance to the SIOA. Global exploration represents the ability to explore more feasible solution space. It maintains the diversity of the candidate solutions and avoids the algorithm trapping into the local optimum. Local exploitation is closely related to algorithm’s convergence speed. It indicates the abilities of individuals to search elaborately around local areas. HGS has the problem of premature convergence and the imbalance problem between exploration and exploitation ability. Therefore, an improved dynamic grouping strategy based hunger games search algorithm called DGSHGS is proposed in this section to improve the performance of HGS:
1. Dynamic grouping strategy. The whole population is randomly divided into H subgroups with K individuals each in DGSHGS to enrich the diversity of the population. Each subgroup utilizes its own individuals’ information to obtain more promising foraging positions. In addition, the dynamic grouping strategy is proposed to promote information exchanges between different groups. That aims to avoid the algorithm from trapping into local optimums. The dynamic grouping strategy occurs according to a fixed probability P. The triggering condition is
with
2. Nonlinear control parameter. In the early search stage,
The attenuation speed of
3. Novel foraging operations. The optimal individual’s information in corresponding group will be considered into the individual’s position updating formula. That helps to improve the convergence accuracy and the ability to avoid the local optimum of the algorithm. According to the definition of E in equation (8), it is noted that the value of E is large when the individuals’ gap is small. Thus, the algorithm will be inclined to execute the
It should be noted that
Equation (19) denotes that the birth of a new individual that is affected by the environment and the randomly selected parents in the
Online path planning strategies
During the flight missions of the UAV in low-altitude complex environment, various dynamic obstacles will threat its security and other performances. In order to increase the flexibility and efficiency of realizing dynamic obstacle avoidance, obstacles encountered by the UAV will be divided into three categories: dynamic obstacle with known trajectory, fixed no-fly zone and dynamic obstacle with unknown trajectory. It is assumed that the airborne sensors are utilized to detect the dynamic changes during the flying process. The range of detection is defined as a sphere which sets the UAV as the center. In this section, R refers to the detection range of the airborne sensors, and
The obstacle with known trajectory
Since the motion law of the dynamic obstacles with known trajectory is known, the changing speed or path strategy can be selected. Considering the lower modification degree of the offline optimized path, a changing speed strategy is adopted in this paper (Wu and Hu, 2020). There are three speed expressed as high speed
The newly added no-fly zone
Due to the characteristic of RRT to generate feasible path in a short period of time, it is very suitable for path planning in real-time. The standard form of RRT is suitable for solving planning problem in continuous space. In Wu and Hu (2020), an improved RRT (IRRT) which is suitable for solving path planning problem in discrete space is proposed, whereas it does not consider the UAV’s performance constraints. Therefore, an improved RRT with angle constraints (noted as CIRRT) and a novel evaluation function of path are proposed. Furthermore, the replanned path will return to the offline path quickly to reduce the calculation complexity. And the distance between the replanned path and the newly added no-fly zone should be always no less than
In the standard RRT, the obtained candidate nodes can be added to the growing-tree only when there is no obstacle between the current node and the candidate node. As shown in Figure 3, this constraint is automatically satisfied by the node expansion definition of the proposed CIRRT. Only the nodes around the current node which are not an obstacle can be selected as the candidate nodes. Meanwhile, the climbing and turning angle constraints of the UAV need to be considered. The unfeasible directions need to be removed to reduce unnecessary node expansion. One of the angle constraints situation is shown in Figure 3.

Diagram of CIRRT.
For the turning angle, the dot product of the projection vectors of the two vectors on the horizontal plane must be greater than

The candidate nodes which consider angle constraints.
CIRRT: improved RRT with angle constraints.
In Algorithm 2,
The function contains parts of path length, number of path points, and angle, which aims to reduce the energy consumption. The measurement of each index in the function is different; therefore, the normalization operation is carried out to avoid unfair advantage over others due to the larger value of one of them. M denotes the number of generated paths, and
The obstacle with unknown trajectory
Inspired by Xi and Zhang (2003), a rolling optimization principle combined with three-dimensional rolling windows method is proposed to avoid the threat of the unknown dynamic obstacles. The rolling optimization principle has been studied in 2D environment. And this principle is extended to three-dimensional environment for the UAV in this section. The sensors’ detection area of the UAV is known as the optimization window, and it will move forward with each
At first, the model of obstacles with unknown trajectory is proposed. The path of them during a rolling period
Then, it is necessary to predict whether the expansion region of the obstacle intersects with the global path or not. If not, there will be no collision during the next rolling period. On the contrary, a further prediction is required. Then, it is necessary to predict the position of the UAV and the obstacle during the next

The possible position of the UAV and the obstacles with unknown trajectory (a) dangerous state, (b) quasi dangerous state,(c) potentially hazardous state and (d) secure state.
The definition of the local goal during the rolling optimization process is proposed. First, the intersection part of the obstacle’s expansion range and the current rolling window will be recognized as the static obstacle in the grid-based environment. Then, the global path point within the rolling window which is closest to the intersection point will generally be selected as the local goal point. If the local goal is located on the maximum arrival range of the obstacle, the latter global path point will be set as the new local goal. After determining the local goal, the feasible candidate nodes are selected similarly to the situation of fixed no-fly zones. Different from the situation of fixed no-fly zones, only one optimal path will be generated. A novel cost function as shown in equation (22) is proposed to select the optimal path point
Simulation results
Benchmark function tests and comparisons
In order to verify the performance of DGSHGS, it is used to find the optimal values of the standard optimization functions which is commonly utilized in Rashedi et al. (2009). There are 23 benchmark functions, in which
Description of the 23 benchmark functions.
Parametric details of the compared algorithms.
The comparison results on benchmark functions are shown in Tables 3 and 4. In Tables 3 and 4, the optimal value of the best, the average (Mean) and the standard deviation (std) are taken in bold. The mean value and the standard deviation are inversely proportional to the optimization ability and the stability of the algorithm, respectively. It can be seen from the related numerical results in Tables 3 and 4 that DGSHGS has better performance on 13 functions, similar performance on 7 functions and worse performance on 3 functions compared with the traditional HGS from the aspect of the value of Mean. Among the seven functions with similar performance, DGSHGS and HGS obtain the optimal values on six functions. Compared with HGS, DGSHGS obtains better performance on 13 functions, similar performance on 9 functions and worse performance on 1 function in terms of the value of Std. It is noted that DGSHGS and HGS obtain the optimal values on the all 9 functions with similar performance. Compared with the SOGWO, DGSHGS achieves the better value on the 69.6% of functions in terms of the value of Mean and the better standard deviation value on the 91.3% of functions. DGSHGS achieves the better mean value on the 73.9% of functions and the better standard deviation value on the 91.3% of functions compared with CGWO. Compared with GWO, COA, and PSOGWO, the mean and standard deviation value of DGSHGS on most functions are better than them. The DGSHGS is also superior to FPA and MEGWO. Meanwhile, it is noted that more than half of the functions with similar performance in terms of the value of Mean achieve the optimal function value by them. According to the simulation results and analysis above, it can be concluded that the performances of DGSHGS on the benchmark functions are superior to the other eight algorithms.
Results of DGSHGS, FPA, GWO, COA, and HGS on benchmark functions.
Results of DGSHGS, SOGWO, PSOGWO, MEGWO, and CGWO on benchmark functions.
Offline path planning results and comparisons
At first, two

3D path planning results comparison: (a) scenario 1 and (b) scenario 2.
As shown in Table 5, the path generated by DGSHGS has fewer number of turns and shorter length than other four compared algorithms. Meanwhile, the climbing and turning angles are also smaller than other four algorithms. As shown in Figure 6, the generated paths keep a certain distance from the obstacles, and the angle constraints have been satisfied. The convergence curves in Figure 7 denote that the convergence value of DGSHGS is always the lowest at the same iteration during the evolutionary process. Moreover, the number of iterations when reaching the same evaluation function value is lesser than the others. It can be concluded that DGSHGS has excellent global exploration ability and high efficiency during iterations course. Thus, the above results verify the effectiveness and superiority of DGSHGS for the UAV path planning in low-altitude complex urban environment.
Simulation values of the offline planning.

Convergence curves of DGSHGS, GWO, PSOGWO, COA and HGS for 3D path planning: (a) scenario 1 and (b) scenario 2.
Online path planning results and comparisons
The serial number coordinates of the newly added fixed no-fly area is set as
Parametric details of the online path planning algorithms.

Planning results comparison of IRRT and CIRRT based online planning strategies: (a) IRRT and (b) CIRRT.
Therefore, the effectiveness of CIRRT based online planning strategy to avoid the newly added no-fly zone is verified. When encountering the newly added no-fly zone, the UAV’s flight speed remains constant. Therefore, the length of the path can be considered as an evaluation index of the energy consumption. The turning number and the smoothness of the UAV’s path also have great influence on energy consumption. As shown in Table 7, the performance of the proposed CIRRT based online planning strategy is better than that based on IRRT in terms of the path planning time, path length and angles when working in the same environment. The planning time and path angles are improved by 11.3% and 56.8%, respectively. And the length of the path planned by proposed CIRRT-based online planning strategy is also smaller than that based on IRRT. In conclusion, the energy consumption of the path generated by the proposed CIRRT is better than that generated by the IRRT.
Comparison of IRRT and CIRRT based online strategies.
IRRT: improved RRT; CIRRT: improved RRT with angle constraints.
After avoiding the threat of no-fly zone, the first known dynamic obstacle is being detected by sensors. As shown in Table 8, the position coordinates of this obstacle which is detected by sensors have been recorded. Meanwhile, the maximum motion velocity
Position coordinates of the first unknown dynamic obstacle which are detected by the airborne sensors.

Online path planning in the case of the first unknown and known dynamic obstacle: (a) first unknown dynamic obstacle and (b) first known dynamic obstacle.

Online path planning in the case of the second unknown and known dynamic obstacle: (a) second unknown dynamic obstacle and (b) second known dynamic obstacle.
Position coordinates of the second unknown dynamic obstacle which are detected by the airborne sensors.

The velocity curve and path of the UAV: (a) velocity curve of the UAV and (b) the UAV successfully reaches the goal point.
Conclusion
In order to solve dynamic path planning problem for the UAV in low-altitude complex urban environment, this work proposes a novel bi-level structure algorithm which combines the offline and online planning. Before path planning of the UAV, a three-dimensional grid-based environment and the related flight constraints are established. The offline planning is a complex global optimization problem with multiple constraints, and it focus on the optimality and stability of the path. Considering the effectiveness of SIOAs to solve the complex global optimization problem, an improved DGSHGS is developed to generate the offline optimized path. In order to improve the efficiency of solving dynamic obstacle avoidance problem, the dynamic obstacles during the mission are classified into three categories according to their different characteristics. Then, on the basis of the offline path, the UAV’s performance constraints and the sensors’ information, three online path planning strategies: CIRRT, a changing speed strategy, and an novel three-dimensional rolling windows method are introduced to update the speed or path of the UAV in real-time. Simulation results shown that DGSHGS outperforms many compared algorithms on the
Footnotes
Acknowledgements
The authors sincerely appreciate the editors and reviewers for their kind attention and valuable comments dedicated to this paper.
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported in part by National Natural Science Foundation of China (62073212), Natural Science Foundation of Shanghai(23ZR1426600), Innovation Fund of Chinese Universities Industry-University-Research (2021ZYB05004).
