Path planning method and system and self-moving equipment
The method optimizes path planning for self-moving devices by scanning and merging grid map regions to enhance coverage and reduce computational load, addressing inefficiencies in complex landscapes.
Patent Information
- Application Number
- CN202510249194.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-07-15
AI Technical Summary
In the prior art, when mobile devices mow grass, full coverage cannot be achieved for concave polygon maps, resulting in low coverage and high repetition rate. At the same time, too many map partitions are added, increasing the calculation amount and workload, and reducing efficiency.
By obtaining the preset scanning direction, scanning the virtual raster map, only the target segmentation lines located inside the raster map are retained, forming the target segmentation areas, and combining these areas, and finally path planning is carried out in the merged partition to ensure that the bow-shaped path covers the entire area.
It effectively reduces the number of map partitions, improves regional coverage, reduces computing resource usage, and improves work efficiency.
Smart Images

Figure CN120313596A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of robot control, and particularly to a path planning method, system and self-mobile device. Background Art
[0002] Self-mobile devices, such as intelligent lawn mowers, are built with sensors, cameras, GPS systems, etc., and can achieve efficient and precise lawn mowing. First, they obtain environmental information through sensors and perform map modeling on the mowing area, including obstacles, vegetation, and boundaries. When mowing, in order to ensure that the set boundaries are not exceeded during the mowing process, the intelligent self-mobile device uses GPS or other positioning technologies for navigation, travels according to the preset boundaries, and tracks its own position in real time to ensure mowing along the planned route. The self-mobile device avoids going out of range by constructing virtual map boundaries.
[0003] However, the inventors found that there are at least the following problems in the related art: When the self-mobile device mows the lawn, for a concave polygon map, a zigzag path usually cannot cover the entire map, resulting in low coverage rate and high repetition rate; at the same time, there may be too many map partitions, increasing the computational workload and actual workload of the self-mobile device and reducing the actual work efficiency. Summary of the Invention
[0004] The purpose of the embodiments of the present invention is to provide a path planning method, system, device and storage medium, which can perform higher-precision scanning and regional division of maps with complex terrains, reduce the number of map partitions while making reasonable work path planning, and reduce the occupancy of computing resources of the self-mobile device.
[0005] To solve the above technical problems, an embodiment of the present invention provides a path planning method, including: obtaining a preset scanning direction; scanning a virtual grid map according to the preset scanning direction; according to the grid attributes of the virtual grid map, only retaining at least one target segmentation line located inside the virtual grid map to form at least one target segmentation area; merging the at least one target segmentation area to obtain at least one sub-work area; and performing path planning in the at least one sub-work area.
[0006] An embodiment of the present invention further provides a path planning system for a self - moving device, including: a scanning direction acquisition module, configured to acquire a preset scanning direction, where the preset scanning direction is a cutting direction set by a user or a recommended cutting direction calculated; a scanning module, configured to scan a virtual grid map according to the preset scanning direction; and according to the grid attributes of the virtual grid map, only retain at least one target segmentation line located inside the virtual grid map to form at least one target segmentation region; a region merging module, configured to merge the at least one target segmentation region to obtain at least one sub - working region; a path planning module, configured to perform path planning in the at least one sub - working region.
[0007] An embodiment of the present invention further provides a self - moving device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above - mentioned path planning method.
[0008] In the embodiment of the present invention, first, a preset scanning direction is acquired to scan the map, improving the adaptability to complex map partitioning; secondly, according to the grid attributes, only retain at least one target segmentation line located inside the virtual grid map to form at least one target segmentation region, and further merge the target segmentation regions to minimize the number of merged partitions. Finally, path planning is performed within each of the merged partitions; effectively reducing the number of partitions and improving the flexibility of partitioning; and the partition scanning direction is equal to the cutting direction, enabling the robot to achieve boundary - to - boundary cutting, ensuring that a bow - shaped path fully covers the entire region, and improving the regional coverage rate of the self - moving device.
[0009] In addition, the step of only retaining at least one target segmentation line located inside the virtual grid map according to the grid attributes of the virtual grid map to form at least one target segmentation region includes: according to the preset scanning direction, perform line - by - line scanning of the virtual grid map with a scanning line segment, and obtain the number of target segments after the scanning line segment is segmented by the virtual grid map, where the number of target segments is the number of segmentation lines existing inside the virtual grid map after the scanning line segment is segmented by the boundary of the virtual grid map, and the segmentation lines inside the virtual grid map are obtained according to the grid attributes;
[0010] Determine whether the number of target segments after the scanned line segment is segmented by the virtual grid map in the current row changes compared with the number of target segments after being segmented by the virtual grid map in the previous row; if the number of target segments after the scanned line segment is segmented by the virtual grid map in the current row changes compared with the number of target segments after being segmented by the virtual grid map in the previous row, determine that the segmentation line located inside the virtual grid in the current row is the target segmentation line; obtain at least one target segmentation area according to at least one of the target segmentation lines; if the number of target segments after the scanned line segment is segmented by the virtual grid map in the current row does not change compared with the number of target segments after being segmented by the virtual grid map in the previous row, continue to scan the virtual grid map.
[0011] In addition, the segmentation line inside the virtual grid is obtained according to the grid attributes, including: obtaining at least one segmentation line formed by the boundary of the virtual grid map dividing the scanned line segment; for each segmentation line, obtaining the first endpoint and the second endpoint of the segmentation line, where the first endpoint and the second endpoint are the two endpoints on both sides of the segmentation line; obtaining the first grid attribute of the grid on the left side of the first endpoint, the second grid attribute of the grid on the right side of the first endpoint, the third grid attribute of the grid on the left side of the second endpoint, and the fourth grid attribute of the grid on the right side of the second endpoint; determining whether the segmentation line is the segmentation line inside the virtual grid map according to the jump relationship between the first grid attribute and the second grid attribute and the jump relationship between the third grid and the fourth grid.
[0012] In addition, the merging of the at least one target segmentation area to obtain at least one sub-working area includes: merging the at least one adjacent target segmentation area according to a preset rule so that the number of the merged sub-working areas is the least.
[0013] In addition, the path planning in the at least one sub-working area includes: performing a zigzag path planning in the at least one sub-working area, and the long side direction of the zigzag path is the preset scanning direction.
[0014] In addition, the path planning in the at least one sub-working area further includes: taking the sub-working area closest to the charging pile as the first sub-working area to be traversed by the self-mobile device; determining the traversal order of the at least one sub-working area according to a preset rule; traversing the at least one sub-working area according to the traversal order so that the length of the target path is the shortest, and the target path is the connecting path of the zigzag paths connecting the respective sub-working areas.
[0015] In addition, the preset scanning direction is the cutting direction set by the user or the recommended cutting direction calculated by the self-mobile device.
[0016] In addition, if the preset scanning direction is the cutting direction set by the user, when the cutting direction set by the user changes, the virtual grid map is scanned again according to the changed cutting direction set by the user to obtain at least one sub-working area, and path planning is performed in the at least one sub-working area. [Description of the Drawings]
[0017] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplary illustrations do not limit the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the drawings in the figures do not constitute a scale limitation.
[0018] Figure 1 is a map area segmentation diagram in the related art;
[0019] Figure 2 is a flowchart of a path planning method provided by an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of the scanning direction in the path planning method provided by an embodiment of the present application;
[0021] Figure 4 is a grid attribute value annotation diagram of a grid map provided by an embodiment of the present application;
[0022] Figure 5 is a schematic diagram of the target segmentation area after scanning the virtual grid map provided by an embodiment of the present application Figure 1 ;
[0023] Figure 6 is a schematic diagram of the target segmentation area after scanning the virtual grid map provided by an embodiment of the present application Figure 2 ;
[0024] Figure 7 is a schematic diagram of the merged sub-working area provided by an embodiment of the present application Figure 1 ;
[0025] Figure 8 is a schematic diagram of the merged sub-working area provided by an embodiment of the present application Figure 2 ;
[0026] Figure 9 is the virtual grid map after path planning provided by an embodiment of the present application Figure 1 ;
[0027] Figure 10 is the virtual grid map after path planning provided by an embodiment of the present application Figure 2 ;
[0028] Figure 11It is the virtual grid ground after path planning provided by an embodiment of the present application Figure 3 ;
[0029] Figure 12 It is a schematic internal structure diagram of a path planning system for a self - moving device provided by an embodiment of the present application;
[0030] Figure 13 It is a schematic internal structure diagram of a self - moving device provided by an embodiment of the present application. [Specific Embodiments]
[0031] In the prior art, when a self - moving device performs coverage, for a concave - polygon map, there is usually a bow - shaped path that cannot cover the entire map, resulting in low coverage rate and high repetition rate. At the same time, there will also be a situation where the number of map partitions is too large, increasing the computational workload and actual workload of the self - moving device and reducing the actual work efficiency, as Figure 1 shown. Therefore, a path planning method, system, device, and storage medium are needed to scan a map of complex terrain with higher accuracy, while performing reasonable work path planning, reducing the number of map partitions, and reducing the occupancy of computing resources of the self - moving device.
[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, those of ordinary skill in the art can understand that in the embodiments of the present invention, many technical details are presented for the convenience of readers to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions required to be protected by the present application can still be implemented. The following division of each embodiment is for the convenience of description and should not constitute any limitation on the specific implementation manner of the present invention. Each embodiment can be combined and cross - referenced with each other without conflict.
[0033] An embodiment of the present invention relates to a path planning method, which can be applied to a self - moving device, such as a smart lawn mower, a floor cleaning robot, etc. The path planning method includes: obtaining a preset scanning direction; scanning a virtual grid map according to the preset scanning direction; according to the grid attributes of the virtual grid map, only retaining at least one target dividing line located inside the virtual grid map to form at least one target dividing area; wherein, the grid attributes label the types to which each grid in the virtual grid map belongs; merging the at least one target dividing area to obtain at least one sub - working area; and performing path planning in the at least one sub - working area.
[0034] By obtaining a preset scanning direction to scan the map, the adaptability to complex map partitioning is improved; secondly, according to the raster attributes, only at least one target dividing line located inside the virtual raster map is retained to form at least one target dividing area, and the target dividing areas are further merged to minimize the number of merged partitions. Finally, path planning is performed within each of the merged partitions, effectively reducing the number of partitions and enabling the robot to achieve boundary-to-boundary cutting, ensuring that a bow-shaped path covers the entire area, and improving the area coverage rate of the self-mobile device.
[0035] The implementation details of the path planning method in the embodiments of the present invention will be specifically described below. The following content is only the implementation details provided for easy understanding and is not necessary for implementing this solution.
[0036] As Figure 2 shown, in step 201, a preset scanning direction is obtained.
[0037] In step 202, the virtual raster map is scanned according to the preset scanning direction; according to the raster attributes of the virtual raster map, only at least one target dividing line located inside the virtual raster map is retained to form at least one target dividing area; wherein, the raster attributes label the types of the respective grids in the virtual raster map.
[0038] In an embodiment of the present application, the scanning of the virtual raster map according to the preset scanning direction and the determination of the target dividing area of the virtual raster map according to the raster attributes of the virtual raster map include:
[0039] According to the preset scanning direction, the virtual raster map is scanned row by row with a scanning line segment, and the number of target segments after the scanning line segment is divided by the virtual raster map is obtained, where the number of target segments is the number of dividing lines existing inside the virtual raster map after the scanning line segment is divided by the boundary of the virtual raster map, and the dividing lines inside the virtual raster map are obtained according to the raster attributes; it is judged whether the number of target segments after the scanning line segment is divided by the virtual raster map in the current row changes compared with the number of target segments after the scanning line segment is divided by the virtual raster map in the previous row;
[0040] If the number of target segments after the scanning line segment is divided by the virtual raster map in the current row changes compared with the number of target segments after the scanning line segment is divided by the virtual raster map in the previous row, it is determined that the dividing line located inside the virtual raster in the current row is the target dividing line; according to at least one of the target dividing lines, at least one target dividing area is obtained;
[0041] If the number of target segments after the scanning line segment is segmented by the virtual grid map in the current row remains unchanged compared to the number of target segments after being segmented by the virtual grid map in the previous row, continue to scan the virtual grid map.
[0042] Specifically, the two endpoints of the scanning line segment are respectively on two of the boundaries of the map. In some conventional map scanning processes, assuming the preset scanning direction is horizontal, that is, the scanning line segment is a horizontal line segment, the moving direction of the scanning line segment is to perform translational scanning horizontally row by row from top to bottom; in another map scanning process, assuming the preset scanning direction is vertical, that is, the scanning line segment is a vertical line segment, the moving direction of the scanning line segment is to perform translational scanning vertically row by row from left to right. Additionally, if the preset scanning direction is a direction with a certain inclination angle, set the scanning line segment according to the direction specified by the user, and move the scanning line segment in a direction perpendicular to the preset scanning direction for row-by-row scanning. As Figure 3 shown, where row A of the grid map is the map grid scanned by the scanning line segment at time t, row B of the grid map is the map grid scanned by the scanning line segment at time t + 1, row C of the grid map is the map grid scanned by the scanning line segment at time t + 2, and so on. When the preset scanning direction set by the user is a direction with a certain inclination angle, the inclination angle or slope of the preset scanning direction can be calculated and stored by calculating the included angle between the preset scanning direction and the horizontal direction, or by calculating the included angle between the preset scanning direction and the vertical direction.
[0043] It should be noted that the moving direction of the scanning line segment can also be adjusted correspondingly according to actual work requirements, such as from top to bottom, from bottom to top, from left to right, from right to left, from upper left to lower right, from lower right to upper left, from upper right to lower left, from lower left to upper right, or moving a preset distance from direction 1 to direction 2 on one side and then moving a preset distance from direction 2 to direction 1 on the opposite side. The present application does not limit this here.
[0044] In an embodiment of the present application, the dividing line inside the virtual grid is obtained according to the grid attributes, including: obtaining at least one sub-segment formed by the boundary of the virtual grid map dividing the scanning line segment; for each sub-segment, obtaining the first endpoint and the second endpoint of the sub-segment, where the first endpoint and the second endpoint are the two side endpoints of the sub-segment; obtaining the first grid attribute of the grid to the left of the first endpoint, the second grid attribute of the grid to the right of the first endpoint, the third grid attribute of the grid to the left of the second endpoint, and the fourth grid attribute of the grid to the right of the second endpoint; determining whether the sub-segment is inside the virtual grid map according to the jump relationship between the first grid attribute and the second grid attribute and the jump relationship between the third grid and the fourth grid.
[0045] In a specific embodiment, the grid map represents the attributes of the grid through grid attribute values. For example, Figure 4 as shown, the grid attribute values of the non-passable areas outside or within the working area of the mobile device are 0; the grid attribute values of the grids at the boundary of the working area of the mobile device are 1; the grid attribute values of the passable areas within the working area of the mobile device are 2. During the scanning process, when the virtual grid map is an irregular polygon, the scanning line segment will be divided into multiple dividing lines by the map boundary.
[0046] According to whether the jump situation of the grid attributes at both ends of the dividing line meets the first preset condition, it is determined whether the dividing line is located inside the virtual grid map. Specifically, it includes: when the grid attributes on both sides of the first endpoint of the dividing line jump from the non-working area to the working area, and the grid attributes on both sides of the second endpoint jump from the working area to the non-working area, it is determined that the dividing line is located inside the virtual grid map; when the grid attributes on both sides of the first endpoint of the dividing line jump from the working area to the non-working area, and the grid attributes on both sides of the second endpoint jump from the non-working area to the working area, it is determined that the dividing line is located outside the virtual grid map.
[0047] In an exemplary description, taking the preset scanning direction as the horizontal direction from left to right as an example, assume that the left endpoint of a certain dividing line AB is A and the right endpoint is B. If the attribute value of the grid on the left side of endpoint A is 0, the attribute value of the grid on the right side of endpoint A is 2, the attribute value of the grid on the left side of endpoint B is 2, and the attribute value of the grid on the right side of endpoint B is 0, that is, the grid attributes on both sides of endpoint A jump from the non-working area to the working area; the grid attributes on both sides of endpoint B jump from the working area to the non-working area. At this time, it is determined that the dividing line AB is located inside the virtual grid map.
[0048] If the attribute value of the grid on the left side of endpoint A is 2, the attribute value of the grid on the right side of endpoint A is 0, the attribute value of the grid on the left side of endpoint B is 0, and the attribute value of the grid on the right side of endpoint B is 2, that is, the grid attributes on both sides of endpoint A jump from the working area to the non-working area; the grid attributes on both sides of endpoint B jump from the non-working area to the working area. At this time, it is determined that the dividing line AB is located outside the virtual grid map.
[0049] For example, Figure 5 and Figure 6 as shown, it is the division result of the target dividing area after scanning the virtual grid map. The line segments within the working area of the mobile device are the retained target dividing lines.
[0050] In an embodiment of the present application, before scanning the virtual grid map according to the preset scanning direction, the method further includes: obtaining an initial grid map and performing boundary shrinking processing on the initial grid map; the boundary shrinking processing includes: shrinking the boundary line of the initial grid map inward by a preset distance; performing boundary smoothing processing on the map after boundary shrinking to obtain the virtual grid map.
[0051] Specifically, when shrinking the boundary line of the initial grid map inward by a preset distance, the preset distance can be half the distance of the self-mobile device body or the entire distance of the self-mobile device body, or a preset value, such as 30 cm, 45 cm, 56 cm, etc. The specific preset distance can be set accordingly according to actual work requirements, and the present application does not limit this here; in addition, before boundary smoothing processing, it is also necessary to filter out interference factors near the boundary, such as curve fitting, function smoothing, etc. The boundary smoothing processing can be calculated through Bezier curves, spline curves, and moving average methods to obtain a smooth boundary line.
[0052] In step 203, merging the at least one target segmentation region to obtain at least one sub-working region; performing path planning in the at least one sub-working region.
[0053] In an embodiment of the present application, the merging of the target segmentation regions to obtain sub-working regions includes: merging adjacent target segmentation regions to obtain the sub-working regions, so that the number of partitions in the sub-working regions is the least. As Figure 7 and Figure 8 shown, it is the sub-working region obtained after merging.
[0054] Specifically, the logical calculation unit inside the self-mobile device can perform permutations and combinations on all merging schemes of the target segmentation regions and select the merging scheme with the least number of final partitions from them.
[0055] In an embodiment of the present application, the performing path planning in the sub-working region includes: performing a zigzag path planning in each sub-working region according to the preset scanning direction. Taking the preset scanning direction as the horizontal direction as an example, the virtual grid map after path planning is as Figure 9 and Figure 10 shown. The self-mobile device can directly perform covering operations (such as mowing or cleaning) according to the routes in Figure 9 and Figure 10 . As can be seen from the figure, the robot can achieve edge-to-edge mowing or cleaning, ensuring that a zigzag path covers the entire area and improving the coverage rate.
[0056] In addition, the non-working areas included in the virtual grid map can be either the areas outside the working boundary or the impassable areas within the working area, including but not limited to isolated islands, restricted areas, pattern areas, text retention areas, such as Figure 11 shown. The shape, size, etc. of the impassable areas can be adjusted accordingly according to the actual working requirements, and this application does not limit them here. During the scanning process, the dividing lines within the above non-working areas will not be retained, nor will path planning be performed on the above non-working areas.
[0057] In an embodiment of this application, the path planning further includes: after planning the "bow" - shaped path in each sub - working area according to the preset scanning direction, taking the sub - working area closest to the charging pile as the first sub - working area to be traversed by the self - moving device; determining the traversal order of the at least one sub - working area according to a preset rule; and traversing the at least one sub - working area according to the traversal order, so that the target path length is the shortest, where the target path is the connecting path of the "bow" - shaped paths connecting each sub - working area.
[0058] In an embodiment of this application, the preset scanning direction is the cutting direction executed by the user. It can be understood that the user can set the cutting direction in the APP and send the set cutting direction to the self - moving device. The cutting direction can be the horizontal direction, the vertical direction, or any angular direction, which is not limited here. In addition, the preset scanning direction can also be the recommended cutting direction calculated by the self - moving device. For example, the longest side direction of the working area is the recommended cutting direction.
[0059] In an alternative embodiment, when the user specifies the cutting direction, the preset scanning direction is equal to the cutting direction specified by the user; when the user does not specify the cutting direction, the self - moving device can default the preset scanning direction to the horizontal direction, or can also take the longest side direction of the working area as the preset scanning direction.
[0060] In an alternative embodiment, when the preset scanning direction changes (i.e., the preset cutting direction changes, for example, the user sets a new cutting direction in the APP), re - partition the virtual grid map according to the updated preset scanning direction, and perform path planning in each partition according to the updated preset scanning direction (cutting direction); adaptively adjust the partition scanning direction with the change of the cutting direction to obtain the partition result most suitable for the current cutting direction, thereby further ensuring that the self - moving device can fully cover the entire working area and improving the coverage rate.
[0061] In the embodiments of the present invention, first, a preset scanning direction is obtained to scan the map, improving the adaptability to complex map partitioning; second, according to the grid attributes, at least one target dividing line located inside the virtual grid map is retained only to form at least one target dividing area, and the target dividing areas are further merged to minimize the number of merged partitions. Finally, path planning is performed within each of the merged partitions; effectively reducing the number of partitions and improving the flexibility of partitioning; and the partitioning scanning direction is equal to the cutting direction, enabling the robot to achieve boundary-to-boundary cutting, ensuring that a bow-shaped path fully covers the entire area, and improving the area coverage rate of the self-mobile device.
[0062] The step division of the above method is only for clear description. During implementation, it can be combined into one step or some steps can be split into multiple steps. As long as the same logical relationship is included, it is within the protection scope of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs, but not changing the core design of its algorithm and process are all within the protection scope of this patent.
[0063] In addition, the examples mentioned in the above embodiments can be freely combined, and any combination method can be understood as an embodiment. The "embodiments" or "examples" that appear in various positions in the specification do not necessarily refer to the same embodiment, nor are they independent or alternative embodiments mutually exclusive with other embodiments. Those skilled in the art can understand that the embodiments described herein can be combined with other embodiments.
[0064] In summary, specific embodiments of the present subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result.
[0065] In the description of the embodiments of the present application, technical terms such as "first" and "second" are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity, specific order, or primary-secondary relationship of the indicated technical features. In the description of the embodiments of the present application, "a plurality of" means two or more, unless otherwise clearly and specifically defined.
[0066] In the description of the embodiments of the present application, the orientation or positional relationship indicated by technical terms such as "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "horizontal", "vertical", "upright", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the embodiments of the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation to the embodiments of the present application.
[0067] Another embodiment of the present invention relates to a path planning system for a self - moving device, as Figure 12 shown, including:
[0068] A scanning direction acquisition module for acquiring a preset scanning direction;
[0069] A scanning module for scanning a virtual grid map according to the preset scanning direction; and according to the grid attributes of the virtual grid map, only retaining at least one target dividing line located inside the virtual grid map to form at least one target dividing area;
[0070] A region merging module for merging the at least one target dividing area to obtain at least one sub - working area;
[0071] A path planning module for performing path planning in the at least one sub - working area.
[0072] In the embodiments of the present invention, first, a preset scanning direction is acquired to scan the map, improving the adaptability to complex map partitioning; secondly, according to the grid attributes, only retaining at least one target dividing line located inside the virtual grid map to form at least one target dividing area, and further merging the target dividing areas to minimize the number of merged partitions. Finally, path planning is performed within each of the merged partitions; effectively reducing the number of partitions and improving the flexibility of partitioning; and the partition scanning direction is equal to the cutting direction, enabling the robot to achieve cutting from boundary to boundary, ensuring that a bow - shaped path fully covers the entire area, and improving the area coverage rate of the self - moving device.
[0073] It is not difficult to find that this embodiment is a device embodiment corresponding to the above - mentioned method embodiment, and this embodiment can be implemented in cooperation with the above - mentioned method embodiment. The relevant technical details mentioned in the above - mentioned method embodiment are still valid in this embodiment. To avoid repetition, they are not elaborated here. Correspondingly, the relevant technical details mentioned in this embodiment can also be applied to the above - mentioned method embodiment.
[0074] It is worth mentioning that each module involved in this embodiment is a logical module. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or implemented as a combination of multiple physical units. In addition, to highlight the innovative part of the present invention, units that are not closely related to solving the technical problems proposed by the present invention are not introduced in this embodiment, but this does not mean that there are no other units in this embodiment.
[0075] Another embodiment of the present invention relates to a self - moving device, such as Figure 13 shown, which includes at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the path planning method as described above.
[0076] Among them, the memory and the processor are connected in a bus manner. The bus can include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and the memory together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well - known in the art, so they will not be further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be an element or multiple elements, such as multiple receivers and transmitters, and provides a unit for communicating with various other devices on the transmission medium. The data processed by the processor is transmitted on the wireless medium through the antenna. Further, the antenna also receives data and transmits the data to the processor.
[0077] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. And the memory can be used to store the data used by the processor when executing operations.
[0078] Another embodiment of the present invention relates to a computer - readable storage medium storing a computer program. When the computer program is executed by a processor, the above - mentioned method embodiment is implemented.
[0079] That is, those skilled in the art can understand that all or part of the steps in implementing the methods of the above embodiments can be completed by instructing relevant hardware through a program. The program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0080] Those of ordinary skill in the art can understand that the above embodiments are specific embodiments for implementing the present invention, and in practical applications, various changes can be made in form and details without departing from the spirit and scope of the present invention.
Claims
1. A path planning method, applied to a self-mobile device, characterized in that, Including: Obtain a preset scanning direction; Scan the virtual grid map according to the preset scanning direction; According to the grid attributes of the virtual grid map, only retain at least one target dividing line located inside the virtual grid map to form at least one target dividing area; Merge the at least one target dividing area to obtain at least one sub-working area; Perform path planning in the at least one sub-working area.
2. The path planning method according to claim 1, wherein The step of, according to the grid attributes of the virtual grid map, only retaining at least one target dividing line located inside the virtual grid map to form at least one target dividing area includes: According to the preset scanning direction, scan the virtual grid map row by row with a scanning line segment, and obtain the number of target segments after the scanning line segment is divided by the virtual grid map, where the number of target segments is the number of dividing lines existing inside the virtual grid map after the scanning line segment is divided by the boundary of the virtual grid map, and the dividing lines inside the virtual grid map are obtained according to grid attributes; Judge whether the number of target segments after the scanning line segment is divided by the virtual grid map in the current row changes compared with the number of target segments after the scanning line segment is divided by the virtual grid map in the previous row; If the number of target segments after the scanning line segment is divided by the virtual grid map in the current row changes compared with the number of target segments after the scanning line segment is divided by the virtual grid map in the previous row, determine that the dividing line located inside the virtual grid in the current row is the target dividing line; according to at least one of the target dividing lines, obtain at least one target dividing area; If the number of target segments after the scanning line segment is divided by the virtual grid map in the current row does not change compared with the number of target segments after the scanning line segment is divided by the virtual grid map in the previous row, continue to scan the virtual grid map.
3. The path planning method according to claim 2, wherein The dividing lines inside the virtual grid are obtained according to grid attributes, including: Obtain at least one dividing line formed by the boundary of the virtual grid map dividing the scanning line segment; For each dividing line, obtain the first endpoint and the second endpoint of the dividing line, where the first endpoint and the second endpoint are the two endpoints on both sides of the dividing line; Obtain the first grid attribute of the grid on the left side of the first endpoint, the second grid attribute of the grid on the right side of the first endpoint, the third grid attribute of the grid on the left side of the second endpoint, and the fourth grid attribute of the grid on the right side of the second endpoint; Judge whether the dividing line is the dividing line inside the virtual grid map according to the jump relationship between the first grid attribute and the second grid attribute and the jump relationship between the third grid and the fourth grid.
4. The path planning method according to claim 1, wherein The step of merging the at least one target dividing area to obtain at least one sub-working area includes: Merge the at least one adjacent target dividing area according to a preset rule to minimize the number of sub-working areas after merging.
5. The path planning method according to claim 1, wherein The step of performing path planning in the at least one sub-working area includes: Perform zigzag path planning in at least one sub-working area, and the long side direction of the zigzag path is the preset scanning direction.
6. The path planning method according to claim 5, characterized in that, Performing path planning in the at least one sub-work area further includes: Regarding the sub-work area closest to the charging pile as the first sub-work area to be traversed by the self-moving device; Determining the traversal order of the at least one sub-work area according to a preset rule; Traversing the at least one sub-work area according to the traversal order to minimize the length of the target path, where the target path is the connecting path of the zigzag paths connecting each sub-work area.
7. The path planning method according to claim 1, characterized in that The preset scanning direction is the cutting direction set by the user or the recommended cutting direction calculated.
8. The path planning method according to claim 7, characterized in that, The method further includes: If the preset scanning direction is the cutting direction set by the user, when the cutting direction set by the user changes, the virtual grid map is scanned again according to the changed cutting direction set by the user to obtain at least one sub-work area, and path planning is performed in the at least one sub-work area.
9. A path planning system for a self - moving device, characterized in that, Comprising: A scanning direction acquisition module for acquiring a preset scanning direction, where the preset scanning direction is the cutting direction set by the user or the recommended cutting direction calculated; A scanning module for scanning the virtual grid map according to the preset scanning direction; and according to the grid attributes of the virtual grid map, only retaining at least one target dividing line located inside the virtual grid map to form at least one target dividing area; An area merging module for merging the at least one target dividing area to obtain at least one sub-work area; A path planning module for performing path planning in the at least one sub-work area.
10. A self - moving device, characterized in that, Comprising: At least one processor; And, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the path planning method as described in any one of claims 1 to 8.