BFS and node guidance based obstacle avoidance unmanned aerial vehicle partition path planning method
By adopting a path planning method for obstacle avoidance UAVs based on BFS and node guidance, the problem of high computational complexity of traditional methods in large-size or high-precision maps is solved. This method achieves efficient and continuous path planning, ensures that the path is optimized within the reachable area, shortens the path length, and improves the path quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIANGNAN UNIV
- Filing Date
- 2026-04-07
- Publication Date
- 2026-06-09
Smart Images

Figure CN122170887A_ABST
Abstract
Description
Technical Field
[0001] This invention specifically relates to the field of UAV partition path planning technology, and in particular to a UAV partition path planning method based on BFS and node guidance for obstacle avoidance. Background Technology
[0002] BFS, or Breadth-First Search, is an algorithm for traversing or searching tree or graph data structures. Its core idea is "layer-by-layer advancement": starting from the starting point, it first visits all adjacent nodes, and then visits the unvisited adjacent nodes of these adjacent nodes, expanding outward layer by layer until all reachable nodes have been traversed.
[0003] With the widespread application of drones in complex scenarios such as logistics delivery and emergency rescue, traditional path planning methods have gradually revealed problems such as high computational complexity, long planning time, and insufficient global optimization ability when faced with large-size or high-precision maps.
[0004] To address the aforementioned issues, this application proposes a partitioned path planning method for obstacle-avoiding UAVs based on BFS and node guidance. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings of existing technologies by proposing a BFS-based obstacle avoidance UAV partition path planning method with node guidance.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: The obstacle avoidance UAV partition path planning method based on BFS and node guidance includes the following steps: S1. Initial processing of the spatial preprocessing layer; S2. Following the spatial preprocessing layer, the zoning planning layer is then processed. S3. Finally, the global optimization layer is processed to plan a complete, continuous and efficient global path.
[0007] Furthermore, in S1, the spatial preprocessing layer analyzes the grid connectivity using a disjoint-set data structure algorithm, closes unreachable regions that are not connected to the starting point, and constructs an effective graph space that contains only reachable regions. The spatial preprocessing layer includes two processes: disjoint-setup region partitioning and connectivity modeling, and closing unreachable regions.
[0008] Based on the aforementioned scheme, the disjoint-set data structure region partitioning and connectivity modeling method is as follows: Constructing a 2D raster map into a graph structure , where the vertex set It consists of all reachable grid cells, that is: ; The disjoint-set data structure consists of two parts: a parent node array and a rank array.
[0009] As a further aspect of the present invention, in S2, the partitioning planning layer generates an initial pseudo-path connecting the starting point and the ending point, divides the map into sub-maps based on the obstacle boundaries crossed by the pseudo-path, and uses the BFS algorithm to search for locally feasible paths in each sub-map. The zoning planning layer includes four processes: pseudo-path generation, submap partitioning and dynamic boundary expansion, submap BFS path planning, and global path stitching.
[0010] Furthermore, the pseudo-path generation uses linear interpolation to generate a connection starting point. and the end point pseudo-path .
[0011] Based on the aforementioned scheme, when the pseudo-path is obtained Then, it is necessary to traverse all the grids along this path to detect the points where obstacles can be crossed. To ensure that the submap gradually covers the area around the obstacle, within the determined submap, the BFS algorithm is used to search for the path from the starting point to the ending point.
[0012] As a further aspect of the present invention, after obtaining the local paths of each of the sub-maps, a single segmented path is formed. and ,in and These all represent grid points on the path. The key to path splicing is that the end point of the previous path segment and the start point of the next path segment must coincide, that is... .
[0013] Furthermore, in S3, after the sub-map paths are stitched together, the global optimization layer extracts key nodes through inflection point detection, and optimizes the path using the Bresenham straight line optimization algorithm and a greedy strategy to reduce the number of turns and shorten the path length. Global path optimization strategies include: inflection point detection, Bresenham line optimization, and greedy strategies.
[0014] Based on the aforementioned scheme, the inflection point detection is to obtain the global path. Next, the path needs to be optimized by detecting inflection points on the path and using these inflection points as key nodes for optimization.
[0015] As a further aspect of the present invention, the Bresenham algorithm and the greedy strategy work together to address any two inflection points in the set T. arrive Use the Bresenham algorithm to generate the set of points on the line between these two points. .
[0016] The beneficial effects of this invention are as follows: 1. By closing off unreachable regions, the main connected region containing the starting point is preserved, thus ensuring that subsequent path planning operations are only performed within this reachable region, avoiding the waste of computing resources in unreachable regions.
[0017] 2. Setting up pseudo-paths simplifies the initial search direction, avoids blindly searching for paths throughout the map space, and thus reduces unnecessary exploration.
[0018] 3. By using a submap division and dynamic boundary expansion strategy, the submap range can be continuously expanded, ensuring that the submap gradually covers the area around the obstacle, thus making it more likely to find a feasible path.
[0019] 4. By setting up submap BFS path planning, a state can be continuously retrieved from the queue and checked to see if the destination has been reached. If the destination has been reached, the current path is returned; otherwise, new states are explored in eight directions. If the grid corresponding to the new state is reachable and has not been visited, the new state is added to the queue and the visited set, and the search continues. If no feasible path is found, a backtracking mechanism is triggered, expanding the submap area to search again until the submap area cannot be expanded further, thus avoiding getting stuck in an invalid search.
[0020] 5. By setting up global path stitching, local paths found in each sub-map can be integrated into a complete and continuous global path.
[0021] 6. By using inflection point detection, Bresenham line optimization, and a greedy strategy, inflection points provide the foundation for subsequent path optimization. These key points can be used to further adjust the path, making it smoother and more efficient. Considering the greedy strategy, when traversing inflection points, the last inflection point is prioritized, and the path between inflection points is replaced with the longest possible straight line. This optimization strategy effectively shortens the path length and ensures that the path does not cross obstacles, thereby further improving the quality and usability of the path. Attached Figure Description
[0022] Figure 1 This is a flowchart of the overall method proposed in this invention; Figure 2 This is a flowchart of the sub-map path search process proposed in this invention; Figure 3 This is a schematic diagram of the path planning proposed in this invention. Detailed Implementation
[0023] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0024] Reference Figure 1 A path planning method for obstacle avoidance UAVs based on BFS and node guidance includes the following steps: S1. Initial processing of the spatial preprocessing layer; By analyzing the grid connectivity using the Union-Find algorithm, unreachable regions that are not connected to the starting point are closed, and an effective graph space containing only reachable regions is constructed. In this scheme, the spatial preprocessing layer uses Union-Find to check the connectivity of the map, closes off disconnected areas, and prevents selected nodes from falling into closed areas, which would result in local unsolvable problems.
[0025] The spatial preprocessing layer consists of two stages: disjoint-setup region partitioning and connectivity modeling, and closing unreachable regions.
[0026] Disjoint-set data structure partitioning and connectivity modeling: Constructing a 2D raster map into a graph structure , where the vertex set All reachable grids consist of, namely: , here It is the number of rows on the map. It is a sequence number. Representing the Line number A column of grid cells; a value of 0 indicates that the grid cell is reachable.
[0027] Edge set It describes a four-way connectivity relationship, that is, there are edges connecting adjacent reachable grid cells in the top, bottom, left, and right directions.
[0028] To manage these connected regions, a disjoint-set data structure is used.
[0029] The disjoint-set data structure consists of two key parts: Parent node array In the initial state, the parent node of each node is itself, that is... This means that initially each node can be considered as the root node of its own set.
[0030] rank array It records the height of the tree, primarily used to optimize the efficiency of subsequent merging operations. Initially, the rank of each node is 0.
[0031] Specific rules for merging four-way connectivity relationships: For any reachable grid , and its four adjacent reachable grids Perform a merge operation on it. The steps are as follows: First, through the search operation and Find the root node of the set containing these two grid cells, and denote it as... and .
[0032] The search operation here It recursively updates the parent node of the node so that it points directly to the root node, which ensures that the subsequent root node lookup operation is more efficient.
[0033] Then, check if the root nodes are the same. If... Merge them according to their rank: like So let's put The set it belongs to is merged into The set in which it resides, that is, the set of the set in which it is located. .
[0034] like Conversely, put The set is merged into The set in which it is located, i.e. .
[0035] like Then you can choose to put The set is merged into The set in which it is located, that is And to The rank increases by 1, that is .
[0036] Closed off inaccessible areas: Assuming a starting point First, perform a search operation. Get the root node of the set it belongs to. Therefore, all root nodes and Different grids constitute inaccessible areas. The mathematical expression is as follows:
[0037] Then, the unreachable areas All the grid cells inside are marked as obstacles, i.e. This preserves the main connected region containing the starting point. This ensures that subsequent path planning operations are performed only within this reachable area, avoiding the waste of computing resources in unreachable areas.
[0038] S2. Following the spatial preprocessing layer, the partitioning planning layer is processed. First, an initial pseudo-path connecting the starting point and the ending point is generated. Sub-maps are divided based on the obstacle boundaries crossed by the pseudo-path. Then, the BFS algorithm is used to search for locally feasible paths in each sub-map. Zoning planning mechanism: First, a straight line connecting the starting point to the ending point is generated on the global map, and the grid cells crossed by the line are used as pseudo-paths. Next, the grid cells before and after the pseudo-path crossing an obstacle are detected and treated as a pair of grid cells. Several grid pairs are used as vertices of the sub-map boundary to divide the map, and each grid pair is used as the starting and ending point in the sub-map. Then, a basic path planning method (BFS in this case) is used to plan the path in the sub-map.
[0039] If no feasible path is found in the submap, the submap boundary is expanded until a subpath is found or the map reaches its maximum size. Finally, the feasible part of the pseudopath and each subpath are spliced together to form a globally feasible path.
[0040] The zoning planning layer includes: pseudo-path generation, submap partitioning and dynamic boundary expansion, submap BFS path planning, and global path stitching.
[0041] Pseudo-path generation: To provide a general direction for subsequent searches, linear interpolation is used to generate a connection starting point. and the end point pseudo-path .
[0042] The specific calculation method is as follows: First calculate Then the coordinates of the discrete grid on the pseudopath It can be calculated using the following formula:
[0043] Here This represents a floor operation. This calculation yields a series of discrete grid points, which form a pseudo-path. This pseudo-path simplifies the initial search direction, avoiding blindly searching for paths throughout the map space and thus reducing unnecessary exploration.
[0044] Reference Figure 2 As shown, submap partitioning and dynamic boundary expansion: When the pseudo-path is obtained Then, it is necessary to traverse all the grids along this path to detect the points where obstacles can be crossed. The specific testing rules are as follows: When first encountered on a pseudo-path (That is, when entering an obstacle area), and the previous grid cell is reachable, this point is recorded as the entry point into the obstacle. .
[0045] When encountering When a point is left behind an obstacle (i.e., when the previous grid cell is unreachable), this point is recorded as the exit point for leaving the obstacle. This creates a pair of boundary points. .
[0046] Based on these boundary point pairs, the extent of the initial submap can be defined. Assume the boundary point pairs are... Therefore, the initial submap's extent can be defined as:
[0047] If no feasible path is found within the defined submap area, the submap area is expanded. The specific expansion method is as follows:
[0048] By continuously expanding the submap's range in this way, it is ensured that the submap gradually covers the area surrounding the obstacle, thus making it more likely to find a feasible path.
[0049] Reference Figure 3 As shown, BFS path planning for the sub-map: In the determined submap (here Within the previously pre-processed main connected region (including the starting point), the BFS algorithm is used to search for the starting point. To the finish line The path.
[0050] First, define the state space as follows: , here This represents the coordinates of the current grid cell, and `path` represents the path that has been explored from the starting point to the current position. Additionally, it defines a set of eight search directions. .
[0051] The search process is as follows: First, initialize the BFS queue. , here These are the starting coordinates of the submap. This represents the initial path starting from the origin, followed by an iterative process, which is the BFS path planning method.
[0052] During this process, a state is continuously retrieved from the queue, and it is checked whether the destination has been reached. If the destination has been reached, the current path is returned. Otherwise, new states are explored in eight directions, and if the grid corresponding to the new state is reachable... And it hasn't been visited yet. If a new state is found, it is added to the queue and the visited set, and the search continues. If no feasible path is found, a backtracking mechanism is triggered, and the search is restarted by expanding the submap area until the submap area cannot be expanded further, thus avoiding getting stuck in an invalid search.
[0053] Global path concatenation: After obtaining the local paths of each submap, they need to be concatenated into a complete global path. To ensure the concatenated path is continuous, certain constraints must be followed. (Segmented Path) and ,in and These all represent grid points on the path. The key to path splicing is that the end point of the previous path segment and the start point of the next path segment must coincide, that is... Only when this condition is met can we ensure that the spliced path will not have any breaks or jumps.
[0054] Once the continuity condition is met, the splicing path... It can be represented as Remove this part. This is to avoid repeatedly calculating the point and ensure the uniqueness and simplicity of the path. By using this path stitching method, the local paths found in each sub-map can be integrated into a complete and continuous global path.
[0055] S3. Finally, the global optimization layer is processed to plan a complete, continuous and efficient global path. After the sub-map paths are stitched together, the global optimization layer extracts key nodes through inflection point detection and optimizes the path using the Bresenham straight line optimization algorithm and a greedy strategy to reduce the number of turns and shorten the path length.
[0056] First, starting from the starting point, identify all inflection points in the path as key nodes for path optimization. Then, combine a greedy strategy with the Bresenham algorithm to check if there are straight paths between inflection points; if so, replace the path between the two inflection points with a straight line. After each optimization, check if the path has changed; if not, or if the maximum number of optimization iterations has been reached, the process terminates, thus optimizing the global path.
[0057] Global path optimization strategies include: inflection point detection, Bresenham line optimization, and greedy strategies; Inflection point detection: After obtaining the global path Next, the path needs to be optimized by detecting inflection points on the path and using these inflection points as key nodes for optimization.
[0058] The specific approach is to treat each point on the path as follows: Calculate the direction vector between two adjacent points. .if That means in The direction of the path to this point has changed, then It's an inflection point; all such inflection points form a set. These inflection points provide the foundation for subsequent path optimization, allowing for further adjustments to the path to make it smoother and more efficient.
[0059] Bresenham Line Optimization and Greedy Strategy: Next, the Bresenham algorithm and the greedy strategy will work together for any two sets of inflection points. inflection point and Use the Bresenham algorithm to generate the set of points on the line between these two points. The Bresenham algorithm is a classic algorithm for generating lines in a two-dimensional plane. Its advantages lie in its high computational efficiency and ability to quickly determine discrete grid points on the line. The specific steps are as follows: First, calculate the distance between the two points. and The coordinate difference in the direction, i.e. , Simultaneously determine the sign factor , , here The function is a sign function, used to determine the direction of coordinate changes. Then, the error term is initialized. Then, it begins generating grid cells along the straight line point by point, iterating until the endpoint is reached. The iterative rule is the Bresenham algorithm:
[0060] After generating the point set for the line, it is necessary to check whether all grid cells on this line, except for the endpoints, are reachable. Each point in All must be satisfied If this condition is met, it means that this straight line can be used as part of the path, and this straight line segment will be used to replace the original path. arrive The part, and the inflection point are selected simultaneously. and When considering a greedy strategy, prioritize selecting the last inflection point during traversal and replace the path between inflection points with the longest possible straight line. This optimization strategy can effectively shorten the path length and ensure that the path does not pass through obstacles, thereby further improving the quality and practicality of the path.
[0061] Experimental data: An obstacle layout is adopted with proportional scaling, by determining... The experimental map was created using a proportionally scaled-up method to simulate maps of various sizes and resolutions. Four maps were generated: The rasterized map was used to conduct experiments in four sets of maps. The average of the 30 sets of experiments was taken, and the results are shown in the table.
[0062]
[0063] The analysis in the table above shows that the obstacle avoidance UAV partitioned path planning method based on BFS and node guidance has a shorter overall planning time and better path quality. The planning time generally increases linearly with increasing map size. Across the four map sizes, the average path length reduction after straight-line optimization is 3.02%, and the optimization effect is even greater with increasing map size. For example, In the map, an optimization of 1.6% was achieved. The figure is 5% in the map. The figure of 5.5% in the map demonstrates the effectiveness of the global optimization layer.
Claims
1. A partitioned path planning method for obstacle avoidance UAVs based on BFS and node guidance, characterized in that, Includes the following steps: S1. Initial processing of the spatial preprocessing layer; S2. Following the spatial preprocessing layer, the zoning planning layer is then processed. S3. Finally, the global optimization layer is processed to plan a complete, continuous and efficient global path.
2. The obstacle avoidance UAV partition path planning method based on BFS and node guidance as described in claim 1, characterized in that: The spatial preprocessing layer in S1 analyzes the grid connectivity using a disjoint-set data structure algorithm, closes unreachable regions that are not connected to the starting point, and constructs an effective graph space that contains only reachable regions. The spatial preprocessing layer includes two processes: disjoint-setup region partitioning and connectivity modeling, and closing unreachable regions.
3. The obstacle avoidance UAV partition path planning method based on BFS and node guidance as described in claim 2, characterized in that: The method for dividing the disjoint-set data structure into regions and modeling connectivity is as follows: Constructing a 2D raster map into a graph structure , where the vertex set It consists of all reachable grid cells, that is: ; The disjoint-set data structure consists of two parts: a parent node array and a rank array.
4. The obstacle avoidance UAV partition path planning method based on BFS and node guidance as described in claim 1, characterized in that: In S2, the partitioning planning layer generates an initial pseudo-path connecting the starting point and the ending point. Based on the obstacle boundaries crossed by the pseudo-path, it divides the map into sub-maps. In each sub-map, the BFS algorithm is used to search for locally feasible paths. The zoning planning layer includes four processes: pseudo-path generation, submap partitioning and dynamic boundary expansion, submap BFS path planning, and global path stitching.
5. The obstacle avoidance UAV partition path planning method based on BFS and node guidance as described in claim 4, characterized in that: The pseudo-path generation uses linear interpolation to generate a connection starting point. and the end point pseudo-path .
6. The obstacle avoidance UAV partition path planning method based on BFS and node guidance as described in claim 5, characterized in that: When the pseudo path is obtained Then, it is necessary to traverse all the grids along this path to detect the points where obstacles can be crossed. To ensure that the submap gradually covers the area around the obstacle, within the determined submap, the BFS algorithm is used to search for the path from the starting point to the ending point.
7. The obstacle avoidance UAV partition path planning method based on BFS and node guidance as described in claim 6, characterized in that: After obtaining the local paths of each of the sub-maps, a single segmented path is formed. and ,in and These all represent grid points on the path. The key to path splicing is that the end point of the previous path segment and the start point of the next path segment must coincide, that is... .
8. The obstacle avoidance UAV partition path planning method based on BFS and node guidance as described in claim 1, characterized in that: In S3, after the sub-map paths are stitched together, the global optimization layer extracts key nodes through inflection point detection and optimizes the path using the Bresenham straight line optimization algorithm and a greedy strategy to reduce the number of turns and shorten the path length. Global path optimization strategies include: inflection point detection, Bresenham line optimization, and greedy strategies.
9. The obstacle avoidance UAV partition path planning method based on BFS and node guidance as described in claim 8, characterized in that: The inflection point detection is used to obtain the global path. Next, the path needs to be optimized by detecting inflection points on the path and using these inflection points as key nodes for optimization.
10. The obstacle avoidance UAV partition path planning method based on BFS and node guidance as described in claim 9, characterized in that: The Bresenham algorithm and the greedy strategy work together to address inflection points in any two inflection point sets T. and The Bresenham algorithm is used to generate the set of points on the line between these two points. .