Cleaning path planning method and device, and related product
Patent Information
- Application Number
- CN202211310421.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-25
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2042-10-25
AI Technical Summary
[0006]本发明的目的是针对现有技术的缺陷,提供一种清扫路径规划方法、装置、程序产品、介质、计算机装置和移动工具,以解决现有技术中清扫效果不理想的技术问题
[0050] The cleaning path planning method, device, and related products provided by this invention determine whether the corroded area can cover the cleaning area. If it cannot cover the cleaning area, a cleaning path is generated by finding the skeleton line. If it can cover the cleaning area, a cleaning path is generated according to the circumscribed rectangle method. This reduces unnecessary repeated cleaning paths, better conforms to the vehicle motion model, and achieves efficient cleaning of any small polygonal cleaning area.
Smart Images

Figure CN117991763B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of autonomous driving technology, and in particular to a cleaning path planning method, apparatus, program product, medium, computer device, and mobile tool. Background Technology
[0002] Currently, autonomous sweeping vehicles employ a full-coverage approach when planning paths for the area to be cleaned. First, a coverage path is planned for the area to be cleaned on an existing map. For areas missed due to dynamic obstacles during the cleaning process, two methods are typically used for re-cleaning after the initial cleaning: one is to repeat the originally planned path; the other is to re-plan the path for the missed areas, analyzing the grid entry and exit points of the missed areas regardless of their shape, and generating a "bow"-shaped cleaning path for re-cleaning.
[0003] For Method 1, the previously planned path is executed again. If there are new obstacles in the area, the cleaning will be invalid. Since the missed area is often larger than the width of a cleaning path, if the re-sweeping path has many broken lines, it is very unfriendly to non-circular sweepers and does not conform to the vehicle motion model, resulting in poor performance in actual execution.
[0004] Method 2, which only analyzes the area entrance and exit, can simplify the planning path, but it is not applicable to missed areas near obstacles or the edges of irregular areas. It often results in cleaning beyond the area and many repeated cleanings.
[0005] In summary, the current cleaning results are not ideal. Summary of the Invention
[0006] The purpose of this invention is to address the shortcomings of existing technologies by providing a cleaning path planning method, apparatus, program product, medium, computer device, and mobile tool to solve the technical problem of unsatisfactory cleaning results in existing technologies.
[0007] To achieve the above objectives, the first aspect of the present invention provides a cleaning path planning method, comprising:
[0008] Obtain the cleaning area image, and erode the boundary of the cleaning area image of each connected cleaning area inward by half the width of the sweeper vehicle to generate an eroded area image;
[0009] Determine whether the image of the corroded area covers the image of the cleaned area;
[0010] If not, find the main skeleton line of the image of the cleaning area; generate a first planning path along the main direction of the main skeleton line;
[0011] If so, find the location of the bounding rectangle of the cleaning area image, and generate a second planning path based on the location of the bounding rectangle;
[0012] Connect all the first and second planning paths within the entire region to generate the overall planning path.
[0013] Furthermore, the step of generating the second planned path based on the position of the circumscribed rectangle specifically involves:
[0014] If the width of the circumscribed rectangle is not greater than the vehicle width, the second planned path is generated based on the centerline of the main direction of the circumscribed rectangle;
[0015] If the width of the circumscribed rectangle is greater than the width of the vehicle, sampling line segments are drawn outwards from the center point of the circumscribed rectangle. The midpoint of the line connecting the two intersection points of the sampling line segments and the image of the cleaning area is used to generate the second planning path.
[0016] Furthermore, the sampling line segments are drawn according to a preset angle interval.
[0017] Furthermore, the setting of the sampling line segment is specifically as follows:
[0018] Set the distance from the center point of the circumscribed rectangle to the vertex of the circumscribed rectangle as the length of the sampling line segment;
[0019] A sampling circle is drawn with the center of the circumscribed rectangle as the origin and the length of the sampling line segment as the radius. The sampling line segment is the radius of the sampling circle.
[0020] Furthermore, if the corroded area cannot cover the image of the cleaned area, the main skeleton line of the image of the cleaned area is found, specifically as follows:
[0021] Construct a triangular mesh of the cleaning area image, and extract the skeleton lines of the cleaning area image based on the triangular mesh;
[0022] Compare the total area of the triangles contained in each skeleton line, and mark the skeleton line with the largest total area of triangles as the main skeleton line.
[0023] Furthermore, generating the first planned path along the direction of the main skeleton line includes:
[0024] Connecting the centroids of the triangles contained in the main skeleton line generates a first undetermined planning path;
[0025] The undetermined first planned path is expanded by half the vehicle width to generate an expanded region image;
[0026] If the area of the inflated region image reaches a preset coverage threshold, the undetermined first planning path is marked as the first planning path.
[0027] If the area of the inflated region image does not reach the preset coverage threshold, two planning paths are generated horizontally and horizontally with the undetermined first planning path as the central axis, and the two planning paths are marked as the first planning path.
[0028] Furthermore, the distance between the two planned paths and the undetermined first planned path is no greater than half the vehicle width.
[0029] Furthermore, before finding the location of the circumscribed rectangle of the cleaning area image and generating the second planned path based on the location of the circumscribed rectangle, the method further includes:
[0030] Determine whether the position of the image of the cleaned area is at the edge of the obstacle;
[0031] If so, the edge of the obstacle is expanded outward by a preset expansion value to generate the second planned path;
[0032] If not, proceed to find the location of the bounding rectangle of the cleaning area image, and generate a second planning path based on the location of the bounding rectangle.
[0033] Furthermore, the step of expanding the edge of the obstacle outward by a preset expansion value to generate the second planned path specifically involves:
[0034] The edge of the obstacle is expanded outward by a preset expansion value to generate a second undetermined planning path.
[0035] The collision location waypoints of the undetermined second planned path are detected based on the vehicle model;
[0036] Draw the normal to the undetermined second planned path through the waypoints at the collision locations;
[0037] The collision location waypoint is translated away from the obstacle along the normal direction to generate a safe location waypoint;
[0038] The second planned path is generated by connecting the safe location waypoints and the non-collision location waypoints of the undetermined second planned path.
[0039] Furthermore, the step of connecting all first and second planned paths within the entire area to generate the overall planned path specifically involves:
[0040] By connecting each first and second planning path within the entire region using Bézier curves, a total planning path is generated.
[0041] A second aspect of the present invention provides a cleaning path planning device, comprising:
[0042] The data processing module is used to acquire images of the cleaning area, and to erode half the width of the sweeper vehicle inward from the boundary of the cleaning area image of each connected cleaning area to generate an eroded area image.
[0043] The determination module is used to determine whether the image of the corroded area covers the image of the cleaned area;
[0044] An execution module is used to execute the result of the judgment module; if not, it finds the main skeleton line of the cleaning area image; and generates a first planning path along the main direction of the main skeleton line; if yes, it finds the position of the outer rectangle of the cleaning area image and generates a second planning path based on the position of the outer rectangle.
[0045] The path output module is used to connect all the first and second planned paths in the entire area to generate the overall planned path.
[0046] A third aspect of the present invention provides a computer program product that, when run on a computer, causes the computer to perform the cleaning path planning method as described in any of the first aspects.
[0047] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the first aspects.
[0048] A fifth aspect of the present invention provides a computer apparatus, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method according to any one of the first aspects.
[0049] A sixth aspect of the present invention provides a mobile tool, characterized in that it includes the computer device described in the fifth aspect.
[0050] The cleaning path planning method, device, and related products provided by this invention determine whether the corroded area can cover the cleaning area. If it cannot cover the cleaning area, a cleaning path is generated by finding the skeleton line. If it can cover the cleaning area, a cleaning path is generated according to the circumscribed rectangle method. This reduces unnecessary repeated cleaning paths, better conforms to the vehicle motion model, and achieves efficient cleaning of any small polygonal cleaning area. Attached Figure Description
[0051] Figure 1 This is one of the flowcharts for the cleaning path planning method provided in Embodiment 1 of the present invention;
[0052] Figure 2 This is a schematic diagram of the main skeleton line of the cleaning area image provided in Embodiment 1 of the present invention;
[0053] Figure 3This is a schematic diagram of generating a second planned path based on the center line of the main direction of the circumscribed rectangle, provided in Embodiment 1 of the present invention.
[0054] Figure 4 This is a schematic diagram illustrating the location of the center line of the cleaning area using a sampling circle, provided in Embodiment 1 of the present invention.
[0055] Figure 5 This is the second flowchart of the cleaning path planning method provided in Embodiment 1 of the present invention;
[0056] Figure 6 This is a schematic diagram of obstacle edge expansion path planning provided in Embodiment 1 of the present invention;
[0057] Figure 7 This is a schematic diagram of the cleaning path planning device provided in Embodiment 2 of the present invention;
[0058] Figure 8 This is a schematic diagram of the computer program product structure provided in Embodiment 3 of the present invention;
[0059] Figure 9 This is a schematic diagram of the computer device structure provided in Embodiment 5 of the present invention. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.
[0061] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.
[0062] This invention can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, elements, data structures, etc., that perform a specific task or implement a specific abstract data type. This invention can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0063] In this invention, terms such as "module," "device," and "system" refer to relevant entities applied to a computer, such as hardware, combinations of hardware and software, software, or software in execution. More specifically, for example, an element can be, but is not limited to, a process running on a processor, a processor, an object, an executable element, an execution thread, a program, and / or a computer. Furthermore, an application program or script running on a server, and the server itself, can also be an element. One or more elements may be in an execution process and / or thread, and elements may be localized on a single computer and / or distributed across two or more computers, and may be run on various computer-readable media. Elements can also communicate via local and / or remote processes based on signals having one or more data packets, for example, signals from data interacting with another element in a local system, a distributed system, and / or interacting with other systems via signals over a network of the Internet.
[0064] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising" or "including" include not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0065] The cleaning path planning method, device, and related products provided by this invention determine different image size and location features, such as whether a vehicle width can cover the entire area of the cleaning area image, and whether it is located near obstacles. Different methods, such as circumscribed rectangle, main skeleton extraction, and obstacle edge expansion, are used to dynamically plan the cleaning path, reducing the planning of backtracking paths and achieving effective and efficient cleaning of any small polygonal area or area near obstacles.
[0066] Example 1
[0067] The executing entity of this application is a terminal, server, or processor with computing capabilities. This method can be used in any irregular area, such as a narrow, winding corridor or an irregular site with many obstacles. This is an example, not a limitation. This application illustrates the application of this method to generate coverage paths for missed areas in autonomous cleaning equipment (e.g., autonomous vehicles (sanitation vehicles, sweepers, floor scrubbers, vacuum cleaners, etc.), cleaning robots, etc.). When this method is applied to autonomous vehicles, the executing entity is the Automated Vehicle Control Unit (AVCU), i.e., the central processing unit of the autonomous vehicle. This embodiment of the invention uses an autonomous vehicle as an example for illustration.
[0068] Figure 1 This is one of the flowcharts for the cleaning path planning method provided in Embodiment 1 of the present invention, such as... Figure 1 As shown, the cleaning path planning method includes:
[0069] Step 110: Obtain the cleaning area image, and erode half the width of the sweeper vehicle inward from the boundary of the cleaning area image of each connected cleaning area to generate an eroded area image.
[0070] Since the vehicle model is not a point mass and has fixed length and width dimensions, the planar map can be rasterized according to the size of the vehicle model for easier image processing. The image of the cleaned area on the planar map is obtained, and the grid cells occupied by the cleaned area image can be labeled with color or numbers in the raster map to distinguish it from non-cleaned areas.
[0071] In a specific example, suppose the image of the cleaning area is the image of the missed cleaning area. The image is rasterized, and the size of the raster elements is set according to the size of the vehicle model. The planned cleaning area is marked with a raster of 255, and the obstacle raster is marked with 0. During the cleaning process, the raster of the cleaned area is changed to 180. The remaining raster of the area marked with 255 on the plane map is the raster image of the missed cleaning area. The raster of the remaining raster of the area marked with 255 is changed to 100. In the planned cleaning area, the missed cleaning area grid usually contains several relatively independent small connected regions. Find the boundary grid of each connected region of missed cleaning, and erode half the width of the sweeper into the missed cleaning area from the boundary grid of each connected cleaning area. The number of grids occupied by half the width of the sweeper can be calculated based on the correspondence between the size of the grid element and the size of half the width of the sweeper. Here, it is assumed that the number of grids occupied by half the width of the sweeper is N. Change the grid mark of the grid that erodes N grids inward along the boundary grid to 150. The grid image of the eroded area is the grid marked 150.
[0072] Step 120: Determine whether the image of the corroded area covers the image of the cleaned area.
[0073] Step 130: If the image of the corroded area cannot cover the image of the cleaned area, find the main skeleton line of the cleaned area image; generate the first planned path along the direction of the main skeleton line.
[0074] In the specific example of step 110, if a grid marked as 255 can be found in the missed connected region, then the eroded region image cannot cover the missed cleaning region image. This means that when the cleaning vehicle moves along the inward eroded edge, the outer edge of the cleaning vehicle cannot completely cover the boundary of the cleaning region image. There are missed cleaning regions, and a single path cannot fully cover the missed cleaning regions.
[0075] The skeleton lines of the cleaned area image are drawn using an image skeleton extraction algorithm, the direction of the main skeleton line is found, and the first planned path is generated along the direction of the main skeleton line.
[0076] In one possible implementation, since the edge contour of the missed area is complex, and considering that the vehicle model itself has a certain width, an approximate contour description is sufficient for cleaning, and a complete description of the edge contour is not required. For ease of calculation and to reduce computational load, the cleaning area image is converted into an approximate geometric polygon that closely approximates the edge contour of the missed area. A triangular mesh of the cleaning area image is constructed for this geometric polygon. Optionally, the triangular mesh is a constrained Delaunay triangular mesh. The skeleton lines of the cleaning area image are extracted based on the triangular mesh. Specifically, all triangles in the triangular mesh are traversed, an adjacency tree is established, and the centroids of adjacent triangles are connected to form the skeleton line structure of the entire geometric polygon. The total area value of the triangles contained in each skeleton line is compared, and the skeleton line with the largest total area value is marked as the main skeleton line. Figure 2 This is a schematic diagram of the main skeleton line of the cleaning area image provided in Embodiment 1 of the present invention, as shown below. Figure 2 As shown, it includes geometric polygon 1, triangular mesh 2, and main skeleton line 3. By finding the direction of the main skeleton line and planning the cleaning path, the missed area can be cleaned to the maximum extent in one go.
[0077] In a preferred embodiment, generating a first planned path along the main framework line includes:
[0078] First, the centroids of the triangles contained in the main skeleton line are used to generate the first planned path to be determined.
[0079] Secondly, the first planned path to be determined is expanded by half the vehicle width to generate an expanded region image.
[0080] If the area of the inflated region reaches a preset coverage threshold, the undetermined first planning path is marked as the first planning path.
[0081] If the area of the inflated region does not reach the preset coverage threshold, two planning paths are generated horizontally and horizontally with the undetermined first planning path as the central axis, and the two planning paths are marked as the first planning path.
[0082] Specifically, expanding the area by half the vehicle width to both sides along the direction of the first planned path generates expanded region images. If the area of the expanded region image reaches a preset coverage threshold, it means that most of the missed cleaning areas can be cleaned by one coverage path. Optionally, the coverage threshold is set to 80%. If the area of the expanded region image does not reach the preset coverage threshold, it means that most of the missed cleaning areas cannot be cleaned by one coverage path. In this case, two planned paths are generated along the direction of the main frame line. In one possible implementation, two planned paths are generated parallel to each other with the first planned path as the central axis. The two planned paths are marked as the first planned path. Preferably, the distance between the two planned paths and the first planned path is no greater than half the width of the vehicle model, to ensure that no new missed cleaning areas are generated after the sweeper has traveled through these two planned paths, thereby reducing the number of cleaning operations and improving cleaning efficiency.
[0083] After performing supplementary cleaning on one or two routes by generating the first planned path along the main skeleton line, if there are still missed cleaning areas, return to step 110 after completing step 140 below to perform cyclic supplementary cleaning.
[0084] When the image of the cleaning area cannot be completely covered by a planned path, the planned path can be generated by extracting the main skeleton, which can clean the area to the maximum extent on the first attempt, thereby reducing the number of cleaning times and improving cleaning efficiency.
[0085] Step 140: If the image of the corroded area can cover the image of the cleaned area, find the position of the bounding rectangle of the cleaned area image, and generate a second planned path based on the position of the bounding rectangle.
[0086] By using the bounding rectangle graphic processing algorithm, the maximum and minimum values of the x and y coordinates of the outer boundary of the irregular cleaning area image are found, and the coordinates of the four vertices of the bounding rectangle of the irregular cleaning area image are calculated, which are the positions of the bounding rectangle of the cleaning area image.
[0087] In a preferred embodiment, step 140 includes:
[0088] First, if the width of the circumscribed rectangle is not greater than the vehicle width, a second planned path is generated based on the centerline of the main direction of the circumscribed rectangle.
[0089] Based on the coordinates of the four vertices of the circumscribed rectangle, calculate the long and short sides of the circumscribed rectangle. The direction of the long side is the main direction of the circumscribed rectangle. When the length of the short side of the circumscribed rectangle is not greater than the width of the sweeping vehicle, it means that the missed sweeping area can be completely covered by a planned route. A second planned path is generated based on the center line of the main direction of the circumscribed rectangle. The center of the sweeping vehicle can complete the full coverage sweeping by following the second planned path. Figure 3 This is a schematic diagram of generating a second planned path based on the centerline of the main direction of the circumscribed rectangle, as provided in Embodiment 1 of the present invention. Figure 3 As shown, it includes the circumscribed rectangle 4 and the center line 5.
[0090] When the image of the corroded area can cover the image of the cleaning area, and the width of the circumscribed rectangle is no greater than the width of the vehicle, since the shortest distance between two points is a straight line, the vehicle can achieve full coverage in one cleaning operation by following the center line of the main direction of the circumscribed rectangle, and can also complete the cleaning in the shortest time, thus improving the cleaning efficiency.
[0091] Secondly, if the width of the circumscribed rectangle is greater than the width of the vehicle, sampling line segments are drawn outwards from the center point of the circumscribed rectangle. The midpoint of the line connecting the two intersection points of the sampling line segments and the image of the cleaning area is used to generate the second planning path.
[0092] The centerline of the circumscribed rectangle is calculated based on its four vertices. Multiple sampling line segments of preset lengths are then drawn within a 360-degree radius around this center point. The length of each sampling line segment is no less than the distance from the farthest intersection point of the sampling line segment with the image of the cleaning area to the center point. For sampling line segments that intersect with the image of the cleaning area, the segment passes through the area, forming two intersection points, one near and one far. The midpoint coordinates of the line connecting the two intersection points are calculated based on their coordinates. The midpoint coordinates of the line connecting the intersection points on each sampling line segment generate the second planned path.
[0093] In one possible implementation, the sampling line segment is set as follows:
[0094] Set the distance from the center point of the circumscribed rectangle to its vertices as the sampling segment length; draw a sampling circle with the center of the circumscribed rectangle as the origin and the sampling segment length as the radius, with the sampling segment as the radius of the sampling circle. Optionally, the sampling segments are drawn according to a preset angle interval.
[0095] Specifically, the distance from the center point of the circumscribed rectangle to its four vertices is equal. The distance from the center point to any vertex is calculated, and this distance is set as the length of all sampled line segments. This distance represents the furthest intersection distance, ensuring the completeness of the sampling. Using the center of the circumscribed rectangle as the origin and the length of the sampled line segment as the radius, a sampling circle is drawn. The endpoint of each sampled line segment falls on this sampling circle, meaning the sampling line segment's radius is equal to the radius of the sampling circle. To ensure uniform sampling and more accurate route planning, sampled line segments are drawn evenly according to a preset angle interval. A smaller preset angle interval results in more sampling points, which will more closely approximate the shape of the missed areas. However, more sampling points also increase the computational load. Since the vehicle model has a certain width, a denser sampling point layout is not necessary to completely cover the cleaning route. Balancing cleaning effectiveness and reduced computation, it is only necessary to describe the shape and direction of the area's extension. For large, square cleaning vehicles used indoors and in shopping malls, a preset angle interval of 30 degrees is preferred. Figure 4 This is a schematic diagram illustrating the location of the center line of the cleaning area using a sampling circle, as provided in Embodiment 1 of the present invention. Figure 4 As shown, it includes an outer rectangle 4, a sampling line segment 6, a cleaning area 7, an intersection point 8 of the sampling line segment 6 and the cleaning area 7, and the midpoint 9 of the line connecting the intersection points.
[0096] The image of the eroded area can cover the image of the cleaned area. However, when the area is located at a turning point and is an irregular arc, a straight line generated by the main direction of the circumscribed rectangle alone cannot cover the cleaned area. By drawing sampling line segments for path planning, the center line position of the missed area can be accurately found. Full coverage can be achieved in just one pass, with fewer turns and high efficiency.
[0097] In a preferred embodiment, Figure 5 This is a second flowchart of the cleaning path planning method provided in Embodiment 1 of the present invention, as follows: Figure 5 As shown, the procedure preceding step 140 also includes:
[0098] Step 210: Determine whether the location of the image of the cleaning area is at the edge of the obstacle.
[0099] At the edge of an obstacle, where the edge of a region is treated as an obstacle, missed scans often occur. In the grid map, missed cleaning areas, cleaned areas, and obstacles are all marked with different values. Based on the markings of obstacles and missed cleaning areas, the obstacle edge grid and the boundary grid of the missed cleaning area are found. It is then determined whether the nearest distance between the two boundaries is less than a preset interval. If it is less than the nearest interval, the cleaning area image is determined to be located at the edge of the obstacle.
[0100] Step 220: If yes, expand the edge of the obstacle outward by a preset expansion value to generate a second planned path.
[0101] Specifically, the edge of the obstacle is expanded outward by a preset expansion value. Optionally, the preset expansion value is the sum of the expansion safety distance and half the vehicle width. The expansion safety distance refers to the distance from the outer edge of the vehicle to the obstacle. Depending on the actual scenario, the required safety distance varies, generally ranging from 0.1 to 1 meter. During operation, the sweeper needs to avoid running close to the obstacle to prevent scraping. For sweepers, the brushes under the vehicle usually extend slightly beyond the vehicle body. Setting the expansion safety distance ensures that the brushes just reach the edge without scraping the vehicle. The expanded obstacle edge line is then used as the sweeper's second planned route.
[0102] Before determining the area to be cleaned, determine whether the area is located at the edge of an obstacle. If it is located at the edge of an obstacle, plan the path by expanding the obstacle to ensure the cleaning area stays close to the edge.
[0103] In one alternative approach, to address the issue that the path generated by bloat is constrained at corners by the square shape of the vehicle model, the second planned route is further optimized, specifically as follows:
[0104] The obstacle edge is expanded outward by a preset expansion value to generate a second planned path to be determined. Specifically, the expanded obstacle edge line is used as the second planned path to be determined.
[0105] The vehicle model is drawn on the undetermined second planning path. The collision location waypoints of the undetermined second planning path are detected based on the vehicle model. The point on the map where the vehicle model intersects with the obstacle is the collision location waypoint.
[0106] The normal to the second planned path is generated by the collision location waypoint. The collision location waypoint is translated away from the obstacle along the normal direction to generate a safe location waypoint. The translation distance is not greater than a preset distance range to avoid the second planned path being too far from the missed cleaning area. The preset distance range can be set according to the width of the vehicle model, and the optional preset distance range is 0.5 meters.
[0107] The vehicle model is drawn on the path formed by safe waypoints and non-collision waypoints. If the vehicle model does not intersect with the obstacle, the safe waypoints and the non-collision waypoints of the undetermined second planning path are connected to generate the second planning path. The optimized second planning path is the safe cleaning path that is closest to the obstacle and conforms to the vehicle's operation. Figure 6 This is a schematic diagram of obstacle edge expansion path planning provided in Embodiment 1 of the present invention, as shown below. Figure 6 As shown, it includes the path 10 before obstacle edge expansion optimization, the path 11 after optimization, the collision location waypoint 12 and normal 13, the obstacle 14, and the obstacle edge expansion region 15.
[0108] If the location of the image of the cleaned area is not at the edge of the obstacle, proceed to step 140.
[0109] Step 150: Connect all first and second planning paths within the entire area to generate the overall planning path.
[0110] The overall planning path is generated by connecting all the first and second planning paths within the entire area using arcs or straight lines.
[0111] In a preferred embodiment, the first and second planning paths within the entire region are connected by a Bézier curve to generate the overall planning path.
[0112] Based on the coordinates of the start and end points of each planned path and the angle between the two points, a curve connecting the planned paths is generated using the third-order Bézier curve formula. The Bézier curve takes into account the angular extension direction of the start and end points, resulting in a smoother curve with more natural turns compared to other connection methods using arcs or straight lines, making it more suitable for vehicle travel.
[0113] Example 2
[0114] Embodiment 2 of the present invention provides a cleaning path planning device. Figure 7 The present invention provides a schematic diagram of a cleaning path planning device according to Embodiment 2 of the present invention. The cleaning path planning device 300 includes a data processing module 301, a judgment module 302, an execution module 303, and a path planning output module 304.
[0115] The data processing module 301 is used to acquire images of the cleaning area, and to erode half the width of the sweeper vehicle inward from the boundary of the cleaning area image of each connected cleaning area to generate an eroded area image.
[0116] The judgment module 302 is used to determine whether the image of the corroded area covers the image of the cleaned area.
[0117] The execution module 303 is used to execute the result of the judgment module 302: if not, find the main skeleton line of the cleaning area image; generate a first planning path along the main direction of the main skeleton line; if yes, find the position of the outer rectangle of the cleaning area image, and generate a second planning path based on the position of the outer rectangle.
[0118] The path planning output module 304 is used to connect all the first and second planned paths in the entire area to generate the overall planned path.
[0119] Specifically, the overall planning path is generated by connecting all first and second planning paths within the entire region using Bézier curves.
[0120] Specifically, the second planning path is generated based on the position of the circumscribed rectangle. If the width of the circumscribed rectangle is not greater than the vehicle width, the second planning path is generated based on the center line of the main direction of the circumscribed rectangle. If the width of the circumscribed rectangle is greater than the vehicle width, sampling line segments are drawn around the center point of the circumscribed rectangle, and the midpoint of the line connecting the two intersection points of the sampling line segments and the image of the cleaning area is used to generate the second planning path.
[0121] The sampling line segments are drawn according to a preset angle interval. The sampling line segments are set as follows: the distance from the center point of the circumscribed rectangle to the vertex of the circumscribed rectangle is set as the sampling line segment length; a sampling circle is drawn with the center of the circumscribed rectangle as the origin and the sampling line segment length as the radius, and the sampling line segment is the radius of the sampling circle.
[0122] If the corroded area cannot cover the cleaning area image, the main skeleton line of the cleaning area image is found. Specifically, a triangular mesh of the cleaning area image is constructed, and the skeleton line of the cleaning area image is extracted based on the triangular mesh. The total area of the triangles contained in each skeleton line is compared, and the skeleton line with the largest total area of triangles is marked as the main skeleton line.
[0123] Furthermore, generating a first planned path along the main skeleton line includes: connecting the centroids of the triangles contained within the main skeleton line to generate a pending first planned path; expanding the pending first planned path by half the vehicle width to generate an expanded region image; if the area of the expanded region image reaches a preset coverage threshold, marking the pending first planned path as the first planned path; if the area of the expanded region image does not reach the preset coverage threshold, generating two planned paths parallel to each other with the pending first planned path as the central axis, and marking the two planned paths as the first planned paths. The distance between the two planned paths and the pending first planned path is no greater than half the vehicle width.
[0124] The judgment module 302 is also used to find the position of the outer rectangle of the cleaning area image and, before generating the second planning path based on the position of the outer rectangle, to determine whether the position of the cleaning area image is at the edge of the obstacle.
[0125] The execution module 303 is also used to execute the result of the judgment module 302: if yes, the obstacle edge is expanded outward by a preset expansion value to generate a second planning path; if no, the position of the outer rectangle of the cleaning area image is found, and the second planning path is generated based on the position of the outer rectangle.
[0126] Specifically, the process of expanding the obstacle edge outward by a preset expansion value to generate a second planned path involves: expanding the obstacle edge outward by a preset expansion value to generate a pending second planned path; detecting collision point waypoints of the pending second planned path based on the vehicle model; constructing a normal line for the pending second planned path through the collision point waypoints; translating the collision point waypoints away from the obstacle along the normal line direction to generate a safe point waypoint; and connecting the safe point waypoints with the non-collision point waypoints of the pending second planned path to generate the second planned path.
[0127] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented by processing element calls to software, while others are implemented in hardware. For example, the data processing module can be a separate processing element, or it can be integrated into a chip in the above device. Alternatively, it can be stored as program code in the memory of the above device, and its functions can be called and executed by a processing element. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.
[0128] For example, these modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more Digital Signal Processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). As another example, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a System-on-a-Chip (SOC).
[0129] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The aforementioned computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The aforementioned computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the aforementioned computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, Bluetooth, microwave, etc.) means. The aforementioned computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. The aforementioned available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks (SSDs)).
[0130] Example 3
[0131] Example 3 provides a computer program product containing instructions, such as... Figure 8 As shown, when the computer program product is run on a computer, it causes the computer to execute any of the cleaning path planning methods provided in Embodiment 1.
[0132] Example 4
[0133] Embodiment 4 of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the cleaning path planning methods provided in Embodiment 1.
[0134] Example 5
[0135] Embodiment 5 of the present invention provides a computer device, Figure 9 This is a schematic diagram of the computer device structure provided in Embodiment 5 of the present invention. Figure 9 As shown, it includes a memory 100, a processor 200, and a computer program stored in the memory. The processor executes the computer program to implement any of the cleaning path planning methods provided in Embodiment 1 above.
[0136] Example 6
[0137] Embodiment 6 of the present invention provides a mobile tool, including the computer device described in Embodiment 5 above.
[0138] The mobile tools referred to in this application may be those with tool functions, such as excavators, bulldozers, loaders, road rollers, sewage treatment trucks, sanitation vehicles, vacuum trucks, floor scrubbers, water sprinkler trucks, sweeping robots, lawnmowers, etc.
[0139] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0140] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0141] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A cleaning path planning method, characterized in that, The method includes: Obtain the cleaning area image, and erode the boundary of the cleaning area image of each connected cleaning area inward by half the width of the sweeper vehicle to generate an eroded area image; Determine whether the image of the corroded area covers the image of the cleaned area; If not, find the main skeleton line of the image of the cleaning area; generate a first planning path along the main direction of the main skeleton line; If so, find the location of the bounding rectangle of the cleaning area image, and generate a second planning path based on the location of the bounding rectangle; Connect all the first and second planning paths within the entire region to generate the overall planning path.
2. The cleaning path planning method according to claim 1, characterized in that, The step of generating the second planned path based on the position of the circumscribed rectangle specifically involves: If the width of the circumscribed rectangle is not greater than the vehicle width, the second planned path is generated based on the centerline of the main direction of the circumscribed rectangle; If the width of the circumscribed rectangle is greater than the width of the vehicle, sampling line segments are drawn outwards from the center point of the circumscribed rectangle. The midpoint of the line connecting the two intersection points of the sampling line segments and the image of the cleaning area is used to generate the second planning path.
3. The cleaning path planning method according to claim 2, characterized in that, The sampling line segments are drawn according to a preset angle interval.
4. The cleaning path planning method according to claim 2, characterized in that, The sampling line segment is set as follows: Set the distance from the center point of the circumscribed rectangle to the vertex of the circumscribed rectangle as the length of the sampling line segment; A sampling circle is drawn with the center of the circumscribed rectangle as the origin and the length of the sampling line segment as the radius. The sampling line segment is the radius of the sampling circle.
5. The cleaning path planning method according to claim 1, characterized in that, If the corroded area cannot cover the image of the cleaned area, the main skeleton line of the image of the cleaned area is found, specifically as follows: Construct a triangular mesh of the cleaning area image, and extract the skeleton lines of the cleaning area image based on the triangular mesh; Compare the total area of the triangles contained in each skeleton line, and mark the skeleton line with the largest total area of triangles as the main skeleton line.
6. The cleaning path planning method according to claim 5, characterized in that, The generation of the first planned path along the direction of the main skeleton line includes: Connecting the centroids of the triangles contained in the main skeleton line generates a first undetermined planning path; The undetermined first planned path is expanded by half the vehicle width to generate an expanded region image; If the area of the inflated region image reaches a preset coverage threshold, the undetermined first planning path is marked as the first planning path. If the area of the inflated region image does not reach the preset coverage threshold, two planning paths are generated horizontally and horizontally with the undetermined first planning path as the central axis, and the two planning paths are marked as the first planning path.
7. The cleaning path planning method according to claim 6, characterized in that, The distance between each of the two planned paths and the undetermined first planned path is no greater than half the width of a vehicle.
8. The cleaning path planning method according to claim 1, characterized in that, Before finding the location of the bounding rectangle of the cleaning area image and generating the second planned path based on the location of the bounding rectangle, the method further includes: Determine whether the position of the image of the cleaned area is at the edge of the obstacle; If so, the edge of the obstacle is expanded outward by a preset expansion value to generate the second planned path; If not, proceed to find the location of the bounding rectangle of the cleaning area image, and generate a second planning path based on the location of the bounding rectangle.
9. The cleaning path planning method according to claim 8, characterized in that, The step of expanding the edge of the obstacle outward by a preset expansion value to generate the second planned path specifically involves: The edge of the obstacle is expanded outward by a preset expansion value to generate a second undetermined planning path. The collision location waypoints of the undetermined second planned path are detected based on the vehicle model; Draw the normal to the undetermined second planned path through the waypoints at the collision locations; The collision location waypoint is translated away from the obstacle along the normal direction to generate a safe location waypoint; The second planned path is generated by connecting the safe location waypoints and the non-collision location waypoints of the undetermined second planned path.
10. The cleaning path planning method according to claim 1, characterized in that, The step of connecting all first and second planning paths within the entire area to generate the overall planning path is as follows: By connecting each first and second planning path within the entire region using Bézier curves, a total planning path is generated.
11. A cleaning path planning device, characterized in that, The path planning device includes: The data processing module is used to acquire images of the cleaning area, and to erode half the width of the sweeper vehicle inward from the boundary of the cleaning area image of each connected cleaning area to generate an eroded area image. The determination module is used to determine whether the image of the corroded area covers the image of the cleaned area; An execution module is used to execute the result of the judgment module; if not, it finds the main skeleton line of the cleaning area image; and generates a first planning path along the main direction of the main skeleton line; if yes, it finds the position of the outer rectangle of the cleaning area image and generates a second planning path based on the position of the outer rectangle. The path output module is used to connect all the first and second planned paths in the entire area to generate the overall planned path.
12. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the cleaning path planning method as described in any one of claims 1-10.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in claims 1-9.
14. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to claims 1-10.
15. A mobile tool, characterized in that, Includes the computer device as described in claim 13.