Optimal path planning method for two-dimensional grid obstacle with protection boundary and related equipment

By transforming 2D grid obstacles into concave and convex polygons and constructing protective boundaries, combined with an improved ant colony algorithm and optimization strategy, the problem of insufficient efficiency and accuracy of existing path planning methods in complex environments is solved, and efficient and safe path planning is achieved.

CN121876992APending Publication Date: 2026-04-17TIANJIN NORMAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-07
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing path planning methods struggle to simultaneously achieve efficiency, accuracy, and robustness when dealing with obstacles in two-dimensional grid maps, especially in complex environments where sensor errors and dynamic changes lead to insufficient accuracy and safety in path planning.

Method used

Obstacles in the 2D grid map are transformed into concave and convex polygons. Protective boundaries are constructed by zooming in at equal distances. An improved ant colony algorithm is used for path planning. Combined with redundant node removal and triangulation optimization strategies, the path is optimized to obtain the best path.

Benefits of technology

It improves the safety and efficiency of path planning, enabling the rapid and accurate planning of safe and efficient paths in complex environments, adapting to obstacles of different shapes and distributions, providing greater safety margins, and reducing computational complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121876992A_ABST
    Figure CN121876992A_ABST
Patent Text Reader

Abstract

The invention provides an optimal path planning method for a two-dimensional grid obstacle with a protection boundary and related equipment, and relates to the technical field of path planning, and the method comprises the steps: recognizing an obstacle in a two-dimensional grid map, converting the obstacle in the two-dimensional grid map into a concave-convex polygon obstacle, and employing a concave-convex polygon amplification technology to determine the optimal path of the two-dimensional grid obstacle with the protection boundary. The method comprises the following steps: performing equidistant amplification on a concave-convex polygonal obstacle, constructing a protection boundary surrounding the obstacle, acquiring occupied parameters of grids adjacent to the obstacle based on the protection boundary surrounding the obstacle, and determining positions of feasible points in feasible grids according to the occupied parameters of the grids adjacent to the obstacle. Obtaining a two-dimensional grid map of the obstacles with the protection boundaries, and performing path planning and path optimization in the two-dimensional grid map of the obstacles with the protection boundaries by using an improved ant colony algorithm to obtain an optimal path; according to the method, the safety of path planning is improved, the utilization efficiency of two-dimensional grid map resources is increased, and the efficiency of path planning is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of path planning technology, and in particular to an optimal path planning method and related equipment for two-dimensional grid obstacles with protected boundaries. Background Technology

[0002] In today's era of rapid technological advancement, significant progress has been made in fields such as intelligent navigation, robot path planning, and autonomous driving. However, obstacle detection and avoidance in 2D maps remains a key bottleneck hindering further development in these areas. In practical applications, to ensure the safe operation of mobile devices or vehicles in complex and ever-changing environments, it is not only necessary to accurately identify the location of obstacles but also to establish reasonable protective boundary areas. This is because in the real world, sensors inevitably have errors, and the environment is constantly changing; for example, the location of obstacles may change, and new obstacles may appear. If traditional path planning methods are relied upon without setting protective boundaries, mobile devices or vehicles are highly likely to collide with obstacles due to sensor errors or environmental changes, leading to serious safety accidents. Therefore, establishing protective boundaries is crucial for improving the robustness and safety of path planning.

[0003] Traditional path planning algorithms typically simplify obstacles into simple geometric shapes, such as circles or polygons, and then perform obstacle avoidance calculations directly based on these simplified shapes. While this approach simplifies the calculation process to some extent, it severely ignores the complexity of the actual obstacle shapes and various error factors present in real-world environments. For example, in real-world scenarios, obstacle shapes may be extremely complex, not simple regular shapes, and the obstacle position information acquired by sensors may also be inaccurate. Furthermore, traditional algorithms do not adequately consider dynamic changes in the environment and cannot respond promptly to newly appearing obstacles or changes in obstacle positions, resulting in a significant reduction in the accuracy and reliability of path planning.

[0004] To address the shortcomings of traditional algorithms, researchers have recently proposed a technique for enlarging convex polygon obstacle polygons to construct protection zones. This technique treats obstacles as convex polygons and enlarges them proportionally through geometric transformations, thus creating a reliable protection zone around the obstacle. While this technique accurately reflects the actual shape of the obstacle and provides a greater safety margin for path planning, it has limitations in handling concave polygon obstacles.

[0005] While polygon magnification techniques have made some progress in constructing protective boundaries, existing path planning methods still face numerous challenges overall. In map construction, commonly used methods include topological mapping, visibility mapping, Maklink graph methods, and raster mapping, each with its own advantages and disadvantages. For example, topological mapping represents key locations as nodes and connections as edges, with path planning finding paths between nodes in the topological graph; however, this method faces difficulties in defining and extracting key locations in practical applications and is extremely sensitive to environmental changes. Even small changes in the local environment can alter the topological relationships, thus affecting the accuracy of path planning. Visual graphs use the vertices of obstacles in the environment as nodes in a graph, connecting all non-occluding nodes with straight lines to form a visual graph. This transforms the path planning problem into finding the shortest path from the starting point to the destination within this graph. However, when dealing with dynamically changing environments, the visual graph needs frequent updates to reflect these changes. Frequent updates not only lead to high computational costs and poor real-time performance, but also fail to provide accurate information about occluded areas or obstacles. This can severely impact the accuracy of path planning in complex indoor environments or outdoor scenes with numerous obstructions. The Maklink graph method plans paths by constructing a preliminary walkable network of links; however, this method is computationally overly complex, and the computational load increases dramatically in complex environments or large-scale path planning problems, resulting in low efficiency and failing to meet practical application requirements. Grid map methods divide the environment into uniform grids and determine the grid state based on sensor information. While simple and intuitive, this method's computational load increases exponentially with increasing resolution, and grid map updates are often untimely when the environment changes dynamically. While the grid-based mapping method suffers from drawbacks such as a surge in computational cost with increasing resolution and lag in dynamic environment updates, it offers significant advantages: simple and intuitive modeling, using regular grids to discretize the environment without requiring complex geometry or topology construction, facilitating rapid digital representation; strong compatibility, directly matching data from multiple sensors such as LiDAR, enabling real-time updates; providing clear passage boundaries at low resolutions, suitable for precise planning; and adaptability to AI. Classic algorithms and their logic are naturally compatible with grid structures; they represent complex environments with a unified grid, avoiding biases in topological map feature extraction, making them irreplaceable in simple indoor and educational demonstration scenarios.

[0006] In path planning algorithms, commonly used methods include heuristic search algorithms (such as A...). Algorithms include Dijkstra's algorithm, artificial potential field method, genetic algorithm, local path planning algorithms (such as RRT fast random tree algorithm, PRM probabilistic roadmap algorithm), and biomimetic intelligent algorithms (such as ant colony optimization algorithm, particle swarm optimization algorithm), each with its own advantages and disadvantages. For example, A While the algorithm can theoretically find the optimal path, it consumes a significant amount of memory and its performance is highly dependent on the design of the heuristic function. An improperly designed heuristic function can easily lead to incorrect search direction or inefficiency. In complex map environments, the heuristic function may fail to accurately evaluate the merits of paths, causing the algorithm to get stuck on invalid search paths, wasting considerable computational resources and time, and making it difficult to obtain effective path planning results within the specified time. Dijkstra's algorithm is inefficient when processing large-scale graphs, requiring traversal and computation of all nodes, resulting in high time complexity, which is unacceptable in scenarios with high real-time requirements. The artificial potential field method is prone to getting trapped in local optima. In environments with complex obstacle layouts, the robot may be affected by local minima and become stuck, unable to find the true optimal path, or even encounter situations where the target becomes unreachable due to unreasonable potential field construction or obstacle distribution. For example, in a narrow passage, the robot may linger near local minima and be unable to move forward.

[0007] Genetic algorithms suffer from high computational complexity and lack effective directional guidance during the search process, requiring traversal of all nodes. In complex map environments, the time complexity increases dramatically with the number of nodes. Furthermore, blind searching further increases computational load, leading to low algorithm efficiency and difficulty in quickly finding high-quality paths. Particle swarm optimization algorithms are prone to premature convergence when dealing with multimodal function optimization problems, preventing them from finding the global optimum. In path planning, this can prevent the robot from finding the optimal path, impacting its motion efficiency and safety.

[0008] In summary, existing path planning methods struggle to simultaneously meet the requirements of efficiency, accuracy, and robustness when dealing with obstacles with protected boundaries in two-dimensional grid maps. Summary of the Invention

[0009] To overcome the shortcomings of the prior art, the purpose of this invention is to provide an optimal path planning method and related equipment for two-dimensional grid obstacles with protected boundaries. This invention solves the problem that existing path planning methods are difficult to simultaneously satisfy efficiency, accuracy and robustness when dealing with obstacles with protected boundaries in two-dimensional grid maps.

[0010] To achieve the above objectives, the present invention provides the following solution: An optimal path planning method for two-dimensional grid obstacles with protected boundaries includes: Identify obstacles in a two-dimensional grid map and convert the obstacles in the two-dimensional grid map into concave and convex polygonal obstacles; The concave-convex polygonal obstacle is magnified at equal intervals to construct a protective boundary surrounding the obstacle; Based on the protection boundary, the occupied parameters of the adjacent grids of the concave-convex polygon obstacle are obtained, and the position of the feasible point in the feasible grid is determined according to the occupied parameters, so as to obtain a two-dimensional grid map of the obstacle with the protection boundary. Based on a two-dimensional grid map with protective boundaries for the obstacles, an improved ant colony algorithm is used for path planning to obtain a preliminary path. The initial path is optimized to obtain the optimal path.

[0011] Preferably, converting obstacles in a two-dimensional grid map into concave-convex polygonal obstacles includes: Traverse the binary matrix representing the two-dimensional grid map, and record the coordinates of the grid cells in the binary matrix whose values ​​are preset obstacle identifiers to obtain the grid coordinates of all obstacles; Based on the grid coordinates of the obstacles, a connected subgraph algorithm is used to classify the interconnected obstacle grids to obtain multiple connected obstacle regions. The planar graph algorithm based on complex networks calculates the correspondence between the obstacle grid and the concave-convex polygon obstacles based on the boundary vertex coordinates of each obstacle's connected region, so as to determine the vertex coordinates of each concave-convex polygon obstacle. Construct a concave-convex polygon obstacle map based on the vertex coordinates.

[0012] Preferably, the protective boundary is constructed by magnifying the concave-convex polygonal obstacle at equal intervals, including: Calculate the unit vector of the angle bisector passing through each vertex of the concave-convex polygonal obstacle and the corresponding included angle; Calculate the unit vector of each side of the concave-convex polygon obstacle, and determine whether the vertex is a convex or concave angle based on the vector product of the two adjacent sides of each vertex; Based on the expansion requirements, and combining the angle bisector unit vector and the corresponding included angle, calculate the new vertex positions of the expanded concave-convex polygon; The calculated new vertices are connected in a clockwise or counterclockwise order to construct an enlarged concave-convex polygon, thus obtaining the protection boundary.

[0013] Preferably, based on the enlargement requirements, and combining the angle bisector unit vector and the corresponding included angle, the new vertex positions of the enlarged concave-convex polygon are calculated, including: Based on the expansion requirement, along the unit vector direction of the angle bisector corresponding to the concave vertex, the expanded candidate new vertex is calculated according to the included angle, and the expanded polygon edges are constructed based on the candidate new vertex. When intersection points other than vertices appear between the edges of the enlarged polygon constructed based on the enlargement requirements, the intersection points are determined as new vertices after the enlargement, replacing the original concave corner vertices located inside the enlarged polygon. When the edges of the enlarged polygon intersect only at a vertex, the intersection point at that vertex is determined as the new vertex after enlargement.

[0014] Preferably, an improved ant colony algorithm is used for path planning to obtain a preliminary path, including: Initialize the pheromone matrix of the passable grid, and set the start point, end point and algorithm parameters for path planning; Starting from the starting point, the ant selects the next grid node based on the pheromone concentration and heuristic function value of the surrounding grids during each step of its movement, and updates the path and path length. Once an ant reaches the termination point, its pheromone levels are updated locally along its traversed path to reduce the probability of subsequent ants choosing the same path. After multiple iterations, the preliminary path is obtained by filtering from all candidate paths.

[0015] Preferably, the preliminary path is optimized by a geometric optimization strategy that includes removing redundant nodes and triangulation.

[0016] Preferably, the method for optimizing the preliminary path includes: Geometric optimization strategies for removing redundant nodes and triangular pruning.

[0017] Preferably, the geometric optimization strategy for deleting redundant nodes and triangulation includes: Delete nodes that do not contribute substantially to the final path planning result or can be replaced by other nodes, and reconstruct the path; After reconstruction, multiple consecutive nodes are directly connected by a line segment that does not pass through obstacles, so that the path does not need to be reconstructed again by passing through other intermediate nodes, thus obtaining the optimal path.

[0018] An optimal path planning system for two-dimensional grid obstacles includes: A conversion module is used to identify obstacles in a two-dimensional grid map and convert the obstacles in the two-dimensional grid map into concave and convex polygonal obstacles; A construction module is used to enlarge the concave-convex polygonal obstacle at equal distances to construct a protective boundary surrounding the concave-convex polygonal obstacle; The location determination module is used to obtain the occupied parameters of the adjacent grids of the concave-convex polygonal obstacle based on the protection boundary, and determine the position of the feasible point in the feasible grid according to the occupied parameters, so as to obtain a two-dimensional grid map of the obstacle with the protection boundary. The planning module is used to perform path planning based on a two-dimensional grid map with protective boundaries of the obstacles, and to obtain a preliminary path using an improved ant colony algorithm. The optimization module is used to optimize the initial path to obtain the optimal path.

[0019] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement a method for optimal path planning of a two-dimensional grid obstacle with a protected boundary.

[0020] A computer-readable storage medium storing a computer program, characterized in that, when executed by a processor, the computer program implements the steps of an optimal path planning method for a two-dimensional grid obstacle with a protected boundary.

[0021] The present invention discloses the following technical effects: This invention provides an optimal path planning method and related equipment for two-dimensional grid obstacles with protective boundaries. The protective boundaries constructed using polygon magnification technology fully consider the actual shape of the obstacles and environmental errors, providing greater safety margins for mobile devices or vehicles. This effectively avoids collision risks caused by sensor errors or dynamic environmental changes, significantly improving the safety of path planning. During the conversion of the two-dimensional grid map into a polygon map, a series of effective data processing and algorithm applications provide protective areas that do not occupy the entire grid, simplifying the environmental model, reducing computational load, and saving resources. In the path planning stage, an improved ant colony algorithm (with added local pheromones) increases the number of optimal paths, avoiding blind searches, further reducing computational complexity, and improving the efficiency of path planning. Optimization strategies such as redundant node removal and triangulation pruning are used to optimize the path multiple times, removing redundant parts and making the path simpler and smoother, improving path quality and feasibility. Simultaneously, the positive feedback mechanism and global search capability of the ant colony algorithm ensure that near-optimal paths are found, improving the accuracy of path planning. The method of this invention can effectively handle complex two-dimensional grid map environments and has good adaptability to obstacles of different shapes and distributions. Whether in a static or dynamically changing environment, it can quickly and accurately plan safe and efficient paths, providing reliable protection for the operation of mobile devices or vehicles in various complex scenarios. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A flowchart illustrating an optimal path planning method for a two-dimensional grid obstacle with a protective boundary, provided in an embodiment of the present invention; Figure 2 A two-dimensional grid map provided in an embodiment of the present invention; Figure 3 A connected graph of grid obstacle vertices provided in an embodiment of the present invention; Figure 4 A polygonal obstacle map provided for embodiments of the present invention; Figure 5 The map with enlarged obstacle boundaries provided in this embodiment of the invention; Figure 6 This is for a case where the polygon enlargement size is relatively small, as provided in the embodiments of the present invention; Figure 7 This is for the case where the polygon size is large, as provided in the embodiments of the present invention; Figure 8 The center point provided for the embodiments of the present invention ( The points shown are not covered by obstacles. Figure 9 The center point provided for the embodiments of the present invention ( The diagram shows points covered by obstacles. Figure 10 A two-dimensional raster map with raster numbering provided in the embodiments of the present invention; Figure 11 The possible directions of motion of the moving mass provided in the embodiments of the present invention; Figure 12 This is a schematic diagram of deleting redundant nodes in a two-dimensional map provided in an embodiment of the present invention. Figure 13 The embodiments provided for the present invention are two-dimensional. Figure 3 Diagram of angle pruning; Figure 14 The optimal path diagram provided for the embodiments of the present invention when the occupied parameter t=0.3 is shown. Figure 15 The embodiment provided for this invention is the optimal path diagram when the occupied parameter t=0.7. Detailed Implementation

[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0026] like Figure 1 As shown, this invention provides an optimal path planning method for two-dimensional grid obstacles with protected boundaries, comprising: Step 100: Identify obstacles in the two-dimensional grid map and convert the obstacles in the two-dimensional grid map into concave and convex polygon obstacles; Step 200: Enlarge the concave-convex polygonal obstacle at equal intervals to construct a protective boundary surrounding the concave-convex polygonal obstacle; Step 300: Based on the protection boundary, obtain the occupied parameters of the adjacent grids of the concave-convex polygon obstacle, and determine the position of the feasible point in the feasible grid according to the occupied parameters to obtain a two-dimensional grid map of the obstacle with the protection boundary. Step 400: Based on the two-dimensional grid map with protective boundaries of the obstacles, the improved ant colony algorithm is used to plan the path and obtain a preliminary path; Step 500: Optimize the preliminary path to obtain the optimal path.

[0027] Furthermore, obstacles in the 2D grid map are transformed into concave and convex polygon obstacles, including: Traverse the binary matrix representing the two-dimensional grid map, and record the coordinates of the grid cells in the binary matrix whose values ​​are preset obstacle identifiers to obtain the grid coordinates of all obstacles; Based on the grid coordinates of the obstacles, a connected subgraph algorithm is used to classify the interconnected obstacle grids to obtain multiple connected obstacle regions. The planar graph algorithm based on complex networks calculates the correspondence between the obstacle grid and the concave-convex polygon obstacles based on the boundary vertex coordinates of each obstacle's connected region, so as to determine the vertex coordinates of each concave-convex polygon obstacle. Construct a concave-convex polygon obstacle map based on the vertex coordinates.

[0028] Specifically, the process involves constructing a polygon map and protected areas: First, the 2D raster map is converted into a polygon map. Then, by traversing the 0-1 matrix representing the 2D raster map and recording the rows and columns of elements with a value of "1", the coordinates of all obstacles are obtained.

[0029] Figure 2 An example of a two-dimensional grid environment diagram is given, where white grids represent feasible grids and black grids represent obstacle grids. Therefore, the grid model is converted into a (0-1) matrix that can be processed by a computer.

[0030] Furthermore, the protective boundary is constructed by magnifying the concave-convex polygonal obstacle at equal intervals, including: Calculate the unit vector of the angle bisector passing through each vertex of the concave-convex polygonal obstacle and the corresponding included angle; Calculate the unit vector of each side of the concave-convex polygon obstacle, and determine whether the vertex is a convex or concave angle based on the vector product of the two adjacent sides of each vertex; Based on the expansion requirements, and combining the angle bisector unit vector and the corresponding included angle, calculate the new vertex positions of the expanded concave-convex polygon; The calculated new vertices are connected in a clockwise or counterclockwise order to construct an enlarged concave-convex polygon, thus obtaining the protection boundary.

[0031] Furthermore, combining the angle bisector unit vector and the corresponding included angle, the new vertex positions of the enlarged concave-convex polygon are calculated, including: Based on the expansion requirement, along the unit vector direction of the angle bisector corresponding to the concave vertex, the expanded candidate new vertex is calculated according to the included angle, and the expanded polygon edges are constructed based on the candidate new vertex. When intersection points other than vertices appear between the edges of the enlarged polygon constructed based on the enlargement requirements, the intersection points are determined as new vertices after the enlargement, replacing the original concave corner vertices located inside the enlarged polygon. When the edges of the enlarged polygon intersect only at a vertex, the intersection point at that vertex is determined as the new vertex after enlargement.

[0032] Specifically, for each obstacle's set of coordinates, calculate its minimum row coordinates. Maximum row coordinate Minimum column coordinates and the largest column coordinate This process determines the coordinates of the four vertices of the obstacle. After obtaining the coordinates of all obstacle vertices, duplicate vertices are carefully removed, and their connectivity is determined based on the spatial relationships between vertices, constructing an adjacency matrix. Based on the constructed adjacency matrix, a connected subgraph algorithm is used to accurately determine the connected components of the obstacle. This yields a connected graph of the grid obstacle vertices, such as... Figure 3 As shown.

[0033] Finally, for each connected component, the smallest polygon containing all nodes is found using a planar graph boundary algorithm, which is the outer boundary of the obstacle, thus completing the conversion from a raster map to a polygon map. Figure 4 The image shown illustrates how grid obstacles are transformed into polygonal obstacles.

[0034] Subsequently, the polygonal obstacle is enlarged at equal intervals to construct a protective boundary. The polygon vertices are arranged in clockwise or counterclockwise order, and the unit vector of the angle bisector passing through each vertex is calculated. and its included angle The calculation formula is: ; ; ; in, and It is the unit vector between the two adjacent sides of the vertex. It is the unit vector of the angle bisector, and its direction points to... and The side with the smaller angle, This refers to the angle of the vertex opposite the given vertex. Next, the unit vector of each edge of the polygon and the vector product of the two adjacent edges of each vertex are calculated. The concavity or convexity of the vertex is determined by comparing the positive and negative values ​​of the vector products. Then, based on the expansion requirements, the positions of the new vertices of the expanded concavity / convex polygon are calculated using the unit vector of the angle bisector of each vertex and the included angle. For concave polygons, the selection of vertices when the edges of the new polygon intersect is handled specially. Finally, the convex angle is determined along... Direction, concave angle along The direction is used to calculate the vertex coordinates of the expanded concave-convex polygon, and the calculated new vertices are connected in the original vertex order to form the expanded polygon and construct the protective boundary. Figure 5 The map after expanding the boundaries of the obstacles.

[0035] The specific details are as follows: Figure 6 , Figure 7 As shown, Figure 6 This is the case where the polygon is enlarged to a small size. After enlargement, the edges of the new polygon do not intersect at any point except the vertices. Figure 7 This is the case where the polygon is enlarged to a large size. After enlargement, the edges of the new polygon intersect at points other than the vertices. In this case, the smallest coverage area is used as the protected area of ​​the polygon.

[0036] Determine feasible grid locations: based on occupied parameters The different value ranges of determine the position of each feasible grid cell. When When the center of each feasible grid is not covered by the grid protection area, the position of the feasible grid is the center point of that feasible grid.

[0037] like Figure 8 As shown, the center position of each feasible grid cell (in the figure) The grid number () is not covered by the grid protection area, so the location of each feasible grid remains the center point. However, there are no connecting segments between some adjacent grids, for example... Figure 8 In the middle, there is no direct connection line segment between grid (2,4) and grid (3,3).

[0038] when When the center point of a feasible grid not adjacent to an obstacle is not covered by the grid protection area, its position remains the center point; however, for feasible grids adjacent to an obstacle, since their center points are covered by the protection area, the position is determined using the surrounding point method. That is, with the center point as the origin, eight points are selected around it, and the positions of these eight points are ( ), ( ), ( ), ( ), ( ), ( ), ( ), ( Then, identify the points from these 8 points that are not covered by the grid protection area. Based on this point The grid cell is determined by the order in which the points are arranged in the image, with the middle point selected as the grid cell's position. For example... Figure 9 As shown, for example, grid (1,4) selects the position of the blue point in the upper left corner (i.e., the point in the red dashed box), and grid (4,2) selects the position of the middle point on the right (i.e., the point in the red dashed box). However, there are still some adjacent grids that do not have connecting segments. There is no direct connecting segment between grid (2,4) and grid (3,3).

[0039] when When it is greater than 1, let ,in (and is an integer) First, clear the area around the grid obstacle. Each feasible grid cell becomes a protected area, and then according to... The value is as described above. or The situation is to improve the protection area of ​​this grid obstacle and determine the location of the remaining feasible grids.

[0040] Furthermore, an improved ant colony algorithm is used for path planning to obtain a preliminary path, including: Initialize the pheromone matrix of the passable grid, and set the start point, end point and algorithm parameters for path planning; Starting from the starting point, the ant selects the next grid node based on the pheromone concentration and heuristic function value of the surrounding grids during each step of its movement, and updates the path and path length. Once an ant reaches the termination point, its pheromone levels are updated locally along its traversed path to reduce the probability of subsequent ants choosing the same path. After multiple iterations, the preliminary path is obtained by filtering from all candidate paths.

[0041] Ant Colony Algorithm Path Planning: This section employs an improved ant colony algorithm for path planning on a grid map with protected boundaries. Inputs include a grid map matrix consisting of 0s and 1s (0s represent feasible regions, 1s represent obstacles), an initial pheromone matrix of passable grids (with initially uniform pheromone distribution), and parameters such as initial point, endpoint, pheromone importance factor, heuristic function weights, local and global pheromone evaporation factors, number of ants, number of iterations, and pheromone enhancement coefficient. Ants start from the starting point and, based on pheromone concentration and a heuristic function (such as the Manhattan distance from the endpoint), determine the next node using a roulette wheel selection rule, dynamically updating the path and distance.

[0042] Furthermore, the initial path is optimized, including redundant node removal and geometric optimization strategies such as triangulation.

[0043] The geometric optimization strategies for deleting redundant nodes and triangulation include: Delete nodes that do not contribute substantially to the final path planning result or can be replaced by other nodes, and reconstruct the path; After reconstruction, multiple consecutive nodes are directly connected by a line segment that does not pass through obstacles, eliminating the need for secondary path reconstruction by passing through other intermediate nodes. The optimal path is obtained.

[0044] Specifically, the final selected path is optimized using a combination of redundant node removal and triangulation pruning. If the line segment connecting any two points in the path does not intersect with any obstacle in the 2D grid map, and the length of the line segment is shorter than the sum of the original path segments, then all intermediate nodes are deleted and directly replaced with the line segment. If three consecutive nodes in the path form a triangle, and there are no obstacles directly connecting the two endpoints, then the original triangular path segment is replaced with the line segment, further shortening the path length and smoothing the trajectory.

[0045] Furthermore, another embodiment of the present invention provides an optimal path planning method for two-dimensional grid obstacles with protective boundaries, comprising: Converting a 2D raster map to a polygon map: Read obstacle information and find the coordinates of all obstacles: Based on the 0-1 matrix G of the 2D grid map, traverse each element of the matrix row by row and column by column. When encountering... At that time, record the row and column coordinates in detail. This operation can comprehensively and accurately obtain the location information of all obstacles in the map, providing a crucial data foundation for subsequent processing. In a raster map, by traversing the map, the raster coordinates of all obstacles can be accurately found, whether they are single, independent obstacles or multiple consecutive or scattered obstacles, all of which can be completely recorded.

[0046] For each obstacle, calculate the coordinates of its four vertices: for each obstacle's row and column set obtained in the previous step, determine its minimum row coordinates using a specific algorithm. Maximum row coordinate Minimum column coordinates and the largest column coordinate The four vertices of the rectangular area defined by these coordinates are the initial four vertex coordinates of the obstacle, which are respectively... This method of transforming scattered obstacle coordinates into vertex representations with well-defined geometric shapes greatly simplifies the complexity of subsequent processing. For example, for an irregularly shaped obstacle, by calculating its row and column extreme coordinates, a minimum rectangular region containing the obstacle can be quickly determined, thus obtaining its initial vertex coordinates.

[0047] Remove duplicate vertices and determine vertex connections to form an adjacency matrix: Among all the obstacle vertex coordinates obtained, there may be duplicate vertices. By carefully comparing the vertex coordinate values, these duplicate vertices are removed one by one to ensure the uniqueness of each vertex. Then, based on the spatial relationship between nodes, their connections are accurately determined. If two vertices are on the same grid obstacle, they are considered to be connected. Based on this connection relationship, an adjacency matrix is ​​constructed. The rows and columns of the adjacency matrix correspond to each vertex, and the values ​​of the matrix elements are used to indicate whether there is a connection between the corresponding nodes (usually "1" for connection and "0" for no connection). For example, if a node... and nodes If there are connections between them, then in the adjacency matrix A... ,on the contrary This matrix provides a convenient data structure for further in-depth analysis of the connectivity of obstacles, enabling intuitive quantitative representation and analysis of the connections between obstacles.

[0048] The connected subgraph algorithm is used to determine the connected components of obstacles: Based on a constructed adjacency matrix, the connected subgraph algorithm is used for in-depth analysis. This algorithm can accurately identify interconnected subgraphs in the graph, with each subgraph representing a connected component of an obstacle. Even if an obstacle presents a discontinuous shape in a grid map, the connected subgraph algorithm can reasonably divide it into one or more connected components, facilitating independent processing of different parts of the obstacle and thus enabling more detailed analysis of the obstacle's structure and characteristics. For example, in an obstacle scene containing multiple independent parts, the connected subgraph algorithm can accurately identify these parts as different connected components, providing a clear structural division for subsequent processing.

[0049] For each connected component, the outer boundary of the obstacle is found using a planar graph boundary algorithm: For each defined connected subgraph, the planar graph boundary algorithm is applied. This algorithm finds the smallest polygon containing all nodes in the connected subgraph; this concave-convex polygon is the outer boundary of the obstacle's connected subgraph. Through this algorithm, the outer boundary of each obstacle is accurately obtained, completing the transformation from grid obstacles to polygonal obstacles, obtaining a polygonal representation of the obstacle, and simultaneously determining the boundary of the working environment. For example, for a connected component of an obstacle with a complex shape, the planar graph boundary algorithm can find a smallest polygon to enclose all its nodes, accurately representing the shape of the obstacle's outer boundary, providing an accurate environmental model for subsequent path planning.

[0050] Expanding the boundaries of grid obstacles: First, arrange the polygon vertices in clockwise or counterclockwise order, and calculate the unit vector of the angle bisector. and its included angle The concavity / convexity of the vertices is determined by the vector product. The position of the new vertex is calculated based on the angle bisector and the included angle. Finally, the new vertices are connected according to the rules to construct the enlarged polygon. When processing concave polygons, the vertex selection rules for concave polygons are strictly followed to ensure the accurate shape of the enlarged polygon and to protect the reasonable construction of the boundary.

[0051] Position determination within the feasible grid: When occupied parameters When the value is between 0 and 0.5: At this point, analysis reveals the center position of each feasible grid cell (in the diagram). The grid (number) is not covered by the grid protection area. Therefore, in this case, the location of each feasible grid is still the center point. However, it should be noted that due to the existence of the protection area, there may be no connecting segments between some adjacent grids. For example, in a specific grid map, there may be no direct connecting segment between grids (2, 4) and grids (3, 3). This needs to be carefully considered during path planning to avoid planning infeasible paths.

[0052] When occupied parameters When the value is between 0.5 and 1: In this case, the center point of feasible grids not adjacent to obstacles is not covered by the grid protection area, so the position of these feasible grids remains the center point. However, for feasible grids adjacent to obstacles, since their center points are covered by the grid protection area, the center point can no longer be used as the position. To solve this problem, this project proposes the surrounding point method. That is, eight points are given around the center point (the blue points in each feasible grid in the figure). The eight points are selected as follows: with the center point as the origin, the positions of the eight points are as follows ( ), ( ), ( ), ( ), ( ), ( ), ( ), ( Find the n points out of these 8 points that are not covered by the grid protection area. Based on the order of these n points in the graph, select the middle point as the location of the grid. For example, in practical applications, the (1,4) grid might be located at the top left blue point, and the (4,2) grid might be located at the middle right point. However, some adjacent grids may not have connecting segments, such as grids (2,4) and (3,3), which also needs to be considered during path planning.

[0053] When occupied parameters Time: Set ,in (and is an integer) First, the area around the grid obstacle... Each feasible grid cell becomes a protected area because a larger occupied parameter means a larger protected area is needed. Then, based on... The value is given by the above or The situation is to refine the protected area of ​​this grid obstacle and provide the location of the remaining feasible grid cells. For example, if If it is between 0 and 0.5, then refer to The method for determining the remaining feasible grid positions is as follows; if If it is between 0.5 and 1, then refer to The location is determined using a time-based method. This approach allows for flexible and accurate handling of the location determination of feasible grids under different occupancy parameters.

[0054] Ant colony algorithm: (1) Important rules for algorithm implementation: The key rules for implementing the ant colony algorithm include the following.

[0055] ① Obstacle avoidance rules: If an obstacle blocks the direction an ant wants to move, it will randomly choose another direction, and if guided by pheromones, it will behave according to the rules of foraging.

[0056] ② Pheromone dissemination rule: Each ant releases the most pheromones when it first finds food or a nest, and releases fewer and fewer pheromones as it travels further away.

[0057] ③ Range: The range that an ant can observe is a grid world. An ant has a parameter called speed radius (usually 3), so the range it can observe is a 3×3 grid world, and the distance it can move is also within this range.

[0058] ④ Movement Rules: Each ant moves towards the direction with the most pheromones. When there are no pheromones to guide it, the ant will continue moving in its original direction due to inertia, with a small, random perturbation in its direction of movement. To prevent the ant from going in circles, it remembers which points it has recently visited. If it finds that the next point it needs to go to has already been visited recently, it will try to avoid it.

[0059] ⑤ Foraging Rules: Each ant searches for food within its sensory range. If food is found, it goes directly there. Otherwise, it checks for pheromones and compares the points within its sensory range where the pheromones are most abundant. It then moves towards the area with the most pheromones. Each ant makes a small mistake, thus not necessarily moving to the point with the most pheromones. The rules for ants finding their nest are the same, except they react to the nest's pheromones but not to food pheromones.

[0060] ⑥ Environment: The environment in which ants live is a virtual world, containing obstacles, other ants, and pheromones. There are two types of pheromones: food pheromones released by ants that have found food, and nest pheromones released by ants that have found their nest. Each ant can only perceive environmental information within its own range. The environment causes the pheromones to disappear at a certain rate.

[0061] According to these rules, ants do not have direct relationships with each other, but each ant interacts with its environment, and is actually connected to others through the link of pheromones. For example, when an ant finds food, it does not directly tell the other ants that there is food, but instead disperses pheromones into the environment. When other ants pass by, they will sense the presence of the pheromones and find the food according to the guidance of the pheromones.

[0062] (2) Ant colony algorithm steps: ① Node Selection: Here, "node" can refer to points or cities in path planning, or numerical values ​​of independent variables in function calculations, etc., in practical problems. In an ant colony system, nodes located at... ants Select nodes according to the roulette wheel algorithm. As the next node to be visited. The path selection rule is given by the following formula: ; ; In the formula, Let be a random variable uniformly distributed in the interval [0, 1]. For one parameter; To generate a random variable based on the probability distribution given by the above formula; These are the starting point and the ending point, respectively. Visibility is two points. The reciprocal of the distance; For time Time arrive The intensity of pheromones; This is the set of nodes that have not yet been visited. These are two constants, representing the weighted values ​​of pheromone and visibility, respectively.

[0063] The above formula is the path selection rule, which can better utilize the search experience accumulated by ants compared to the ant system.

[0064] ② Pheromone Update: In the improved ant colony system, in addition to the global pheromone update rule, a local pheromone update rule is also adopted. The global pheromone evaporation and pheromone release actions are only performed on the edges of the best path so far, that is, after each iteration, only the best ant so far is allowed to release pheromones; local pheromone evaporation means that in each iteration, after the current ant has traversed a certain path, the pheromone on that path will only evaporate and decrease, reducing the probability that the next ant will take that path.

[0065] The improved global pheromone update rule for ant colony systems adopts the A-Srank pheromone update rule. The improvement is that after each iteration, the paths traversed by the ants are arranged in ascending order. The algorithm assigns different weights based on path length; the shorter the path, the greater the weight. The weight of the globally optimal solution is... , No. The weights of the optimal solutions are Then the pheromone update rule is: ; In the formula ; Definition of local pheromone update rules in ant colony systems: During path construction, each time an ant traverses an edge... All of these will immediately invoke this rule to update the pheromones on that edge, that is... ; The purpose of partial updates is to update the data each time an ant traverses an edge. The pheromone on that side This will reduce the probability of other ants selecting that edge.

[0066] ③ Iteration and stopping: Each iteration of this algorithm involves M ants starting from the starting point and choosing a path based on the pheromone concentration until all ants have completed a full path walk. The iteration stops when the preset maximum number of iterations is reached or the algorithm finds the same optimal solution multiple times in a row. Finally, the optimal path is output.

[0067] Path planning for 2D raster maps: (1) Constructing the two-dimensional path planning feasible space using the grid method: The two-dimensional space is divided into multiple simple working areas using a grid of fixed size. For obstacles with irregular shapes, they are first divided according to the grid size. An obstacle can occupy one or more grids. If an obstacle does not completely occupy a grid after being divided, it is also regarded as a complete obstacle grid for the convenience of path planning.

[0068] Based on the distribution of obstacles in the environment and the grid division rules mentioned above, the grid map includes feasible grids (fully passable) and obstacle grids (impassable). To facilitate computer processing of grid information, feasible grids and obstacle grids are represented by 0 and 1 respectively, and the center position of the grid is used as the corresponding coordinate value. For example... Figure 2 An example of a two-dimensional grid environment diagram is given, where white grids represent feasible grids and black grids represent obstacle grids. Therefore, the grid model is transformed into a (0-1) matrix that can be processed by a computer.

[0069] Before accessing a grid, it needs to be labeled. Common labeling methods include numbering and Cartesian coordinates; these are essentially the same, differing only in their representation. Numbering involves sequentially numbering the grid from bottom to top and left to right: 1, 2, ..., n. Taking a 10 × 10 two-dimensional grid environment as an example, the numbered grid cells would look like this: Figure 10As shown, the numbers in the grid correspond to the grid number.

[0070] The rectangular coordinate method labels the grid cells based on their row and column. In a grid environment, assuming a moving particle is located at the center of the grid cell as shown in the figure, such as... Figure 11 As shown in the solid circle, the motion direction of the next node of the moving particle is limited to eight possible directions: upper left, upper, upper right, left, right, lower left, lower, and lower right.

[0071] The raster numbering method is commonly used for path representation, while the rectangular coordinate method is commonly used for path cost calculation. The two methods can be converted to each other. The conversion from raster number to raster coordinates is shown in the following equation, and the conversion from raster coordinates to raster number is shown in the following equation: ; ; Where: function This function represents the floor operation. This indicates the remainder operation. Indicates the grid number, Indicates the row where the grid is located. Indicates the column where the grid cell is located. This indicates the width of the raster map, which is the number of columns in the raster map.

[0072] (2) Ant colony algorithm for path planning: The main steps of using the ant colony algorithm to solve path optimization problems are as follows: ① Input a matrix of 0s and 1s representing the grid map where the moving particle needs to find the optimal path. 0 indicates that the grid is passable, and 1 indicates that the grid is an obstacle.

[0073] ② Input the pheromone matrix of the initial passable grid. Set the initial pheromone levels to be equal at all locations. Select the initial and final points and set various parameters, including the pheromone importance factor. Important factors of heuristic functions Local pheromone volatile factors Global pheromone volatile factor , ant number M, iteration number IT, pheromone enhancement coefficient Q.

[0074] ③ Let the local pheromone To select the next reachable node from the initial point, the probability of reaching each node is calculated based on the pheromone and heuristic function of each node, using the following path selection rules: ; ; In the formula, q is a random variable uniformly distributed in the interval [0, 1]. For one parameter; (t) represents the pheromone concentration on the (i, j) arc in the extraction diagram; This is the heuristic information associated with arc (i, j).

[0075] ④ Update the path and distance length ⑤ Repeat steps (3) and (4) until the ant reaches the destination, based on the ant's memory information.

[0076] ⑥ Update local pheromones; pheromones decrease along paths already traversed by ants.

[0077] ; Among them, point This indicates that the ant passes through points i and j.

[0078] ⑦ Then repeat (3) to (5) until the iteration of a certain generation of m ants ends.

[0079] ⑧ Delete redundant nodes that each ant passes through and update the ant's path.

[0080] ⑨ Update the pheromone matrix, excluding ants that have not yet arrived.

[0081] ; ; ⑩ Repeat (3) to (7) until the nth generation of ants finishes iterating, and select the optimal path from them.

[0082] (3) Path optimization based on geometry optimization: ① Redundant Node Removal: Redundant node removal refers to the process of deleting nodes that do not contribute substantially to the final path planning result or can be replaced by other nodes, thereby reconstructing the path planning. The application principle of redundant node removal is as follows: Figure 12 As shown.

[0083] Assume the ant colony consists of nodes Move to node The initial path planning is shown by the blue solid line in the figure: ,but A node is considered a direct link line that does not intersect with obstacles in a 2D grid map and whose length is shorter than the initial path. For nodes that do not contribute substantially to the final path, they are redundant nodes. Therefore, the path planning optimized by the geometric algorithm after removing redundant nodes is shown as the orange dashed line in the figure: .

[0084] ② Triangle Pruning: Triangle pruning is an optimization strategy that, during path search, prunes non-optimal paths by judging the triangular relationships formed by adjacent transition nodes and using triangle inequalities. The application principle of triangle pruning is as follows: Figure 13 As shown.

[0085] Assume the ant colony consists of nodes Move to node The initial path planning is shown by the blue solid line in the figure: , Its adjacent nodes A triangle relationship can be formed. According to the triangle inequality (the sum of the lengths of any two sides of a triangle is greater than the length of the third side), the nodes... With nodes The length of the directly connected path is shorter than the initially planned path. The length of the path is such that, after performing triangular pruning geometry optimization, the updated planned path is shown by the orange dashed line in the figure: .

[0086] (4) Simulation experiment: Based on the description and establishment of the above path planning method, this patent uses the programming tool MATLAB to conduct relevant simulation experiments. The experimental parameters are as follows: G4=[ 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0; 1 0 0 0 0 1 0 0 1 1 1 1 0 0 0; 1 0 0 0 0 1 0 0 1 1 1 1 0 0 0; 1 0 0 0 0 1 0 0 1 1 1 1 0 0 0; 1 0 0 1 1 1 0 0 0 0 0 0 0 0; 1 0 0 0 0 0 0 0 0 0 0 0 1 0; 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0; 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0; 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 1 0 0 0 1 1 1 0 0; 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0; 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0; 0 1 1 0 0 0 0 0 0 0 1 1 0 0; 0 1 1 0 0 0 0 1 1 1 1 1 1 0 0; 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; The starting point coordinates are (1, 15), the destination point coordinates are (15, 1), the occupied parameter t is 0.3 or 0.7, the number of ants is 50, the number of iterations is 100, the pheromone parameter is 2, the heuristic factor is 3, the local pheromone evaporation coefficient is 0.5, the pheromone evaporation coefficient is 0.2, and the pheromone enhancement coefficient is 1. The result is shown in the figure below. Figure 14 , Figure 15 : The shortest distance of the planned path for the mobile robot obtained using the above research results is 26.5853. The coordinates on the grid map that it passes through in sequence are (1, 15) → (2, 15) → (3, 10) → (10, 9) → (11, 8) → (14, 7) → (15, 1), and the corresponding node numbers are 155 → 156 → 105 → 101 → 88 → 81 → 15.

[0087] This invention focuses on the problem of establishing obstacle protection zones in two-dimensional maps and optimal path planning for mobile robots, aiming to achieve safe and efficient navigation and obstacle avoidance in complex environments. Through in-depth research, it successfully solves a series of path planning challenges for mobile robots in two-dimensional maps and proposes a variety of innovative algorithms and strategies.

[0088] Regarding the establishment of protected areas, a concave-convex polygon magnification algorithm based on the angle bisector method is proposed. This algorithm calculates the angle bisectors passing through the vertices of the polygon and combines this with the determination of the concavity or convexity of the vertices to achieve accurate polygon magnification, effectively overcoming the limitations of traditional methods when dealing with concave polygons. Simultaneously, the paper also investigates how to convert a 2D raster map into a polygon map and uses a planar boundary algorithm to determine the outer boundaries of obstacles, providing an accurate environmental model for subsequent path planning.

[0089] In terms of path planning, this invention comprehensively studies path planning for 2D raster maps and path planning after converting 2D raster maps into polygon maps. For 2D raster maps, an ant colony algorithm is employed, combined with various optimization strategies, such as redundant node removal, triangulation optimization, and polyline curve transformation, to improve path quality and safety. These methods not only optimize path length but also ensure path smoothness and feasibility. For path planning after converting to polygon maps, the paper also employs an advanced ant colony algorithm, combined with the same optimization strategies, ensuring consistency and efficiency in path planning across different map models.

[0090] The algorithm and strategy proposed in this invention have significant advantages. First, the polygon magnification algorithm based on the angle bisector method can accurately handle concave and convex polygons, ensuring the accuracy and integrity of the protected area. Second, the method of converting a two-dimensional raster map into a polygon map, combined with a planar boundary algorithm, can effectively simplify the environmental model and improve the efficiency and accuracy of path planning. Furthermore, the combination of the ant colony algorithm with multiple optimization strategies not only improves the quality of path planning but also enhances the robustness and adaptability of the algorithm.

[0091] In summary, this invention constructs protective boundaries for obstacles using polygon magnification technology and combines this with advanced path planning algorithms to achieve optimal path planning in a two-dimensional map. This not only improves the robustness and safety of path planning but also opens up new avenues for the application of mobile robots in complex environments. The research results provide new ideas and technical support for the development of intelligent navigation systems and are expected to be widely applied in multiple fields such as autonomous driving, warehouse management, environmental exploration, and rescue missions.

[0092] The present invention also provides an optimal path planning system for two-dimensional grid obstacles, comprising: A conversion module is used to identify obstacles in a two-dimensional grid map and convert the obstacles in the two-dimensional grid map into concave and convex polygonal obstacles; A construction module is used to enlarge the concave-convex polygonal obstacle at equal distances to construct a protective boundary surrounding the concave-convex polygonal obstacle; The location determination module is used to obtain the occupied parameters of the adjacent grids of the concave-convex polygonal obstacle based on the protection boundary, and determine the position of the feasible point in the feasible grid according to the occupied parameters, so as to obtain a two-dimensional grid map of the obstacle with the protection boundary. The planning module is used to perform path planning based on a two-dimensional grid map with protective boundaries of the obstacles, and to obtain a preliminary path using an improved ant colony algorithm. The optimization module is used to optimize the initial path to obtain the optimal path.

[0093] An embodiment of the present invention provides a terminal device. This terminal device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the various method embodiments described above. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the various device embodiments described above.

[0094] The computer program can be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention.

[0095] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0096] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0097] The memory can be used to store the computer program and / or module. The processor implements various functions of the terminal device by running or executing the computer program and / or module stored in the memory and calling the data stored in the memory.

[0098] If the modules / units integrated into the terminal device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory, random access memory, electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0099] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0100] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for optimal path planning with protected boundaries for two-dimensional grid obstacles, characterized in that, include: Identify obstacles in a two-dimensional grid map and convert the obstacles in the two-dimensional grid map into concave and convex polygonal obstacles; The concave-convex polygonal obstacle is magnified at equal intervals to construct a protective boundary surrounding the obstacle; Based on the protection boundary, the occupied parameters of the adjacent grids of the concave-convex polygon obstacle are obtained, and the position of the feasible point in the feasible grid is determined according to the occupied parameters, so as to obtain a two-dimensional grid map of the obstacle with the protection boundary. Based on a two-dimensional grid map with protective boundaries for the obstacles, an improved ant colony algorithm is used for path planning to obtain a preliminary path. The initial path is optimized to obtain the optimal path.

2. The optimal path planning method for two-dimensional grid obstacles with protected boundaries according to claim 1, characterized in that, Converting obstacles in a 2D raster map into convex or concave polygon obstacles includes: Traverse the binary matrix representing the two-dimensional grid map, and record the coordinates of the grid cells in the binary matrix whose values ​​are preset obstacle identifiers to obtain the grid coordinates of all obstacles; Based on the grid coordinates of the obstacles, a connected subgraph algorithm is used to classify the interconnected obstacle grids to obtain multiple connected obstacle regions. The planar graph algorithm based on complex networks calculates the correspondence between the obstacle grid and the concave-convex polygon obstacles based on the boundary vertex coordinates of each obstacle's connected region, so as to determine the vertex coordinates of each concave-convex polygon obstacle. Construct a concave-convex polygon obstacle map based on the vertex coordinates.

3. The optimal path planning method for two-dimensional grid obstacles with protected boundaries according to claim 1, characterized in that, The protective boundary is constructed by magnifying the concave-convex polygonal obstacle at equal intervals, including: Calculate the unit vector of the angle bisector passing through each vertex of the concave-convex polygonal obstacle and the corresponding included angle; Calculate the unit vector of each side of the concave-convex polygon obstacle, and determine whether the vertex is a convex or concave angle based on the vector product of the two adjacent sides of each vertex; Based on the expansion requirements, and combining the angle bisector unit vector and the corresponding included angle, calculate the new vertex positions of the expanded concave-convex polygon; The calculated new vertices are connected in a clockwise or counterclockwise order to construct an enlarged concave-convex polygon, thus obtaining the protection boundary.

4. The optimal path planning method for two-dimensional grid obstacles with protected boundaries according to claim 3, characterized in that, Based on the expansion requirements, and combining the angle bisector unit vector and the corresponding included angle, the new vertex positions of the expanded concave-convex polygon are calculated, including: Based on the expansion requirement, along the unit vector direction of the angle bisector corresponding to the concave vertex, the expanded candidate new vertex is calculated according to the included angle, and the expanded polygon edges are constructed based on the candidate new vertex. When intersection points other than vertices appear between the edges of the enlarged polygon constructed based on the enlargement requirements, the intersection points are determined as new vertices after the enlargement, replacing the original concave corner vertices located inside the enlarged polygon. When the edges of the enlarged polygon intersect only at a vertex, the intersection point at that vertex is determined as the new vertex after enlargement.

5. The optimal path planning method for two-dimensional grid obstacles with protected boundaries according to claim 1, characterized in that, An improved ant colony algorithm is used for path planning to obtain a preliminary path, including: Initialize the pheromone matrix of the passable grid, and set the start point, end point and algorithm parameters for path planning; Starting from the starting point, the ant selects the next grid node based on the pheromone concentration and heuristic function value of the surrounding grids during each step of its movement, and updates the path and path length. Once an ant reaches the termination point, its pheromone levels are updated locally along its traversed path to reduce the probability of subsequent ants choosing the same path. After multiple iterations, the preliminary path is obtained by filtering from all candidate paths.

6. The optimal path planning method for two-dimensional grid obstacles with protected boundaries according to claim 1, characterized in that, The method for optimizing the preliminary path includes: Geometric optimization strategies for removing redundant nodes and triangular pruning.

7. The optimal path planning method for a two-dimensional grid obstacle with a protected boundary according to claim 6, characterized in that, The geometric optimization strategies for deleting redundant nodes and triangulation include: Delete nodes that do not contribute substantially to the final path planning result or can be replaced by other nodes, and reconstruct the path; After reconstruction, multiple consecutive nodes are directly connected by a line segment that does not pass through obstacles, so that the path does not need to be reconstructed again by passing through other intermediate nodes. The optimal path is obtained.

8. An optimal path planning system for two-dimensional grid obstacles, characterized in that, include: A conversion module is used to identify obstacles in a two-dimensional grid map and convert the obstacles in the two-dimensional grid map into concave and convex polygonal obstacles; A construction module is used to enlarge the concave-convex polygonal obstacle at equal distances to construct a protective boundary surrounding the concave-convex polygonal obstacle; The location determination module is used to obtain the occupied parameters of the adjacent grids of the concave-convex polygonal obstacle based on the protection boundary, and determine the position of the feasible point in the feasible grid according to the occupied parameters, so as to obtain a two-dimensional grid map of the obstacle with the protection boundary. The planning module is used to perform path planning based on a two-dimensional grid map with protective boundaries of the obstacles, and to obtain a preliminary path using an improved ant colony algorithm. The optimization module is used to optimize the initial path to obtain the optimal path.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the optimal path planning method for a two-dimensional grid obstacle with a protected boundary as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the optimal path planning method for a two-dimensional grid obstacle with a protected boundary as described in any one of claims 1 to 7.