Map partitioning and coverage path planning method
By extracting and segmenting feature information from two-dimensional maps and combining different coverage strategies, efficient coverage paths are generated, which solves the problem of low efficiency of coverage path planning in the existing technology and achieves efficient coverage in diverse scenarios.
Patent Information
- Application Number
- CN202410719452.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing technology, the sub-unit of mobile robot coverage path planning relies on a single coverage strategy, resulting in low efficiency, and fails to fully utilize multiple coverage strategies to maximize efficiency.
Through the binarized two-dimensional map, the skeleton line and distance transformation information are extracted, the neighbor width entropy difference skeleton line map is constructed, and accurate map segmentation is performed. Different coverage strategies are determined according to the average width of the connected area, and a curve spiral or curve is generated. Linear reciprocation covers the path and uses greedy and A* algorithms to find collision-free transition paths.
Effectively integrates multiple coverage strategies to improve coverage efficiency and environmental adaptability, and is suitable for efficient coverage in diverse scenarios.
Smart Images

Figure CN118730144A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of robotics and artificial intelligence, and more specifically, relates to a map partitioning and coverage path planning method. Background Art
[0002] Regional coverage tasks are widely used in agriculture, manufacturing, service industry, search and rescue, and detection, and are characterized by single actions and high labor intensity. Mobile robots, with their excellent mobility, are ideal for performing these large-scale coverage tasks. For mobile robots to implement coverage operations, coverage path planning is one of the key technologies. As regional coverage tasks are evolving towards large-scale and intelligent outdoor operations, there is an urgent need for coverage efficiency and environmental adaptability of coverage path planning.
[0003] At present, in the face of the coverage path planning problem of mobile robots, the unit decomposition method or grid map method is often used to generate the coverage path. The sub-units generated by the above method use a single straight reciprocating, curved spiral coverage or other coverage methods to achieve coverage of the entire area, and fail to fully utilize the fusion of multiple coverage strategies according to the environmental characteristics of the sub-units to maximize efficiency.
[0004] The invention patent with the prior art publication number CN117664137A proposes a method for collaborative path planning of vehicles and vehicle-mounted drones, including: obtaining the boundary contour of the area to be covered by the vehicle-mounted drone; obtaining a first number of supply points based on the boundary contour, and dividing the boundary contour into the first number of sub-areas based on the supply points; generating the path trajectory of the vehicle based on the supply point set and using the Dijkstra shortest path algorithm; traversing each sub-area contour, and generating the corresponding vehicle-mounted drone flight trajectory path of the sub-area. This solution uses one of the straight-line reciprocating algorithm, the Contour-Parallel path algorithm, and the curved spiral algorithm for the decomposed sub-areas, and relies on a single coverage strategy. Summary of the invention
[0005] In order to overcome the problem of low efficiency of coverage strategy for decomposed sub-units in the prior art, the present invention provides a map partitioning and coverage path planning method, comprising the following steps:
[0006] S1: Using the two-dimensional map after binarization, determine the area to be covered and the obstacle area;
[0007] S2: Calculate the characteristic information of the two-dimensional map, determine the operation partitions applicable to different coverage strategies according to the characteristic information, and generate coverage paths in the operation partitions using the corresponding coverage strategies;
[0008] S3: extract the potential starting position of each work partition, and use the preset algorithm to find the potential starting position of the uncovered partition closest to the current position of the robot, and use the preset path algorithm to generate a collision-free transition path;
[0009] S4: The coverage path and transition path in the job partition are merged to form a global coverage path.
[0010] Furthermore, the step of calculating the feature information of the map in step S2 includes:
[0011] S2.1: Extract skeleton lines from the area to be covered in the map, use the thinning function of the OpenCV library to process the pixel point set of the area to be covered, and extract the skeleton pixel point set of the map; calculate the distance transformation value, perform distance transformation on the pixel point set of the area to be covered by a preset function, and calculate the distance from each pixel point to the nearest obstacle;
[0012] S2.2: Combining the skeleton pixel points with the distance transformation values, a skeleton line graph containing distance transformation information is obtained, and then a neighbor width entropy difference skeleton line graph is constructed by a preset method;
[0013] S2.3: Using a preset method to achieve accurate map segmentation on the skeleton line map to obtain a segmented pixel point set;
[0014] S2.4: extracting all independent connected regions from the segmented pixel point set using a preset method, and summarizing the regions into separate elements, and adding them to the connected region set;
[0015] S2.5: For each segmented connected area, calculate the average width of its connected pixel point set, classify each area according to a preset method, determine the job partitions applicable to different coverage strategies, and use the corresponding coverage strategies to generate coverage paths within the job partitions.
[0016] Furthermore, the preset function for performing distance transformation on the set of pixels to be covered in step S2.1 is the distanceTransform function of the OpenCV library.
[0017] Furthermore, the method for constructing the neighbor width entropy difference skeleton line map in step S2.2 is by traversing each skeleton pixel point, and extracting the neighbor skeleton point set according to a preset neighbor distance threshold, using the floodFill function of the OpenCV library to divide the neighbor skeleton point set into two segments, calculating the width entropy difference of the two segments of neighbor skeleton lines, comparing the neighbor skeleton entropy difference with the preset neighbor entropy difference threshold, and when the neighbor skeleton entropy difference is greater than the threshold, it is determined as a segmentation point, and a neighbor width entropy difference skeleton line map is constructed.
[0018] Furthermore, the method for achieving map segmentation in step S2.3 is to draw a circular area around the segmentation pixel points, the radius of the circle is set to the sum of the distance transformation value and the preset division point range threshold, and compared with the maximum segmentation circle radius to take the smaller value, the obstacle pixel points within this range are used as the point cluster to be segmented, and the point cluster to be segmented is processed by applying the K-Means clustering algorithm, the number of clusters is set to two, and the two cluster center points are connected by the line function of the OpenCV library to achieve accurate segmentation of the entire map.
[0019] Furthermore, the method for extracting connected regions in step S2.4 uses the floodFill function in the OpenCV library. Whenever a connected region is successfully identified by the floodFill function of the OpenCV library, it is taken as an independent element and included in the connected region set after segmentation.
[0020] Furthermore, the step of classifying the regions in step S2.5 includes:
[0021] If the average width of a connected area is less than the preset width threshold of the partition coverage method, the area is classified as a narrow area;
[0022] If the average width of a connected area is greater than the preset partition coverage width threshold, the area is classified as an open area.
[0023] Furthermore, the coverage strategy in step S2.5 uses a curved spiral coverage strategy for narrow areas and a straight reciprocating coverage strategy for open areas.
[0024] Furthermore, the algorithm for finding the potential starting position of the uncovered partition closest to the current position of the robot in step S3 is a greedy algorithm.
[0025] Furthermore, the algorithm for generating the collision-free transition path in step S3 is an A* algorithm.
[0026] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0027] This application is aimed at two-dimensional plane coverage path planning and designs a method that can effectively integrate multiple coverage strategies to give full play to the advantages of each coverage strategy under specific environmental conditions and improve the coverage efficiency and adaptability in diverse scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to make the purpose and technical solution of the present invention clearer, the present invention provides the following drawings and descriptions:
[0029] Figure 1A flow chart of a map partitioning and coverage path planning method provided by an embodiment of the present invention;
[0030] Figure 2 A schematic diagram of a partitioning process based on map width features provided in an embodiment of the present invention;
[0031] Figure 3 A schematic diagram of candidate starting points for partitions provided in an embodiment of the present invention;
[0032] Figure 4 A schematic diagram of coverage path results provided by an embodiment of the present invention; DETAILED DESCRIPTION
[0033] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0034] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0035] like Figure 1 The figure shows a flow chart of a map partitioning and coverage path planning method provided by the present invention, and the specific steps are as follows:
[0036] S1: Using the two-dimensional map after binarization, determine the area to be covered and the obstacle area;
[0037] In a specific embodiment, the input map is a binary two-dimensional bitmap, such as Figure 2 As shown in a, the white area of the input map is the area to be covered O f , the gray area is the obstacle area O o .
[0038] S2: Calculate the characteristic information of the two-dimensional map, determine the operation partitions applicable to different coverage strategies according to the characteristic information, and generate coverage paths in the operation partitions using the corresponding coverage strategies;
[0039] The specific process is:
[0040] S2.1: extract skeleton lines from the area to be covered in the map, process the pixel point set of the area to be covered using a preset function, and extract the skeleton pixel point set of the map; calculate the distance transformation value, perform distance transformation on the pixel point set of the area to be covered using a preset function, and calculate the distance from each pixel point to the nearest obstacle;
[0041] It should be noted that in step S2.1, the preset function for processing the pixel point set of the covered area and extracting the skeleton pixel point set of the map is the thinning function of the OpenCV library, and the preset function for performing distance transformation on the covered pixel point set is the distanceTransform function of the OpenCV library.
[0042] In a specific embodiment, the area to be covered O of the map f Extract the skeleton line and use the thinning function of the OpenCV library to treat the covered pixel point set O f Process and extract the skeleton pixel point set O of the map s ,This step effectively simplifies the data representation of the map, and simplifies the complex map shape into a map centerline structure, such as Figure 2 Next, we calculate the distance transformation of the map and treat the set of covered pixels O as the distanceTransform function of the OpenCV library. f Perform distance transformation to calculate each pixel The distance to the nearest obstacle T(o) is used to obtain the histogram data set n v is the number of elements in V. This process provides the basis for the subsequent analysis of map width information, such as Figure 2 As shown in c.
[0043] S2.2: Combining the skeleton pixel points with the distance transformation values, a skeleton line graph containing distance transformation information is obtained, and then a neighbor width entropy difference skeleton line graph is constructed by a preset method;
[0044] It should be noted that the method for constructing the neighbor width entropy difference skeleton line map in step S2.2 is by traversing each skeleton pixel point, and extracting the neighbor skeleton point set according to a preset neighbor distance threshold, using the floodFill function of the OpenCV library to divide the neighbor skeleton point set into two segments, calculating the width entropy difference of the two segments of the neighbor skeleton lines, comparing the neighbor skeleton entropy difference with the preset neighbor entropy difference threshold, and when the neighbor skeleton entropy difference is greater than the threshold, it is determined as a segmentation point, and a neighbor width entropy difference skeleton line map is constructed.
[0045] In a specific embodiment, combining skeleton pixels With the distance transformation value T(o), we get a skeleton line graph containing distance transformation information. This combination not only intuitively displays the width information of the center line of the map, but also effectively reduces the amount of data and improves the calculation efficiency. Figure 2 As shown in d.
[0046] Next, the entropy difference skeleton is calculated by traversing each skeleton pixel And according to the preset neighbor distance threshold τn Extract neighbor skeleton point set O n , use the floodFill function of the OpenCV library to divide the neighbor skeleton point set into O nl and O nr Two segments, assuming that the histogram weight set is In this embodiment, it is assumed that the weights are all 1, v max is the maximum value in the histogram data set V, v min is the minimum value in the histogram data set V, τ H is the number of histogram intervals, and the lower bound of the i-th interval is a i :
[0047]
[0048] The upper bound of the i-th interval is b i :
[0049]
[0050] I i ={v|v∈V,a i <v≤b i} is the i-th interval of histogram H, and the frequency of the i-th interval is ρ i :
[0051]
[0052] The constructor of the histogram is:
[0053]
[0054] τ H is the number of histogram intervals, is the set of two neighbor skeleton points O nl and O nr Construct the histogram H respectively nl and H nr The entropy E(H) of histogram H is:
[0055]
[0056] By substituting the calculation, we can get the width entropy difference e of the two neighbor skeleton lines. d :
[0057] e d =|E(H nl )-E(H nr )|
[0058] By comparing the neighbor skeleton entropy difference e d With the predetermined threshold τ e , when e d Greater than τe These segmentation points identify areas with significant width changes. Entropy difference is used to measure the change in width distribution on the left and right sides of the pixel. Large entropy difference reflects the transition position from balanced width to variable width in the local environment. The constructed neighbor width entropy difference skeleton line graph is shown in Figure 2 e.
[0059] S2.3: Using a preset method to achieve accurate map segmentation on the skeleton line map to obtain a segmented pixel point set;
[0060] It should be noted that the method for implementing map segmentation in step S2.3 is to draw a circular area around the segmented pixel point, and the radius of the circle is set to the distance transformation value T( s ) and the preset division point range threshold τ k The sum of the points is compared with the maximum segmentation circle radius and the smaller value is taken. The obstacle pixels within this range are taken as the point cluster to be segmented O. k , the K-Means clustering algorithm is applied to process the cluster of points to be segmented, and the number of clusters is set to two, in order to effectively extract the segmentation cluster centers on both sides of the map road from the set of points to be segmented. The two cluster center points are connected by the line function of the OpenCV library to achieve accurate segmentation of the entire map.
[0061] In a specific embodiment, by for each neighbor width entropy difference e d Greater than the preset threshold τ e Repeating the above operation on the segmented pixel points can complete the accurate segmentation of the entire map and obtain the segmented pixel point set O m ,like Figure 2 f.
[0062] S2.4: extracting all independent connected regions from the segmented pixel point set using a preset method, and summarizing the regions into separate elements, and adding them to the connected region set;
[0063] It should be noted that the method for extracting connected regions in step S2.4 uses the floodFill function in the OpenCV library. Whenever a connected region is successfully identified by the floodFill function of the OpenCV library, it is taken as an independent element and included in the connected region set after segmentation.
[0064] In a specific embodiment, whenever a connected region is successfully identified by the floodFill function of the OpenCV library, it is treated as an independent element. c , included in the connected region set R after segmentation c In. Figure 2 g, each connected region is marked with a different color.
[0065] S2.5: For each segmented connected region, calculate the average width f of its connected pixel set avg_w :
[0066]
[0067] Quantify the spatial width characteristics of each region by using the width threshold τ with the partition coverage method w Compare and classify each area, determine the job partitions applicable to different coverage strategies, and generate coverage paths within the job partitions using the corresponding coverage strategies;
[0068] It should be noted that the step of classifying the regions in step S2.5 includes:
[0069] If the average width of a connected area is less than the preset width threshold of the partition coverage method, the area is classified as a narrow area;
[0070] If the average width of a connected area is greater than the preset partition coverage width threshold, the area is classified as an open area.
[0071] A curved spiral covering strategy is used for narrow areas, and a straight reciprocating covering strategy is used for open areas.
[0072] In a specific embodiment, for each segmented connected region The average width of the connected pixel set is calculated by formula (1) to quantify the spatial width characteristics of each region. The width threshold τ is calculated by the partition coverage method. w Compare and classify each region. If the average width of a connected region is less than the threshold, the region is classified as a narrow region. a , indicating that its spatial structure is relatively compact, there may be multiple obstacles or narrow channels, so it is more suitable to adopt a curved spiral coverage strategy for flexible coverage. On the contrary, if the average width of the connected area is greater than the threshold, the area is considered to be an open area O b , its space is relatively spacious, suitable for a linear reciprocating coverage strategy to achieve efficient area coverage.
[0073] S3: extract the potential starting position of each work partition, and use the preset algorithm to find the potential starting position of the uncovered partition closest to the current position of the robot, and use the preset path algorithm to generate a collision-free transition path;
[0074] It should be noted that the algorithm for finding the potential starting position of the uncovered partition closest to the current position of the robot in step S3 is a greedy algorithm, and the algorithm for generating a collision-free transition path is an A* algorithm.
[0075] In a specific embodiment, Figure 3 The figure shows the location of the candidate starting point of the partition. According to the lateral path spacing τ input by the algorithm x and the longitudinal path point spacing τ y , the potential starting point of each subunit can be determined, and these starting points are set by O sp express. Figure 3 The left picture shows that there are four potential starting points for the reciprocating covering unit. These starting points are distributed at the four corners of the unit and represent the locations where the reciprocating covering operation may be started. Figure 3 The right picture shows the potential starting point of the spiral covering contour unit. Since the covering method adopts a spiral path, each path point can be regarded as a potential starting point. When there are units that have not been covered, the multi-source shortest path is used to find the robot's location. r The nearest starting point o * . The multi-source shortest path aims to calculate the distance from the starting point to each pixel in the map, which is achieved through a variant of the Dijkstra algorithm. The Dijkstra algorithm is a type of path planning algorithm, which is usually used to calculate the single-source shortest path problem, that is, the shortest path from one vertex to another vertex in the graph. The variant algorithm used in this study traverses all possible path points on the map and continuously updates the shortest path length to each point until the shortest collision-free path length to all pixels is found. By applying this multi-source shortest path algorithm, it can be ensured that when there are multiple candidate starting points in a large-scale map, the nearest starting point can be selected to reduce the robot's invalid movement and improve the execution efficiency of the coverage task. Use the A* point-to-point path planning algorithm to generate a path from the robot's current location o r To its nearest starting point o * The shortest collision-free transition path P t The A* algorithm is an efficient path planning method that finds the optimal path by evaluating the estimated cost from the starting point to the end point. The generated transition path is then added to the global coverage path P c middle.
[0076] S4: The coverage path and transition path in the job partition are merged to form a global coverage path.
[0077] In a specific embodiment, Figure 4 The following is a schematic diagram of the coverage path results of this application. The gray area is the obstacle area, and the black line represents the coverage path. This application combines the straight reciprocating and curved spiral coverage strategies, which can automatically partition and select a better coverage strategy according to environmental characteristics, generating an efficient collision-free full coverage path.
[0078] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A map partitioning and coverage path planning method, characterized in that: The steps include: S1: Using the two-dimensional map after binarization, determine the area to be covered and the obstacle area; S2: Calculate the characteristic information of the two-dimensional map, determine the operation partitions applicable to different coverage strategies according to the characteristic information, and generate coverage paths in the operation partitions using the corresponding coverage strategies; S3: extract the potential starting position of each work partition, and use the preset algorithm to find the potential starting position of the uncovered partition closest to the current position of the robot, and use the preset path algorithm to generate a collision-free transition path; S4: The coverage path and transition path in the job partition are merged to form a global coverage path.
2. A map partitioning and coverage path planning method according to claim 1, characterized in that: The step of calculating the feature information of the map in step S2 includes: S2.1: Extract skeleton lines from the area to be covered in the map, use the thinning function of the OpenCV library to process the pixel point set of the area to be covered, and extract the skeleton pixel point set of the map; calculate the distance transformation value, perform distance transformation on the pixel point set of the area to be covered by a preset function, and calculate the distance from each pixel point to the nearest obstacle; S2.2: Combining the skeleton pixel points with the distance transformation values, a skeleton line graph containing distance transformation information is obtained, and then a neighbor width entropy difference skeleton line graph is constructed by a preset method; S2.3: Using a preset method to achieve accurate map segmentation on the skeleton line map to obtain a segmented pixel point set; S2.4: extracting all independent connected regions from the segmented pixel point set using a preset method, and summarizing the regions into separate elements, and adding them to the connected region set; S2.5: For each segmented connected area, calculate the average width of its connected pixel point set, classify each area according to a preset method, determine the job partitions applicable to different coverage strategies, and use the corresponding coverage strategies to generate coverage paths within the job partitions.
3. A map partitioning and coverage path planning method according to claim 2, characterized in that: The preset function for performing distance transformation on the set of pixels to be covered in step S2.1 is the distanceTransform function of the OpenCV library.
4. A map partitioning and coverage path planning method according to claim 2, characterized in that: The method for constructing the neighbor width entropy difference skeleton line graph in step S2.2 is by traversing each skeleton pixel point, and extracting the neighbor skeleton point set according to a preset neighbor distance threshold, using the floodFill function of the OpenCV library to divide the neighbor skeleton point set into two segments, calculating the width entropy difference of the two segments of neighbor skeleton lines, comparing the neighbor skeleton entropy difference with the preset neighbor entropy difference threshold, and when the neighbor skeleton entropy difference is greater than the threshold, it is determined as a segmentation point, and a neighbor width entropy difference skeleton line graph is constructed.
5. A map partitioning and coverage path planning method according to claim 2, characterized in that: The method for achieving map segmentation in step S2.3 is to draw a circular area around the segmentation pixel points, the radius of the circle is set to the sum of the distance transformation value and the preset division point range threshold, and compared with the maximum segmentation circle radius to take the smaller value, the obstacle pixel points within this range are used as the point cluster to be segmented, the point cluster to be segmented is processed by applying the K-Means clustering algorithm, the number of clusters is set to two, and the two cluster center points are connected by the line function of the OpenCV library to achieve accurate segmentation of the entire map.
6. A map partitioning and coverage path planning method according to claim 2, characterized in that: The method for extracting connected regions in step S2.4 is to use the floodFill function in the OpenCV library. Whenever a connected region is successfully identified by the floodFill function of the OpenCV library, it is taken as an independent element and included in the connected region set after segmentation.
7. A map partitioning and coverage path planning method according to claim 2, characterized in that: The step of classifying the regions in step S2.5 comprises: If the average width of a connected area is less than the preset width threshold of the partition coverage method, the area is classified as a narrow area; If the average width of a connected area is greater than the preset partition coverage width threshold, the area is classified as an open area.
8. A map partitioning and coverage path planning method according to claim 2, characterized in that: The covering strategy in step S2.5 uses a curved spiral covering strategy for narrow areas and a straight reciprocating covering strategy for open areas.
9. A map partitioning and coverage path planning method according to claim 1, characterized in that: The algorithm for finding the potential starting position of the uncovered partition closest to the current position of the robot in step S3 is a greedy algorithm.
10. A map partitioning and coverage path planning method according to claim 1, characterized in that: The algorithm for generating the collision-free transition path in step S3 is the A* algorithm.
