Coverage Path Planning for UAV Based on Improved Back-and-Forth Mode

In the field of aerial photography, complete coverage path planning (CCPP) is the key to improving the task efficiency of unmanned aerial vehicles (UAVs) with a limited battery capacity. Previous CCPP algorithms consisted of Cellular Decomposition (CD) class, Probabilistic Roadmap (PRM) class, and Bio-inspired Neural Network (BINN) class. However, when faced with the complex environment of multiple forbidden areas, CD and PRM have high computational complexity and a long path length, and BINN has a large number of turns. In this paper, an improved back-and-forth (IBF) algorithm is proposed to achieve good performance in these three aspects at the same time based on a newly straight-turn mode and the corresponding auxiliary approaches (i.e. Local Traversal, Global Traversal, and continuity constraint function). An important difference between straight-turn mode and back-and-forth mode is that the next straight direction is not restricted to being parallel to the last straight direction but is determined by Local Traversal, which is introduced to evaluate the benefits of different paths and find the best direction for the next straight-turn mode at the ending cell. Global Traversal is available to choose a “jump” cell when “Dead zone” are faced. The continuity constraint function is used to maintain the continuity of the unexplored area. Under the comprehensive consideration of path length, computation time, and number of turns, the simulation and experimental results indicate that the proposed IBF algorithm has better performance in multiple forbidden areas.


I. INTRODUCTION
With the wide application of unmanned robots, such as Autonomous Underwater Vehicles (AUVs) [1], Unmanned Aerial Vehicles (UAVs) [2], Unmanned Surface Vehicles (USVs) [3], and Sweeping Robots [4], etc., the study of path planning has become a hot issue [5].According to Reference [6], path planning problems can be divided into two classes: point-to-point path planning and coverage path planning.The goal of point-to-point path planning is to plan the shortest or most energy-efficient path from the starting point to the goal point, such as ocean shipping [7] and city cab [8].The goal The associate editor coordinating the review of this manuscript and approving it for publication was Wei Wei .
of coverage path planning (CPP) is to plan the shortest or most energy-efficient path that covers a specific area, with applications such as Man Overboard (MOB) accidents [6], sweeping robots [9], environmental monitoring [10], and oil spill detection [11].Since CPP may cover the critical areas in a large region or the full area, complete coverage path planning (CCPP) is also mentioned in [12], [13], and [14], which focuses on the completeness of the coverage area.Many articles do not distinguish between the two and refer to them collectively as coverage path planning.
The discussion for the (complete) coverage path planning has been going on for a long time.CPP can be categorized into single-robot problem and multi-robot problem based on the number of robots.For multi-robot path planning, there are ant colony algorithms [15], [16], clustering methods [17], [18], [19], [20], biologically inspired self-organizing map [21], [22], genetic algorithm [23], particle swarm optimization [24], and Divide Areas based on Robot's initial Positions [25], etc; the single-robot problem is currently solved based on traditional methods such as Cellular Decomposition (CD) [26] and Probabilistic Roadmap (PRM) [27], heuristic algorithms such as Bio-Inspired Neural Network (BINN) [21], library function such as Traveling Salesman Problem (TSP) solver [28], and mechine learning such as graph neural network [29], etc.The focus of the discussion on CPP for single-robot and multi-robot is different, the former focuses on solving the optimal path in the task area, the latter focuses on solving the task distribution among different robots.Among them is the single-robot path planning known as the traveling salesman problem (TSP) [30], which belongs to the NP-hard problem [31].Unfortunately, there is still no perfect solution for the NP-hard problem.Especially in complex environments, there is still room for improvement in one or two aspects of computation time, path length, and number of turns for the current algorithms.For example, the solution of CD method has fewer turns but a longer path length and requires a lot of computation time; the PRM method performs better in terms of the number of turns but worse in path length; the BINN method performs better in terms of the path length and computation time but has a high number of turns; and the deep neural network and the TSP solver cannot deal with large-scale path planning problems.More discussions are described in Section II.
This paper presents the Improved Back-and-Forth (IBF) method for single-robot CCPP in complex zones with nofly areas, whose comprehensive performance outperforms the traditional mainstream algorithms in terms of the combined results of computation time, path length, and number of turns.The core of the IBF algorithm is the improved backand-forth mode, which is called straight-turn mode in this paper.Local Traversal is presented to choose a better motion direction at the beginning of each straight-turn mode, and Global Traversal is presented to solve the ''Dead zone'' [12] problem.Finally, inspired by the fact that physical constraints added to the physical informed neural network (PINN) [32] network can accelerate the convergence of the network and achieve better results than ordinary neural networks, this paper decides to add a continuity constraint function to the straight-turn mode, which can help the IBF algorithm be able to accurately cope with environmental changes.The continuity constraint function, Local Traversal and Global Traversal help the straight-turn mode guarantee the quality of the solution when facing complex environments, and at the same time, the computation time is effectively reduced by using the straight-turn mode.Simulations and experiments confirm that the method proposed in this paper yields a better solution compared to the current mainstream methods when path length, computation time, and the number of turns are considered together.The contributions of this paper are as follows: 1) The straight-turn mode outperforms the back-and-forth mode when navigating around forbidden areas.For the polygon region without forbidden areas, the adopted back-and-forth mode is appropriate.Unfortunately, when dealing with forbidden areas, the back-and-forth mode performs poorly because of the fixed-direction motion mode.In IBF, the straight-turn mode allows the motion direction to be adjusted to the environment, and Local Traversal is used to choose motion direction for the straight-turn mode.As a result, IBF has a more flexible motion direction and realizes better path planning.2) Global Traversal can help UAVs escape from the ''Dead zone'' and find a cell that is more conducive to future path.When the UAV arrived at a ''Dead zone'', which has no viable motion direction.Firstly, all cells in the unexplored task area that meet certain requirements will be chosen.And these requirements will be covered in detail later.Secondly, several cells with lesser Manhattan distances to the ''Dead zone'' are selected, and the number of cells selected is associated with computing power.Finally, for each selected cell, a path generated by Global Traversal to cover the unexplored task area is determined.After comprehensively considering the sum of Manhattan distances including the next steps for each selected cell, the cell with the shortest Manhattan distance is ultimately picked.It is implied that IBF would be more likely to find the optimal path by taking the benefits of the future path into consideration.3) When dealing with forbidden areas, the traditional back-and-forth mode often divides a continuous unexplored area into two discontinuous areas.In this case, the discontinuities in the unexplored areas will lead to redundant paths.In the IBF, a continuity constraint function is introduced to keep the unexplored area continuous and improve the performance of the straight-turn mode.
The remainder of the paper is organized as follows: Section II reviews the related work on the CCPP problem.The CCPP problem to be solved and the auxiliary approaches adopted in IBF are discussed in Section III.Section IV illustrates the details of our proposed IBF algorithm.Simulation is carried out in Section V. Section VI describes a real UAV experiment.The conclusion of this paper is presented in Section VII.

II. REALTED WORK
As mentioned in the Introduction, methods for single-robot CCPP include Cellular Decomposition (CD), Probabilistic Roadmap (PRM), Bio-Inspired Neural Network (BINN).The principles of these methods and their advantages and drawbacks are described in detail next.
The basic idea of the Cellular Decomposition (CD) algorithms is decomposing the free space into ''simple'' cells to achieve coverage [33].Complete coverage can be achieved after the robot visits all cells in the decomposition.According to Reference [34], the CD algorithms can be divided into three categories: Appropriate Cellular Decomposition (ACD), Semi-Appropriate Cellular Decomposition (SACD), and Exact Cellular Decomposition (ECD).ACD [35], [36] is a free space representation method based on fine-grid, where both the size and the shape of cells are considered the same.The footprint or effector of sensors is the typical size of the cell [37].Although the ACD algorithm is simple in concept, it has high computational complexity.SACD is an overlaying algorithm first proposed by Hert and Lumelsky [38], which applies to both connected and nonsimply connected environments.SACD does not need to assume any prior information about the environment and can be executed online.However, the SACD algorithm has no significant advantage in generating offline paths.ECD is the set of methods working with non-intersecting cells in which coverage path planning is reduced to planning motions from one cell to another.ECD includes several methods, but only Boustrophedon decomposition (BCDC) has received much attention and discussion [34].The BCDC algorithm was initially developed by Choset and Pignon [39] to address the ''clumped'' cell issue, in which many units can be merged to allow the robot to continue performing back-and-forth motions.Now the BCDC is widely applied in UAVs [40], AUVs [41], and sweep robots [42].The CD method has the advantage of less number of turns, but it greatly increases the computation time and path length.
The Probabilistic Roadmap (PRM) algorithm was first proposed by Kavraki et al. [27].It proceeds in two stages: a learning stage and a query stage.In the learning stage, random points are generated in the task area.And in the query stage, a simple but fast motion planner is used to connect those points.Cai [13] combined the PRM algorithm with the A* algorithm [43] based on back-and-forth mode to obtain the collision-free optimal sequence path.Yao [44] combined the PRM algorithm with the Bio-Inspired Neural Network (BINN) [45] algorithm to study overlay path planning, and the search efficiency and robustness of PRM are improved by introducing future rewards into neurons.Horvatha [46] studied an iterative structured directional coverage algorithm to find the optimal path by iterating the motion directions of different global paths.By adopting back-and-forth mode and introducing the path length and the number of turns constraints, Cao [47] proposed an improved PRM (IPRM) algorithm.IPRM has higher efficiency and lower computation time compared with the algorithms in [44] and [46].By adding constraint functions, it was demonstrated that the IPRM algorithm has better performance than the PRM method, but performance in complex environments still needs improvement.
The Bio-Inspired Neural Network (BINN) algorithm was first applied to CCPP for mobile robots by Yang [48].It should be noted that the method, although called a neural network, is quite different from traditional neural networks.Early BINNs had the disadvantage of high path repetition rate in solving path planning problems [44].To solve the disadvantages of BINN algorithm, inspired by two-layer feedforward neural networks algorithm proposed by Glasius et al. [49], [50], Luo et al. [51] proposed an improved method called Glasius Bio-inspired Neural Network (GBNN) algorithm and applied it to the path planning of mobile robot.Compared with BINN, GBNN [14], [52] not only gets numerous learning and adaptive benefits, but also effectively reduces the amount of calculation and improves the operation speed of the algorithm, which can improve the efficiency of AUV path planning, but GBNN performs poorly in the number of turns.
Considering the three categories of approaches outlined above, a representative algorithm from each of the three approaches is chosen to contrast with the IBF algorithm, which is the most traditional BCDC in Cellular Decomposition, the GBNN in the most recent publication in Bio-Inspired Neural Network, and the most recent IPRM in Probabilistic Roadmap.

III. PROBLEM DESCRIPTION
The back-and-forth mode employed in IPRM and BCDC cannot effectively deal with forbidden areas, which leads to a significant increase in path length.The BCDC algorithm uses a region decomposition method to enhance the performance of the back-and-forth mode.This method significantly lengthens computation time while only slightly reducing path length.The IPRM method improves the performance of the back-and-forth mode by iterating the motion direction, which reduces the path length to some extent but also fails to achieve the optimal path length and increases the computation time.The back-and-forth mode does, however, have the benefit of fewer turns.The GBNN algorithm chooses the next cell based on the ''neural network'' each time it moves, which produces nearly optimal path lengths and reduces computation time when encountering an obstacle.However, moving based on the ''neural network'' each time results in a higher number of turns than the IPRM and BCDC methods.
How to effectively deal with multi-forbidden area environments without leading to a significant increase in one or more of the following: computation time, number of turns, or path length, is the core of this paper.The improved back-and-forth algorithm, which constrains the straight-turn mode through the continuity constraint function, is presented.The continuity constraint function can effectively change according to the environment, like the ''Neural Network'' in GBNN, reducing the path length.At the same time, the better motion direction is selected according to the Local Traversal, which effectively reduces the path length and number of turns.When facing the ''Dead zone'' problem, instead of directly selecting the closest point in Manhattan distance, it compares several possible points through Global Traversal, and finally selects the most suitable point, which can also effectively reduce the path length and number of turns.
This section describes the problem to be solved by the IBF algorithm and its adopted basic concepts, which include the basic assumptions of the CCPP problem, the straight-turn mode, continuity constraint function, Local Traversal, Global Traversal, and A* algorithm.

A. BASIC ASSUMPTIONS
The essence of the CCPP is covering an area of interest without overlaying with forbidden areas.CCPP algorithms can be divided into one in an a priori known environment and the other in an a priori unknown environment [53], and the CCPP problem for a priori known environment is discussed in this paper.For the CCPP problem in an a priori known environment, the forbidden areas in the task area have been determined.The CCPP algorithm generates the final path by setting the offline cost function.To ensure the safety of the UAV and find the optimal path, the path is supposed to stay away from forbidden areas, and the cost function is supposed to be as small as possible.
Most algorithms for solving the CCPP are conducted on a grid-based modeling of the environment [54], and the default grid size is equal to twice the detection radius of the sensor [55].This assumption is widely adopted in victim search and rescue [56], item pick-up and delivery [57], side scan sonar [58], forward looking sonar [59], optical imaging [47], etc.So the grid-based model will be used in this paper.After gridding, the map model is a two-dimensional grid map, as shown in Fig. 2. The grid map divides the map information into three states: the black blocks represent forbidden areas; the cyan grids represent areas that have been explored; and the blank grids represent areas to be explored.At this time, the grid map information can be expressed as: where M i,j (t) represents the grid map information at coordinates (i, j) obtained at step t. m and n are the number of rows and columns, respectively.Different values of M i,j (t) represent different states.''0'' indicates that the cell has not been explored, ''1'' means that the cell has been explored, and ''−1'' suggests that the cell is unreachable.When the complete coverage of the task area is achieved at step T, the grid map information should satisfy the equation: Eq. ( 2) indicates there are only two types of grids, one for explored areas and another for forbidden areas.As a result, the sum of the absolute values of all the entries should be equal to the product of the rows and columns of the matrix.At this time, all reachable cells in the task area have been explored.
Only the turning cells, the first cell, and the last cell will be recorded in the IBF algorithm.It is assumed that a total of K cells are recorded sequentially in the order traversed by the UAV, and a straight line connects two adjacent cells.For the path with K-2 turns, the total length of the path is defined as: where ∥p k+1 − p k ∥ 2 is the Euclidean distance between two adjacent grids p k+1 and p k , and the path repeating rate r is defined as: where M i,j (0) represents the grid map information at the beginning, m i=1 n j=1 M i,j (0) represents the number of cells occupied by the forbidden areas.The denominator represents the lower bound on the path length, which means all unforbidden areas are traversed and not counted repeatedly.The numerator represents the actual path length minus the lower bound on the path length.

B. STRAIGHT-TURN MODE
The back-and-forth mode [47] is widely adopted in traditional algorithms, such as the IPRM and BCDC.However, the motion direction of the back-and-forth mode will always be parallel, as indicated by the blue lines in Fig. 3.This mode is less effective when dealing with forbidden areas.Thus, the IPRM algorithm ensures the effect of the back-andforth mode by changing the slope and intercept parameters of parallel segments [47].To determine the ideal motion direction, constraints on the number of turns and path length are also added.In contrast, the BCDC algorithm adopts the back-and-forth mode in the subarea by dividing the task area into several areas without forbidden areas.In these cases, other techniques are adopted to improve the performance of the back-and-forth mode.In contrast, the straight-turn mode, which is depicted in Fig. 3 with red lines, is used in this paper to fulfill the coverage.It can be seen from Fig. 3 that the difference between them is that the back-and-forth mode returns in the opposite direction to the last straight direction, and the straight-turn mode enters the next straight-turn mode after the turn.And the straight direction of the next straightturn mode is chosen by Local Traversal, as indicated by the black lines in Fig. 3, which will be described in detail as follows.It is worth noting that the starting cell of the current straight-turn mode is the same as the ending cell of the last straight-turn mode, and the ending cell of the current straight-turn mode is the same as the starting cell of the next straight-turn mode.The final path is constructed as numerous independent straight-turn modes.

C. CONTINUITY CONSTRAINT FUNCTION
As shown in Fig. 4(a), the cyan arrow represents the current motion direction.Considering the back-and-forth mode, which is not constrained by the continuity constraint function, the straight motion in back-and-forth mode goes from one side to the other, so the cyan arrow will continue the current motion direction like the red arrow shown in Fig. 4(a).The remaining task area is split into two separate subareas on either side of the red arrow.Repeated pathways are generated in the following coverage path, as illustrated using yellow arrow in Fig. 4(a).
The continuity constraint function will be suggested in this study to overcome the difficulties of the traditional back-andforth mode.The continuity function F is defined as: where M right,left (t + 1) represents the grid information corresponding to the cells on both sides of the cell at step (t+1).The cell at step (t+1) is the current cell moves one step in the current direction.When F=True, which means that the straight motion is supposed to stop when both sides of the cell further ahead of the current position need to be explored.The cyan arrow will not continue to proceed in the current direction when the continuity constraint function is used in straight-turn mode.In contrast, the following path is Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

E. GLOBAL TRAVERSAL
At the ''Dead zone'' in Fig. 6, the UAV is trapped in the red cell, and there is no feasible motion direction.Conventional algorithms like the BCDC algorithm will choose the adjacent region and the closest vertex as starting cell, which does not consider the effect of new starting cell on the future path.
In IBF, the optimal cell will be selected according to the result of Global Traversal.The Manhattan distance [60] between the red and yellow cells, as well as the path length depicted by the orange lines, are two factors to be considered when Global Traversal determines the optimal cell.The Manhattan distance, which can be understood as the shortest taxi distance between two points, represents the minimum number of steps required to move from one point to another.In this case, when there are no motion directions indicated by the red cell in Fig. 6, the yellow cell will be chosen for Global Traversal, and the path acquired by the Global Traversal is depicted by the orange lines.Other cells not shown here may also be chosen to carry out the Global Traversal.Finally, compared with the other cells, yellow cell will be chosen as the starting cell according to the results of Global Traversal.It is worth noting that the closest cell at Manhattan distance is selected without repeating the Global Traversal when the ''dead zone'' is met once again.

F. A* ALGORITHM
To calculate the Manhattan distance [60] from the red cell to the yellow cell in Fig. 6, the IBF algorithm adopts the A* method [43].The 4-connectivity is employed in the A* algorithm, which is depicted in Fig. 7.In Fig. 7, the orange cell represents the starting cell, the yellow cell is the target cell, the red cell represents the current cell, the blue cells represent the shortest path from the starting cell to the current cell, and black cells represent the forbidden areas.Every travelable cell around the current cell is evaluated by its value: where g(n) is the actual cost consumed from the starting cell to the current cell, namely the path length shown in the blue cells.h(n), which is the heuristic of the A* algorithm, is the estimated cost consumed from the current cell to the target cell, i.e., the estimated Manhattan distance from the red cell to the yellow cell.In the operation process of A* algorithm, the values of cells in four directions near the current cell are calculated, respectively.And the cell with the lowest f (n) value is selected each time until the robot reaches the target cell.

IV. COMPLETE COVERAGE PATH PLANNING ALGORITHM BASED ON IMPROVED BACK-AND-FORTH MODE
As shown in Fig. 1, the straight-turn mode constrained by the continuity constraint function is the core of the IBF method, and the continuity constraint function is utilized in the whole process.Following each straight-turn mode, it is necessary to determine whether ''Dead Zone'' was encountered.If there are feasible paths, local traversal is used to choose a better motion direction for the following straight-turn mode; if there is not a feasible path, Global Traversal is utilized to help escape from the ''Dead zone'', and then Local Traversal is used to select an appropriate direction for the Straight-turn mode.The IBF method was divided into Normal Mode (NM) and Abnormal Mode (ANM) based on whether the Global Traversal approach is required because ''Dead zone'' is rarely seen in a given task area.8 depict the UAV entering the subsequent straightturn mode after deciding the optimal motion direction.This process is repeated until complete coverage is achieved or the ANM state is entered.

B. ABNORMAL MODE (ANM)
ANM is the combination of the A* algorithm, Global Traversal, Local Traversal, continuity constraint function.
When the UAV enters a cell in which all motion directions are impractical, as seen in the center figure of Fig. 9, represented by the red letter ''C''.The best cell in the unexplored area should be chosen as the new starting cell.There are two possible events for the potential new starting cells.In one case, the cell might have two optional motion directions and the angle between the two motion directions is 90 • , such as the four cells 2 ⃝, 3 ⃝, 4 ⃝ and 5 ⃝ in Fig. 9.In another case, the cell might have only one alternative direction around it, such as cell 1  ⃝ in Fig. 9.The Manhattan distance of five candidate grids, 1 ⃝ to the current cell, namely the cell represented by the red letter ''C'', is determined using the A* algorithm.Only the two nearest cells with lesser Manhattan distance, 1 ⃝ and 3  ⃝, are chosen for Global Traversal to speed up computation.After completing the coverage, if no ''Dead zone'' is encountered during Global Traversal, the obtained path is taken as the final path, such as the path starting from cell 1  ⃝ in Fig. 9. Conversely, it is necessary to continue NM at grid 1  ⃝ to fulfill coverage.

V. SIMULATIONS
The IPRM algorithm suggested by Cao [47], the BCDC algorithm suggested by Choset [61], and the GBNN algorithm suggested by Sun [12] are used as baselines for comparison in order to confirm the efficiency of the IBF algorithm.In this section, different sizes of task areas, different numbers and shapes of forbidden areas are selected for simulation, and a total of six simulations are conducted.In these simulations, there are 8×8 cells in the smallest task area and 50×50 cells in the largest task area.The task area is set up with no-fly areas, varying in size and shape, to imitate complicated environments.In the simulation, the IBF, IPRM, BCDC, and GBNN algorithms are used to achieve complete coverage, respectively, and the starting position is the corner of the task area.It is easy to compare the differences among these four algorithms.The computation time, number of turns, path length, and path repetition rate are the evaluation metrics for the simulation results.The number of turns is related to the change in the angle of the drone's flight line, with each 90 • change being considered a turn.Both the path length and the number of turns will affect the flight time of the UAV.The repeating rate mainly reflects the proportion of redundant paths.In the simulation, all four algorithms are supposed to choose the optimal path starting from the four vertices of the rectangular task area.The simulations were carried out using PyCharm and an Intel(R) Xeon(R) Gold 6226R CPU running at 2.90 GHz and 2.89 GHz, respectively, as well as 256 GB of RAM.

A. SIMULATION 1
Simulation 1 considered a task area with eight rows and eight columns.And the task area contained two rectangular forbidden areas.Fig. 10 shows the paths obtained by the IBF, BCDC, IPRM, and GBNN algorithms, respectively.It can be 114846 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.seen from Fig. 10 that the IBF algorithm achieves complete coverage without repetitive paths, so it has the shortest path length.Table 1 illustrates the comparison results of four algorithms in computation time, number of turns, path length, and path repeating rate.The unit of distance is the grid length.For example, a path length of 60 means the path length is equal to 60 grid lengths, and the grid length is equal to twice the detection radius of the sensor.The detection radius is not specified here, and different sized areas can be simulated by changing the number of grids.
It can be seen from Table 1 that: (1) Compared with the BCDC algorithm, the IBF algorithm takes less computation time, has a shorter path length and a lower path repeating rate; (2) Compared with the IPRM algorithm, the IBF algorithm has better performance in computation time, number of turns, path length, and path repeating rate; (3) Compared with the GBNN algorithm, the IBF algorithm has better performance in path length and path repeating rate, the same performance in computation time, and a little bad in number of turns.

B. SIMULATION 2
Simulation 2 chooses an area with twelve rows and twelve columns, and there are three forbidden areas in the task area.Fig. 11 shows the paths obtained by the IBF, BCDC, IPRM, and GBNN algorithms, respectively.Table 2 lists the computation time, number of turns, path length, and path repeating rate of the IBF, BCDC, IPRM, and GBNN algorithms.
These two results are taken into consideration together because the task area sizes of simulation 1 and simulation 2 are comparable.According to the set of statistical results obtained from the two simulations above, compared with the IPRM algorithm, the IBF algorithm has an average reduction of 88% in computation time, an average reduction of 11% in number of turns and an average reduction of 6.3% in path length; compared with the BCDC algorithm, the IBF algorithm has an average reduction of 93.5% in computation time, an average reduction of 5.9% in number of turns and an average reduction of 8.1% in path length; compared with the GBNN algorithm, the IBF algorithm has an average reduction of 12.5% in number of turns and an average reduction of 2.6% in path length, and both methods perform nearly the same in terms of computation time.Combining the average results of the two simulations above, the IBF algorithm achieves the optimal results in terms of computation time, number of turns, path length, and path repetition rate.Furthermore, the repeating rate of the IBF algorithm is 0.5%, which means that there are almost no repeated paths.

C. SIMULATION 3
In simulation 3, a grid map of twenty rows and twenty columns was chosen, including four rectangular forbidden areas.Fig. 12 shows the paths generated by the IBF, BCDC, IPRM, and GBNN algorithms, respectively.As shown in Fig. 12, the BCDC algorithm has the worst performance in obtaining the path with the increase in forbidden areas.Although the IPRM algorithm improves the effect of backand-forth mode by scanning different motion directions, there are still many redundant paths.The GBNN algorithm has good performance in path length, but it significantly increases the number of turns.In contrast, by adopting Local Traversal, the path obtained by the IBF algorithm is significantly better than BCDC, IPRM, and GBNN.Table 3 compares the three algorithms in terms of computation time, number of turns, path length, and path repeating rate.

D. SUMULATION 4
In simulation 4, a grid map of thirty rows and thirty columns was illustrated, which contained seven forbidden areas.Fig. 13 shows the path obtained by IBF, BCDC, IPRM, and   GBNN algorithms.The computation time, number of turns, path length, and path repeating rate obtained by the four methods are shown in Table 4.
Here, the simulation results of examples 3 and 4 are considered together.According to the set of statistical results obtained from these two simulations, compared with the IPRM algorithm, the IBF algorithm has an average reduction of 91.8% in computation time, an average increase of 13% in number of turns, and an average reduction of 3.1% in path length; compared with the BCDC algorithm, the IBF algorithm has an average reduction of 97% in computation time, an average increase of 4.4% in number of turns and an average reduction of 5.7% in path length; compared with the GBNN algorithm, the IBF algorithm has an average reduction of 27.3%; however, the performance is close in terms of computation time and path length.Besides, the repeating rate of the IBF algorithm is 1.1%, which also performs best.In these two simulations, IBF achieves the best results in terms of computation time, repetition rate, and path length, but performs mediocrely in terms of the number of turns.

E. SIMULATION 5
In simulation 5, the number of cells in the task area was increased to 50×50, and the number of forbidden areas was six.Fig. 14 and Table 5 show the obtained paths and the comparison results of computation time, number of turns, path length, and path repeating rate using IBF, BCDC, IPRM, and GBNN, respectively.
The results of simulation 5 are compared separately because its target area is substantially greater than those of the first four simulations.Compared with the IPRM algorithm, the IBF algorithm reduces the computation time by 92.1% and the path length by 3.4% but increases the number of turns by 6.6%.Compared with the BCDC algorithm, the IBF algorithm reduces the computation time by 97.8%, the path length by 4.3%, and the number of turns by 3.7%; compared with the GBNN algorithm, the IBF algorithm reduces the number of turns by 81.4%, the performance is close to the same in other aspects.

F. SIMULATION 6
In Simulation 6, ten square target areas are constructed at random with sides varying from 25 to 35.Within the target area, 3 to 5 no-fly areas are randomly generated.The lengths of the two sides of the rectangular forbidden zone are determined in a randomized manner, the lower and upper bounds are two and one-sixth of the length of the square target area, respectively.The optimal paths under different 114848 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.task areas are generated by four methods, respectively, and the statistical results are shown in Fig. 15.The four subfigures in Fig. 15 show the comparison of the four methods in terms of number of turns, redundant path length, path repeating rate, and computation time, respectively, where the redundant path length is the difference between the true path length and the ideal shortest path length the path repeating rate is the ratio of the redundant path length to the ideal shortest path length.The horizontal coordinate is the corresponding method, the position of the triangle on the vertical coordinate indicates the mean of the statistical results; and the length of the line segment indicates the variance of the statistical results.
According to the upper left subfigure in Fig. 15, it can be seen that the IBF algorithm in this paper is slightly worse than the IPRM and BCDC methods in terms of the number of turns, but significantly better than the GBNN; according to the upper right subfigure and the lower left subfigure in Fig. 15, it can be seen that the IBF method significantly outperforms the other three methods in terms of the redundant path length as well as the path repeating rate; according to the lower right subfigure in Fig. 15, it can be seen that the IBF method performs closely with the GBNN method, and both are significantly better than BCDC as well as IPRM methods.
In summary, the following conclusions can be obtained from the above six simulations: GBNN performs path planning based on ''neural activity'', which has the advantage of significantly reducing computation time.In addition, ''neural activity'' can effectively respond to changes in the environment, so the GBNN algorithm can reasonably choose the motion direction to achieve the effect of reducing path length.However, the reduction in path length comes at the cost of the number of turns.The IPRM and BCDC methods are not able to respond well to changes in the environment due to the back-and-forth mode, so these two methods perform poorly in terms of path length when faced with a complex environmental task area.In addition, the back-and-forth mode requires complex additional processing to achieve better results, such as motion direction iteration in IPRM and region decomposition in BCDC, which greatly increases the computation time.However, the results are opposite to GBNN in terms of the number of turns because of its insensitivity to the environment.In conclusion, IPRM, BCDC, and GBNN cannot consider computation time, path length, and number of turns simultaneously.In contrast, the IBF method presented in this paper constrains the straightturn mode through the continuity constraint function, and  The simulation results demonstrate that the IBF method achieves the best outcomes in terms of path length and is competitive with the fastest GBNN method among the three methods in terms of computation time; it is also close to or sometimes even optimal in terms of the number of turns with the best performance of the other three methods; besides, the IBF is very close to the optimal solution in terms of path repeating rate.In conclusion, the IBF method proposed in this paper achieves better results in terms of the combination of computation time, path length, path repetition rate, and number of turns.

VI. EXPERIMENT
The flight time of UAV was not considered in the above simulations.The path length can have a certain gap with the actual flight time, especially when the UAV makes turns.To further verify the effectiveness of the IBF algorithm, it is necessary to carry out a real UAV experiment.
The core evaluation metrics of this experiment were the flight time, and the flight time is significantly influenced by the flight distance and number of turns.The UAV model used in this paper was the DJI Jingwei Matrice 200 V2, as shown in Fig. 16.The flight parameters of UAV are shown in Table 6.The flight time of UAV will reflect the pros and cons of the path generated by different algorithms.Fig. 17  Then the UAV changed its speed continuously along the path.In the straightforward stage, the speed of UAV will fluctuate slightly.In the experiment, when the UAV flies at a constant speed of 10 m/s, the actual speed will fluctuate between 9.8-10 m/s, When UAV needs to take a turn, it slows down to 0 m/s, with the acceleration of 3 m/s 2 and then accelerates slightly.At this time, the UAV will adjust the slight error between the current position and the target position and then decelerate to 0 m/s, again.The UAV is currently at the target point.At the end of the turn, the UAV starts to accelerate, and the acceleration is still 3 m/s 2 until the speed is equal to (srecified speed + 1) m/s, such as 11 m/s in this experiment.Then, the UAV slowly adjusts to the specified velocity.

A. EXPERIMENT 1
The experimental site was selected within a radius of one kilometer of (N 36 • 09' 39'', E 120 • 20' 40''), and the grid size is set to 100m.The path nodes generated by the algorithm are converted into longitude and latitude coordinates and input into the control system of the UAV.In the experiment, the campus in the task area was selected as the experimental area, artificial buildings on campus were identified as areas to be covered, and the hills on the campus were regarded as forbidden areas.Fig. 18(a) shows a top view of experiment 1.The outermost red line is the boundary of the target area, and the inner smaller red line is the forbidden zone.
Fig. 19 shows the experimental results, and Table 7 shows the corresponding number of turns, flight distance, and flight time of the four routes.As can be seen from Fig. 19 and Table 7, the IBF method results in less path length and number of turns than GBNN,BCDC as well as IPRM.This is ultimately reflected in the flight time as the IBF has 2.7% less flight time than GBNN as well as IPRM and 5.6% less flight time than GBNN.
As can be seen from Fig. 19 and Table 7, the IBF algorithm reduces the path length by 2.1% and the flight time by 2.7% in comparison with the IPRM and BCDC algorithms, and the IBF algorithm reduces the path length by 6.0% and the flight time by 6.1% in comparison with the GBNN algorithms.On the one hand, it is implied that the path generated by the IBF algorithm can provide a more efficient path for UAV flight activities; on the other hand, it can be seen that the path length has a more important effect on the flight time, while the number of turns also has an effect on the increase in flight time.

B. EXPERIMENT 2
Additionally, a randomly produced target area was employed for the UAV experiment.The experimental site was selected within a radius of one kilometer (N 36 • 20' 34'', E 120 • 29' 24''), and the grid size is also set to 100m.This target area is seen in Fig. 18(b), with three randomly generated forbidden areas inside and the outermost red line enclosing the 1400-long square target area.The UAV flight was directed using these four methods.The final flight routes for each of the four methods are shown in Fig. 20, and the number of turns, flight distance, and flight time for each method are shown in Table 8.
From Table 8, it can be seen that the IBF method is much better than IPRM and BCDC in terms of path length, so the final flight time of the IBF method is less than that of IPRM and BCDC.Though the GBNN slightly outperforms the IBF in terms of path length, the number of turns is too high, so its flight time is still longer than that of the IBF.
From Fig. 19(a), it is clear that the continuity constraint function restricts the motion in the blue points, and instead of continuing in the straight direction, it chooses to make a turn.This effectively reduces the path length and the number of turns compared to the back-and-forth mode adopted in IPRM and BCDC, as well as the ''Neural Network'' mode in GBNN, and achieves a shorter flight time.As can be seen from the position of the blue point in Fig. 20(a), all three directions of motion at this position are covered, and the remaining one direction is obstacle, which faces the ''Dead zone'' problem.Without Global Traversal, the point shown by the cyan point should be selected since it is closer to the blue point, but after Global Traversal, the motion direction shown in Fig. 20 is finally selected.According to the results of the experiment, the selection of the current path effectively improves the quality of the IBF method and achieves the shortest flight time relative to the other three methods.
In conclusion, it is clear from the above two experiments that the IBF method can effectively respond to environmental changes by using the straight-turn mode constrained by the continuity constraint function; following the reaction to environmental changes of the straight-turn mode, the IBF method chooses a reasonable motion direction by using the local traversal; and solves the ''Dead zone'' problem by using the global traversal.According to the experimental results, the IBF algorithm implements the least flight time.

VII. CONCLUSION
In this paper, the IBF algorithm is proposed for the CCPP in the presence of forbidden areas.The core of the IBF algorithm is the straight-turn mode, which possesses the characteristics of simplicity of use and flexibility.Meanwhile, the continuity constraint function is proposed to constrain the straight-turn mode to effectively cope with environmental changes, and the Local Traversal is proposed to help the straight-turn mode choose a reasonable motion direction at the beginning.To further improve the quality of the path, the Global Traversal is proposed to solve the ''Dead zone'' problem.With the integration of the above elements, the IBF algorithm achieves good performance in terms of computation time, path length, and number of turns at the same time.Based on the simulation and experimental results, it could be found that the BCDC and IPRM perform better in terms of the number of turns but perform poorly in terms of the computation time and the path length, and the advantage of the small number of turns can hardly make up for the disadvantage of the excessively long flight distance, which leads to an increase in the flight time.The GBNN algorithm performs better in terms of computation time and path length, but its number of turns increases significantly in multi-forbidden areas.Although the flight distance is short, the excessive number of turns also leads to a significant increase in the flight time.In contrast, the IBF algorithm proposed in this paper performs the same as GBNN, the best performer among the remaining three methods, in terms of computation time and path length, and is close to IPRM as well as BCDC, the better performers among the remaining three methods, in terms of the number of turns.Although the IBF method does not achieve much better results than the other methods in terms of path length, computation time, and number of turns alone, it achieves good performance in all three aspects at the same time.As a result, the IBF achieves a shorter flight time with a short path length and a small number of turns for multiple forbidden areas, which allows the IBF algorithm to design a path with less flight time in less time.At present, the IBF algorithm has certain advantages in the single UAV CCPP; how to apply the IBF algorithm to the multi-UAV CCPP is the following research direction of this paper.

FIGURE 1 .
FIGURE 1. Flowchart of the IBF method.

FIGURE 3 .
FIGURE 3. Blue lines correspond to the back-and-forth mode; red lines correspond to the straight-turn mode; black arrows represent the Straight-turn mode used to choose motion direction.

FIGURE 4 .
FIGURE 4. Description of the continuity sonstraint function: (a) Not restricted by the continuity constraint function (b) Restricted by the continuity constraint function.

FIGURE 5 .
FIGURE 5. Description of the Local Traversal method used in the straight-turn mode.

FIGURE 6 .
FIGURE 6. Description of the Global Traversal method.

FIGURE 7 .
FIGURE 7. The shortest path determined by the A* algorithm.The green cell is the starting cell, the red cell is the currentc ell, the blue cells are the shortest path from the starting cell to the current cell, and the red arrow indicates the optional cell direction for the next movement, the yellow cell is the target cell, the black cells are the forbidden areas.

FIGURE 8 .
FIGURE 8.The illustration of the Normal Model (NM).

A
. NORMAL MODE (NM) NM is the common state of the IBF algorithm, i.e., there are feasible paths for UAV.The Local Traversal, the straight-turn mode, and the continuity constraint function are all elements of NM.The coverage path starts from the starting cell in a specified direction.The Local Traversal is used to determine the direction of the following straight-turn mode once the first straight-turn mode has ended, and the continuity constraint function is applied throughout the motion.As is shown in Fig. 8, the current straight-turn mode is indicated by the cyan arrow in the left figure.The blue arrow does not proceed directly to the boundary due to the continuity constraint function.When the current straight-turn mode is complete, the Local Traversal is used to select the best direction from the other three directions shown by the yellow arrows in the middle figure of Fig. 8.The orange lines in the right figure of Fig.

TABLE 4 .
The computation time, number of turns, path length, and path repeating rate of the four algorithms in simulation 4.

FIGURE 15 .
FIGURE 15.Statistical results of the four algorithms in Simulation 6.

FIGURE 16 .
FIGURE 16.The UAV used for experiments in this paper.

FIGURE 17 .
FIGURE 17.The speed curve of the UAV flight in the experiment.
depicts the UAV's flight mode.The left figure in Fig. 17 shows the velocity curve of the UAV; the cyan line in the right figure shows the flight path; and the red arrows represent the motion directions.The UAV starts from the first red arrow on the right bottom of the right figure with a speed of around 10 m/s.

TABLE 2 .
The computation time, number of turns, path length, and path repeating rate of the four algorithms in simulation 2.

TABLE 3 .
The computation time, number of turns, path length, and path repeating rate of the four algorithms in simulation 3.

TABLE 5 .
The computation time, number of turns, path length, and path repeating rate of the four algorithms in simulation 5.

TABLE 6 .
Partial flight parameters of UAV.

TABLE 7 .
The number of turns, flight distance and flight time in experiment 1.

TABLE 8 .
The number of turns, flight distance and flight time in experiment 2.