Cleaning method, device and equipment applied to sweeping robot and storage medium
By acquiring environmental images and dividing the robot vacuum into unit areas, calculating the navigation and turning times of the cleaning plan, and selecting the optimal cleaning direction, the problem of excessive turning times in robot vacuums is solved, thus improving cleaning efficiency.
Patent Information
- Application Number
- CN202310247705.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-03-07
AI Technical Summary
The existing sweeping routes of robotic vacuum cleaners are not properly planned, resulting in too many turns and low cleaning efficiency.
By acquiring environmental images of the area to be cleaned, dividing it into multiple unit areas, and calculating the navigation times, turning times, and navigation distances of different cleaning schemes, the cleaning scheme with the lowest traversal score is selected as the optimal cleaning direction.
It improves the cleaning efficiency of the robot vacuum cleaner, reduces the number of navigation and turning operations, and optimizes the cleaning path.
Smart Images

Figure CN116350125B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart home path planning and calculation, specifically to a cleaning method, device, equipment, and storage medium for use with a robot vacuum cleaner. Background Technology
[0002] Household robotic vacuum cleaners typically use a zigzag path to achieve full coverage of the cleaning area. However, different starting points and cleaning directions will affect the final cleaning trajectory. Although different cleaning directions can achieve full coverage by using a zigzag path, to avoid collisions, the robotic vacuum cleaner will slow down at the zigzag turns and then accelerate after the turn. Therefore, for cleaning tasks, the more straight the robotic vacuum cleaner travels and the fewer the turns, the shorter the cleaning time. However, current technology does not rationally plan the cleaning route of the robotic vacuum cleaner, but instead makes it follow a pre-set path step by step, resulting in too many turns and low cleaning efficiency. Summary of the Invention
[0003] This application provides a cleaning method, apparatus, device, and storage medium for a sweeping machine, aiming to solve the technical problem in the prior art that the sweeping machine's cleaning route is not rationally planned, resulting in excessive turning times and low cleaning efficiency.
[0004] In a first aspect, embodiments of this application provide a cleaning method applied to a sweeping machine, comprising:
[0005] Acquire an environmental image of the site to be cleaned and extract the cleaning area from the environmental image;
[0006] The cleaning area is divided into multiple unit areas;
[0007] The multiple unit regions are traversed in both horizontal and vertical directions to form multiple different cleaning schemes.
[0008] Calculate the number of navigation steps, turns, and navigation distance required to clean the area using different cleaning schemes.
[0009] Based on the number of navigation attempts, the number of turns, and the navigation distance, calculate the traversal score for different cleaning schemes;
[0010] The cleaning scheme with the smallest traversal score is selected, and the cleaning direction of each unit area is obtained as the optimal cleaning direction for each unit area.
[0011] The cleaning area is cleaned in the optimal cleaning direction.
[0012] Further, the step of acquiring an environmental image of the site to be cleaned and extracting the cleaning area from the environmental image includes:
[0013] Obtain the initial position of the robot vacuum cleaner and add the initial position as an element to an expanded list, wherein the expanded list is a set of elements that have not undergone four-neighbor expansion;
[0014] Take an element from the extended list, perform a four-neighbor expansion, add elements that are not on the boundary, have not been visited, and are not in the visited list to the extended list, and add the element to the visited list, wherein the visited list is a set of elements that have already undergone four-neighbor expansion;
[0015] When the elements in the extended list are empty, the elements in the accessed list are the extracted cleaning areas.
[0016] Furthermore, the step of calculating the number of navigation steps, the number of turns, and the navigation distance required to clean the cleaning area using different cleaning schemes includes:
[0017] The unit area where the sweeper is located is taken as the initial unit area, and the initial position of the sweeper is taken as the initial search point of the sweeper;
[0018] The traversal is performed from the initial search point, and the number of turns is incremented by 1 for each bow-shaped turn.
[0019] When the sweeper reaches the boundary of the initial unit area, the position where the sweeper reaches the boundary is recorded as the end point, and the traversed area is marked as the traversed area.
[0020] When the area of the traversed area is different from the area of the cleaning area, the remaining cleaning area is obtained, and the remaining cleaning area includes the other unit areas besides the initial unit area;
[0021] Obtain the boundary point of the unit area closest to the end point in the remaining cleaning area, record it as the navigation point, drive the robot vacuum to the navigation point, and increment the navigation count by 1;
[0022] The navigation distance is obtained by calculating the distance between the endpoint and the navigation point based on the path planning algorithm.
[0023] Repeat the above steps until the remaining cleaning area has been traversed, then output the number of turns, the number of navigation steps, and the navigation distance.
[0024] Furthermore, the step of dividing the cleaning area into multiple unit areas includes:
[0025] Obstacles are identified in the cleaning area to obtain a first map containing the obstacles;
[0026] Obtain all boundaries contained in the first map, where the boundaries include map boundaries and obstacle boundaries;
[0027] Perform a rectangle segmentation operation, which includes: sorting all boundaries according to their length, taking the longest boundary as the first side, and using the endpoint of the first side as the starting point and a second side perpendicular to the starting point in the map direction to perform rectangle segmentation, thereby forming a unit region;
[0028] Obtain a second map from the first map excluding the unit region, and obtain all remaining boundaries contained in the second map;
[0029] Perform the rectangle segmentation operation on all remaining boundaries to divide other unit regions until rectangle segmentation is no longer possible.
[0030] Further, the step of obtaining the boundary point of the unit area closest to the end point in the remaining cleaning area, denoted as the navigation point, driving the robot vacuum to the navigation point, and incrementing the navigation count by 1 includes:
[0031] Obtain the vertex positions of each unit region in the remaining cleaning area;
[0032] Calculate the navigation distance from the sweeping robot to each vertex position of each of the aforementioned unit areas;
[0033] The vertex closest to the robot vacuum is used as the navigation point for the remaining cleaning area, and is denoted as the navigation point.
[0034] The robot vacuum is directed to the navigation point in the remaining cleaning area, and the navigation count is incremented by 1.
[0035] Furthermore, the step of performing the cleaning of the cleaning area in the optimal cleaning direction includes:
[0036] When there is a region that cannot be divided into rectangles, it is denoted as the region to be compensated.
[0037] The unit region with the longest boundary length with the area to be compensated is obtained to obtain the bordering unit region;
[0038] The area to be compensated is joined with the bordering unit area;
[0039] When the sweeper moves to the adjacent unit area, it also cleans the area to be compensated.
[0040] Furthermore, the formula for calculating the traversal score is as follows:
[0041] score = α·number of turns + β·number of navigation attempts + γ·navigation distance
[0042] Where score is the traversal score, α is the weight coefficient for the number of turns, β is the weight coefficient for the number of navigations, γ is the weight coefficient for the navigation distance, and α+β+γ=1.
[0043] Secondly, this solution also provides a cleaning device for use with a sweeper, comprising:
[0044] The cleaning area extraction module is used to acquire an environmental image of the site to be cleaned and extract the cleaning area from the environmental image;
[0045] The area division module is used to divide the cleaning area into multiple unit areas;
[0046] The cleaning plan generation module is used to traverse multiple unit areas in the horizontal and vertical traversal directions respectively to form multiple different cleaning plans.
[0047] The calculation module is used to calculate the number of navigation steps, the number of turns, and the navigation distance required to clean the cleaning area using different cleaning schemes.
[0048] The traversal score calculation module is used to calculate the traversal score of different cleaning schemes based on the number of navigation steps, the number of turns, and the navigation distance.
[0049] The optimal cleaning direction determination module is used to select the cleaning scheme with the smallest traversal score and obtain the cleaning direction of each unit area as the optimal cleaning direction for each unit area.
[0050] The cleaning module is used to perform cleaning of the cleaning area in the optimal cleaning direction.
[0051] Thirdly, this solution also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the cleaning method applied to a sweeping machine as described in any of the above claims.
[0052] Fourthly, this solution also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of a cleaning method for a sweeping machine as described in any of the above claims.
[0053] It is understood that the present application discloses an intelligent dynamic long-side cleaning method for robotic vacuum cleaners. This method extracts the cleaning area from an environmental image and then divides the area into zones. It then traverses all unit areas horizontally and vertically to form multiple different cleaning plans. Each cleaning plan's traversal score is calculated based on the required number of navigation steps, turns, and navigation distances in each unit area (a higher score indicates a larger number of navigation steps, turns, and navigation distances, resulting in lower efficiency). The optimal cleaning plan can be selected based on the traversal scores of each plan, and the cleaning direction of each unit area within the optimal plan becomes the best cleaning direction for that unit area. It should be noted that, to better adapt to the polygonal shape of a home, this method divides the area into unit zones and performs a horizontal and vertical traversal on each zone. Furthermore, since there are navigation distances and navigation times between each unit area after the unit area is divided, the division of unit areas and the different cleaning directions in each unit area will result in different navigation times and navigation distances, which will also affect cleaning efficiency. Therefore, this method takes into account the factors of navigation times, turning times and navigation distances to make an overall design judgment, thereby improving the cleaning efficiency of the robot vacuum cleaner based on the navigation times, turning times and navigation distances required to clean the entire cleaning area. Attached Figure Description
[0054] Figure 1 A flowchart illustrating a cleaning method applied to a sweeper, provided as an embodiment of this application;
[0055] Figure 2 A schematic block diagram of a cleaning device applied to a sweeper, provided as an embodiment of this application;
[0056] Figure 3 This is a schematic block diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0057] Household robotic vacuum cleaners typically use a zigzag path to achieve full coverage of the cleaning area. However, different starting points and cleaning directions will affect the final cleaning trajectory. Although both zigzag cleaning directions can achieve full coverage, a good cleaning direction can greatly improve cleaning efficiency. Currently, most robotic vacuum cleaners on the market only have one cleaning direction, either horizontal or vertical. While both can complete the cleaning task, this cleaning method does not utilize environmental information. Vertical cleaning in wider areas or horizontal cleaning in narrower areas results in more turns (to avoid collisions, robotic vacuum cleaners slow down at zigzag turns and accelerate again after the turn. Therefore, for cleaning tasks, the more straight the robotic vacuum cleaner travels, the fewer the turns, and the shorter the cleaning time), resulting in lower cleaning efficiency.
[0058] The intelligent dynamic long-side cleaning method and device for robot vacuums provided in this application can divide the irregular area to be cleaned into multiple cleaning zones. By calculating the distance between the robot vacuum and the navigation points of multiple cleaning zones, cleaning is performed according to the navigation distance. The optimal cleaning direction can be selected based on the number of navigation steps and the number of zigzag turns. By dynamically determining the cleaning direction, the number of navigation steps and turns can be reduced, thereby improving cleaning efficiency. At the same time, weight constraints are added to different behaviors (number of turns, number of navigation steps, navigation path) to improve path optimality. For example, if a shorter navigation path is desired, the weight of the navigation path is increased; if fewer turns are required, the weight of the number of turns is increased. This allows the solution to adapt to different cleaning needs, making it more optimal and flexible.
[0059] Please see the appendix Figure 1 This solution discloses an intelligent dynamic long-side cleaning method for robotic vacuum cleaners, comprising:
[0060] S1: Acquire an environmental image of the site to be cleaned and extract the cleaning area from the environmental image;
[0061] S2: Divide the cleaning area into multiple unit areas;
[0062] S3: Traverse multiple unit areas in both horizontal and vertical directions to form multiple different cleaning schemes;
[0063] S4: Calculate the number of navigation steps, the number of turns, and the navigation distance required to clean the cleaning area using different cleaning schemes;
[0064] S5: Calculate the traversal score for different cleaning schemes based on the number of navigation attempts, the number of turns, and the navigation distance;
[0065] S6: Take the cleaning scheme with the smallest traversal score and obtain the cleaning direction of each unit area as the optimal cleaning direction for each unit area;
[0066] S7: Perform cleaning of the cleaning area in the optimal cleaning direction.
[0067] As described in step S1 above, before the sweeper starts working, a communication connection is established with an external camera. The external camera is used to capture images of the indoor environment to establish a rectangular coordinate system, which is convenient for recording the position of the sweeper and confirming the appropriate cleaning direction. Then, the cleaning area is extracted based on the original image, and the area to be cleaned is traversed multiple times to simulate the actual cleaning route. The optimal cleaning route is then selected from the multiple traversal simulations for cleaning. The traversal method is a bow-shaped traversal method.
[0068] As described in step S2 above, the cleaning area extracted from the environmental image based on image recognition technology can be divided into regions. This region division can be based on the location of different rooms in the environmental image, or the longest boundary among all boundaries within the cleaning area can be used as the first side of the region to be divided. Then, the second side of the region to be divided is drawn from the endpoint of the first side in a direction perpendicular to the starting point on the map, resulting in a rectangular segmentation into unit regions. This process is repeated, using the second longest boundary of the remaining cleaning areas as the first side of the region to be divided, and drawing the second side of the region to be divided from the endpoint of the first side in a direction perpendicular to the starting point on the map, until no further segmentation is possible.
[0069] As described in steps S3-S5 above, after the cleaning area is divided into multiple different unit areas, a vertex of each unit area is used as the starting point for traversal. One boundary of the unit area is defined as the horizontal direction, and the direction perpendicular to this boundary is defined as the vertical direction. A horizontal traversal and a vertical traversal are performed on each unit area separately, forming multiple different cleaning schemes. Specifically, if the cleaning area is divided into unit area A and unit area B, there are four cleaning schemes for the cleaning area: Scheme 1: Unit area A (horizontal) + Unit area B (horizontal); Scheme 2: Unit area A (horizontal) + Unit area B (vertical); Scheme 3: Unit area A (horizontal) + Unit area B (vertical); Scheme 4: Unit area A (horizontal) + Unit area B (vertical); Scheme 5: Unit area A (horizontal) + Unit area B (vertical); Scheme 6: Unit area A (horizontal) + Unit area B (vertical); Scheme 7: Unit area A (horizontal) + Unit area B (vertical); Scheme 8: Unit area A (horizontal) + Unit area B (vertical); Scheme 9: Unit area A (horizontal) + Unit area B (vertical); Scheme 10: Unit area A (horizontal) + Unit area B (vertical); Scheme 11: Unit area A (horizontal) + Unit area B (vertical); Scheme 12: Unit area A (horizontal) + Unit area B (vertical); Scheme 13: Unit area A (horizontal) + Unit area B (vertical); Scheme 14: Unit area A (horizontal) + Unit area B (vertical); Scheme 15: Unit area A (horizontal) + Unit area B (vertical); Scheme 16: Unit area A (horizontal) + Unit area B (vertical); Scheme 17: Unit Option 3: Unit A (vertical) + Unit B (horizontal); Option 4: Unit A (vertical) + Unit B (vertical); Therefore, the number of navigation steps, turns, and navigation distance required for the robot vacuum to clean all unit areas in each option can be calculated. It's important to note that the required number of navigation steps, navigation distance, and turns varies depending on the traversal direction of the divided unit areas. Therefore, after obtaining the required number of navigation steps, turns, and navigation distance for cleaning the area based on different traversal directions from the previous step, and calculating the traversal score for each cleaning option using the traversal score calculation formula, the following formula is used:
[0070] score = α·number of turns + β·number of navigation attempts + γ·navigation distance
[0071] Wherein, score is the traversal score, α is the turning number weight coefficient, β is the navigation number weight coefficient, and γ is the navigation distance weight coefficient, and α+β+γ=1. The actual weights of α, β, and γ are derived from a large amount of experimental data. When calculating the traversal score of each unit area, if the longitudinal traversal score of the unit area is lower than the lateral traversal score, the longitudinal traversal direction will be taken as the optimal traversal direction of the unit area, and the longitudinal traversal score will be used as the optimal traversal score to count and calculate the traversal score of each cleaning scheme.
[0072] As described in steps S6-S7 above, after the traversal is completed, the cleaning scheme with the lowest score will be selected as the best cleaning scheme for the robot vacuum cleaner based on the traversal score of each cleaning scheme. In particular, for each unit area with the lowest traversal direction score, the direction with the lowest score will be used as the best cleaning direction for that unit area.
[0073] Therefore, the cleaning method provided in this embodiment can extract the cleaning area from the environmental image and then divide the area; at the same time, in order to better adapt to the polygonal shape of the home, a corresponding cleaning plan is made for each unit area, that is, each unit area is traversed horizontally and vertically. Furthermore, since the cleaning area is divided into unit areas, there are navigation distances and navigation times between each unit area. The division of unit areas and the different cleaning directions within each unit area will result in different navigation times and distances, which will affect cleaning efficiency. Therefore, in this solution, after dividing the cleaning area into zones, all unit areas are traversed horizontally and vertically to form multiple different cleaning plans. The traversal score of each cleaning plan is calculated based on the required navigation times, turning times, and navigation distances in each unit area (the higher the score, the greater the required navigation times, turning times, and navigation distance, and the lower the efficiency). Thus, the optimal cleaning plan can be selected based on the traversal scores of each plan, and the cleaning direction of each unit area in the optimal cleaning plan is used as the best cleaning direction for cleaning each unit area. This reduces the number of navigation times, turning times, and navigation distances required to clean the entire cleaning area, thereby improving the cleaning efficiency of the robot vacuum.
[0074] In one embodiment, the step of acquiring an environmental image of the site to be cleaned and extracting the cleaning area from the environmental image includes:
[0075] Obtain the initial position of the robot vacuum cleaner and add the initial position as an element to an expanded list, wherein the expanded list is a set of elements that have not undergone four-neighbor expansion;
[0076] Take an element from the extended list, perform a four-neighbor expansion, add elements that are not on the boundary, have not been visited, and are not in the visited list to the extended list, and add the element to the visited list, wherein the visited list is a set of elements that have already undergone four-neighbor expansion;
[0077] When the elements in the extended list are empty, the elements in the accessed list are the extracted cleaning areas.
[0078] As described above, when the robot vacuum cleaner starts working, it establishes a Cartesian coordinate system based on the environmental image and marks its initial position as point A. During the extraction of the cleaning area, the initial position A is added to the ExpandList in real time, and a four-neighbor expansion is performed. This means that the robot vacuum expands outwards from the current position A as the center point, adding positions that are not on the boundary of the expanded area, have not been visited, and are not in the VisitedList to the ExpandList. Simultaneously, the current position is added to the VisitedList. For example, if the robot vacuum cleaner's initial position is A, then both the VisitedList and ExpandList are empty at this point. Therefore, position A is added to the ExpandList, and a four-neighbor expansion is performed with position A as the center point. The resulting position B is one that is not on the boundary of the expanded area, has not been visited, and is not in the VisitedList. If the robot vacuum fails to expand the cleaning area, it will add position B to the ExpandList and position A to the VisitedList. Then, it will extract position B and use it as the center point for four-neighbor expansion. At this point, it will detect that position A is within the expanded area, but position C is not on the boundary of the expanded area centered on position B. Since position A is in the VisitedList, it means that position A has been visited. Position C is not on the boundary of the expanded area of position B, has not been visited, and is not in the VisitedList. Therefore, only position C will be added to the ExpandList for the next four-neighbor expansion, while position B will be added to the VisitedList. Once the robot vacuum has expanded the entire cleaning area using four-neighbor expansion (i.e., the ExpandList can no longer add new elements), all elements in the VisitedList represent the cleaning area extracted by the robot vacuum.
[0079] In one embodiment, the step of calculating the number of navigation steps, the number of turns, and the navigation distance required to clean the cleaning area using different cleaning schemes includes:
[0080] The unit area where the sweeper is located is taken as the initial unit area, and the initial position of the sweeper is taken as the initial search point of the sweeper;
[0081] The traversal is performed from the initial search point, and the number of turns is incremented by 1 for each bow-shaped turn.
[0082] When the sweeper reaches the boundary of the initial unit area, the position where the sweeper reaches the boundary is recorded as the end point, and the traversed area is marked as the traversed area.
[0083] When the area of the traversed area is different from the area of the cleaning area, the remaining cleaning area is obtained, and the remaining cleaning area includes the other unit areas besides the initial unit area;
[0084] Obtain the boundary point of the unit area closest to the end point in the remaining cleaning area, record it as the navigation point, drive the robot vacuum to the navigation point, and increment the navigation count by 1;
[0085] The navigation distance is obtained by calculating the distance between the endpoint and the navigation point based on the path planning algorithm.
[0086] Repeat the above steps until the remaining cleaning area has been traversed, then output the number of turns, the number of navigation steps, and the navigation distance.
[0087] As described above, when calculating the number of navigation steps, turns, and navigation distance required to clean the area using different cleaning schemes, the robot vacuum will first set the current unit area as the initial unit area and set the robot vacuum's initial position A as the initial search point, and perform a bow-shaped traversal. During the bow-shaped traversal, bow-shaped straight lines and bow-shaped turns will be performed. Each time a bow-shaped turn is performed, the number of turns will be incremented by 1. The specific number of turns needs to be determined based on the number of bow-shaped turns that occur during the traversal.
[0088] It is understandable that the method for performing horizontal and vertical bow-shaped traversal is the same; therefore, this explanation will only take the horizontal bow-shaped traversal as an example.
[0089] The four-neighbor expansion step is repeated until the robot vacuum reaches the boundary line of the initial unit area. Then, the point on the boundary line of the initial unit area is marked as the end point D. At the same time, the traversed area is marked as the traversed area, that is, the area that has been cleaned. At this time, the robot vacuum compares the cleaned area with the traversed area (i.e., the initial unit area). For example, it calculates whether the area of the initial unit area is the same as the area of the entire cleaned area. When the areas of the cleaned area and the traversed area are the same, it indicates that the cleaning is complete. Otherwise, the robot vacuum will search for the remaining cleaned areas (other unit areas) in the cleaned area and generate a navigation route from the current position of the robot vacuum to navigate to the other unit areas for cleaning.
[0090] Specifically, by setting the end point D of the sweeping robot as the current search point, the remaining cleaning area will be extracted according to the above method for extracting the cleaning area. The system will continuously extract elements from the visited list to expand the four-neighborhood. When the number of elements in the visited list is zero, it indicates that the entire area has been cleaned. The number of navigations at this time is the final number of navigations.
[0091] If any element remains in the VisitedList (i.e., the area of the traversed surface does not match the area of the cleaning area), it indicates that at least one remaining cleaning area exists. The robot vacuum extracts and marks the vertex positions of these remaining cleaning areas (i.e., the boundary points of the remaining untraversed unit areas) using the method described above, and calculates the navigation distance from the robot vacuum to each vertex. The vertex with the shortest navigation distance is taken as the navigation point. After cleaning the initial unit area, the robot vacuum uses the end point D of the initial unit area as the current search point. If unit area E is detected, the robot vacuum will calculate the end point. The distance from point D to any boundary point of unit E is calculated, and the boundary point a closest to the end point D is selected as the navigation point. The robot vacuum is then guided to point a to clean unit E. After cleaning unit E, the above steps are repeated, using the end point d of unit E as the current search point to continue searching for any remaining uncleaned areas. If there are still uncleaned areas in unit F, the robot vacuum will navigate from the end point d to the nearest navigation point e of unit F to clean unit F. After cleaning, the robot vacuum will search again to see if there are any remaining uncleaned areas, and so on, until all areas are cleaned.
[0092] During the movement from cell E to cell F and then to cell H, the navigation distance from the end point D to the navigation point a and the navigation distance from the end point d to the navigation point e can be calculated according to the path planning algorithm. The navigation distance is calculated according to the path planning algorithm, which includes the A* algorithm and the Dijkstra algorithm.
[0093] When the area traversed is the same as the area to be cleaned, it means that all areas have been cleaned. The robot vacuum will then output the number of turns, navigation times, and navigation distance for all areas.
[0094] In one embodiment, the step of obtaining the boundary point of the unit area closest to the end point in the remaining cleaning area, denoted as the navigation point, driving the robot vacuum to the navigation point, and incrementing the navigation count by 1 includes:
[0095] Obtain the vertex positions of each unit region in the remaining cleaning area;
[0096] Calculate the navigation distance from the sweeping robot to each vertex position of each of the aforementioned unit areas;
[0097] The vertex closest to the robot vacuum is used as the navigation point for the remaining cleaning area, and is denoted as the navigation point.
[0098] The robot vacuum is directed to the navigation point in the remaining cleaning area, and the navigation count is incremented by 1.
[0099] As described above, after cleaning the first unit area E, the robot searches for the remaining cleaning areas. It finds two uncleaned unit areas, H and F. The robot then captures and marks the four corner vertices (a, b, c, d) of unit area H and the four corner vertices (e, f, g, h) of unit area F. It calculates the distances between the robot and each vertex (a, b, c, d, e, f, g, h). If the robot's navigation distance to vertex a is the closest, it uses a as the navigation point for unit area H and drives the robot to clean from point a. The navigation count C_Nav = 1 is recorded. After cleaning unit area H, if the end point of unit area H is d, the robot searches for the remaining cleaning areas again. Since unit area F is uncleaned, the robot captures and marks unit area F. The navigation distances of the four vertices in the meta-region are calculated. If the navigation distance between the end point d and point e is the shortest, then point e will be used as the navigation point for unit region F, and the robot vacuum will be driven to navigate from the end point d to point e to clean unit region F. At this time, the navigation count is recorded as C_Nav = C_Navi + 1, where C_Navi is the navigation count for the i-th navigation, and i is an integer greater than or equal to zero. Here, since only one navigation has been performed before, that is, from region E to region F, C_Navi = 1. When unit region F is cleaned and the robot vacuum is navigated to unit region H, if the elements in the visited list are zero, that is, there are no remaining uncleaned areas, it means that the entire area has been cleaned; therefore, the final navigation count is 2.
[0100] In one embodiment, the step of dividing the cleaning area into multiple unit areas includes:
[0101] Obstacles are identified in the cleaning area to obtain a first map containing the obstacles;
[0102] Obtain all boundaries contained in the first map, where the boundaries include map boundaries and obstacle boundaries;
[0103] Perform a rectangle segmentation operation, which includes: sorting all boundaries according to their length, taking the longest boundary as the first side, and using the endpoint of the first side as the starting point and a second side perpendicular to the starting point in the map direction to perform rectangle segmentation, thereby forming a unit region;
[0104] Obtain a second map from the first map excluding the unit region, and obtain all remaining boundaries contained in the second map;
[0105] Perform the rectangle segmentation operation on all remaining boundaries to divide other unit regions until rectangle segmentation is no longer possible.
[0106] As described above, when dividing the cleaning area, image recognition technology is used to extract the boundaries (walls) and obstacles in the building from the environmental image to obtain a first map containing the obstacles. Then, the boundary lengths of each wall and obstacle in the first map are calculated. The longest boundary is then selected as the first side of the rectangular division area. Using the two ends of the first side as starting points, a second side is formed perpendicular to the first side and extending inwards from one endpoint of the first map. Specifically, in the first map, the longest boundary line is used as the first side. A straight line is drawn perpendicular to the first side and extending inwards from one endpoint of the first side, forming a second side perpendicular to the first side and with its perpendicular point at one of the endpoints of the first side. Therefore, the lengths of the first and second sides can be used to divide the area. The first rectangular region is segmented from the first map as the first segmented unit region. Then, the first segmented unit region is removed from the first map to obtain the second map. Then, the second map is segmented from the second map using the same rectangular segmentation method as the second segmented unit region. This process is repeated until the entire first map is segmented or rectangular segmentation can no longer be performed. To avoid infinitely looping rectangular segmentation, a custom minimum boundary length value can be defined. Rectangular segmentation stops when the boundary length of the longest side in the remaining map is less than the minimum boundary length value. Following this method, each segmented region can be the largest rectangular shape, which facilitates the calculation of the number of turns, navigation times, and navigation distances in subsequent horizontal and vertical traversals.
[0107] In one embodiment, the step of cleaning the cleaning area in the optimal cleaning direction includes:
[0108] When there is a region that cannot be divided into rectangles, it is denoted as the region to be compensated.
[0109] The unit region with the longest boundary length with the area to be compensated is obtained to obtain the bordering unit region;
[0110] The area to be compensated is joined with the bordering unit area;
[0111] When the sweeper moves to the adjacent unit area, it also cleans the area to be compensated.
[0112] As described above, when there are areas that cannot be rectangularly divided or when the length of the longest side in the remaining map is less than the minimum boundary length, the remaining map is merged. Specifically, when there are areas that cannot be rectangularly divided or when the length of the longest side is less than the minimum boundary length, the remaining map area after rectangular division is marked as the area to be compensated. Since rectangular division is performed, there are at least two straight edges in the area to be compensated whose lengths can be directly calculated. Therefore, by calculating the lengths of the straight edges in the area to be compensated, the border lengths between these two straight edges and the adjacent bordering unit areas can be calculated. A larger border length indicates a greater degree of parallelism between the area to be compensated and the bordering unit area in the same direction. Therefore, the area to be compensated can be spliced with the bordering unit area with the largest border length. When the sweeper performs its cleaning task and moves to the bordering unit area, it also cleans the area to be compensated.
[0113] In one embodiment, the horizontal traversal score and the vertical traversal score of the current position are calculated based on the number of navigation steps, turns, and navigation distance required for the horizontal and vertical bow-shaped traversals, respectively. The formula for calculating the traversal score is as follows:
[0114] Traversal score = α * number of turns + β * number of navigation attempts + γ * navigation distance
[0115] Where score is the traversal score, α is the weight coefficient for the number of turns, β is the weight coefficient for the number of navigations, γ is the weight coefficient for the navigation distance, and α+β+γ=1.
[0116] As mentioned above, the traversal scores for horizontal and vertical traversals are calculated using the traversal score calculation formula, which is as follows:
[0117] Traversal score = α * number of turns + β * number of navigation attempts + γ * navigation distance
[0118] Where α is the weighting coefficient for the number of turns, β is the weighting coefficient for the number of navigation attempts, and γ is the weighting coefficient for the navigation distance, and α + β + γ = 1, the actual weights of α, β, and γ are derived from a large amount of experimental data. It should be noted that when the number of turns is the main criterion, the weighting coefficient α for the number of turns is greater than the weighting coefficient β for the number of navigation attempts and the weighting coefficient γ for the navigation distance. When the number of navigation attempts is the main criterion, the weighting coefficient β for the number of navigation attempts is greater than the weighting coefficient α for the number of turns and the weighting coefficient γ for the navigation distance. When the navigation distance is the main criterion, the weighting coefficient γ for the navigation distance is greater than the weighting coefficient β for the number of navigation attempts and the weighting coefficient α for the number of turns.
[0119] Reference Figure 2 Secondly, this disclosure also provides a cleaning device for use in a sweeper, comprising:
[0120] The cleaning area extraction module 100 is used to acquire an environmental image of the site to be cleaned and extract the cleaning area from the environmental image.
[0121] The area division module 200 is used to divide the cleaning area into multiple unit areas;
[0122] The cleaning plan generation module 300 is used to traverse multiple unit areas in the horizontal and vertical traversal directions respectively to form multiple different cleaning plans.
[0123] The calculation module 400 is used to calculate the number of navigation steps, the number of turns, and the navigation distance required to clean the cleaning area using different cleaning schemes.
[0124] The traversal score calculation module 500 is used to calculate the traversal score of different cleaning schemes based on the number of navigations, the number of turns, and the navigation distance.
[0125] The optimal cleaning direction determination module 600 is used to select the cleaning scheme with the smallest traversal score and obtain the cleaning direction of each unit area as the optimal cleaning direction for each unit area.
[0126] The cleaning module 700 is used to perform cleaning of the cleaning area in the optimal cleaning direction.
[0127] In one embodiment, the cleaning area extraction module 100 is further configured to:
[0128] Obtain the initial position of the robot vacuum cleaner and add the initial position as an element to an expanded list, wherein the expanded list is a set of elements that have not undergone four-neighbor expansion;
[0129] Take an element from the extended list, perform a four-neighbor expansion, add elements that are not on the boundary, have not been visited, and are not in the visited list to the extended list, and add the element to the visited list, wherein the visited list is a set of elements that have already undergone four-neighbor expansion;
[0130] When the elements in the extended list are empty, the elements in the accessed list are the extracted cleaning areas.
[0131] In one embodiment, the computing module 400 is further configured to:
[0132] The unit area where the sweeper is located is taken as the initial unit area, and the initial position of the sweeper is taken as the initial search point of the sweeper;
[0133] The traversal is performed from the initial search point, and the number of turns is incremented by 1 for each bow-shaped turn.
[0134] When the sweeper reaches the boundary of the initial unit area, the position where the sweeper reaches the boundary is recorded as the end point, and the traversed area is marked as the traversed area.
[0135] When the area of the traversed area is different from the area of the cleaning area, the remaining cleaning area is obtained, and the remaining cleaning area includes the other unit areas besides the initial unit area;
[0136] Obtain the boundary point of the unit area closest to the end point in the remaining cleaning area, record it as the navigation point, drive the robot vacuum to the navigation point, and increment the navigation count by 1;
[0137] The navigation distance is obtained by calculating the distance between the endpoint and the navigation point based on the path planning algorithm.
[0138] Repeat the above steps until the remaining cleaning area has been traversed, then output the number of turns, the number of navigation steps, and the navigation distance.
[0139] In one embodiment, the region division module 200 is further configured to:
[0140] Obstacles are identified in the cleaning area to obtain a first map containing the obstacles;
[0141] Obtain all boundaries contained in the first map, where the boundaries include map boundaries and obstacle boundaries;
[0142] Perform a rectangle segmentation operation, which includes: sorting all boundaries according to their length, taking the longest boundary as the first side, and using the endpoint of the first side as the starting point and a second side perpendicular to the starting point in the map direction to perform rectangle segmentation, thereby forming a unit region;
[0143] Obtain a second map from the first map excluding the unit region, and obtain all remaining boundaries contained in the second map;
[0144] Perform the rectangle segmentation operation on all remaining boundaries to divide other unit regions until rectangle segmentation is no longer possible.
[0145] In one embodiment, the computing module 400 is further configured to:
[0146] Obtain the vertex positions of each unit region in the remaining cleaning area;
[0147] Calculate the navigation distance from the sweeping robot to each vertex position of each of the aforementioned unit areas;
[0148] The vertex closest to the robot vacuum is used as the navigation point for the remaining cleaning area, and is denoted as the navigation point.
[0149] The robot vacuum is directed to the navigation point in the remaining cleaning area, and the navigation count is incremented by 1.
[0150] In one embodiment, the cleaning module 700 is further configured to:
[0151] When there is a region that cannot be divided into rectangles, it is denoted as the region to be compensated.
[0152] The unit region with the longest boundary length with the area to be compensated is obtained to obtain the bordering unit region;
[0153] The area to be compensated is joined with the bordering unit area;
[0154] When the sweeper moves to the adjacent unit area, it also cleans the area to be compensated.
[0155] In one embodiment, the traversal score calculation module 500 is used to calculate the traversal score, and the formula for calculating the traversal score is:
[0156] score = α·number of turns + β·number of navigation attempts + γ·navigation distance
[0157] Where score is the traversal score, α is the weight coefficient for the number of turns, β is the weight coefficient for the number of navigations, γ is the weight coefficient for the navigation distance, and α+β+γ=1.
[0158] See attached document Figure 3This disclosure also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 3 As shown, the computer device includes a processor, memory, network interface, database, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores cleaning data applied to the sweeper. The network interface allows communication with external terminals via a network connection. When the processor executes the computer program, it implements a cleaning method applied to the sweeper.
[0159] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present disclosure and does not constitute a limitation on the computer equipment on which the present disclosure is applied.
[0160] One embodiment of this disclosure also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements a cleaning method applied to a robot vacuum cleaner. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0161] In summary, the cleaning method, apparatus, device, and storage medium for a robotic vacuum cleaner provided in this disclosure can extract the cleaning area from the environment; perform a horizontal and vertical bow-shaped traversal based on the robot's current position, and count the number of navigation steps and bow-shaped turns required to clean the area. If the number of navigation steps differs, the cleaning direction with the fewest navigation steps is selected as the current cleaning direction; if the number of navigation steps is the same, the cleaning direction with the fewest bow-shaped turns is selected as the current cleaning direction. This process is repeated until the entire cleaning task is completed. For areas that are irregular in shape, the area to be cleaned can be... Irregular areas are divided into multiple cleaning zones. The distance between the robot vacuum and the navigation points of these zones is calculated, and cleaning is performed based on the navigation distance. The optimal cleaning direction is selected based on the number of navigation steps and the number of zigzag turns. This dynamic method of determining the cleaning direction reduces the number of navigation steps and turns, thus improving cleaning efficiency. Furthermore, weight constraints are added to different behaviors (number of turns, number of navigation steps, and navigation path) to ensure path optimality. For example, if a shorter navigation path is desired, the weight of the navigation path is increased; if fewer turns are required, the weight of the number of turns is increased. This allows the solution to adapt to different cleaning needs.
[0162] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media provided in this disclosure and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).
[0163] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0164] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
Claims
1. A cleaning method applied to a sweeper, characterized in that, include: Acquire an environmental image of the site to be cleaned and extract the cleaning area from the environmental image; The cleaning area is divided into multiple unit areas; The multiple unit regions are traversed in both horizontal and vertical directions to form multiple different cleaning schemes. Calculate the number of navigation steps, turns, and navigation distance required to clean the area using different cleaning schemes. Based on the number of navigation attempts, the number of turns, and the navigation distance, calculate the traversal score for different cleaning schemes; The cleaning scheme with the smallest traversal score is selected, and the cleaning direction of each unit area is obtained as the optimal cleaning direction for each unit area. The cleaning area is performed in the optimal cleaning direction; The steps of calculating the number of navigation steps, turns, and navigation distance required to clean the cleaning area using different cleaning schemes include: The unit area where the sweeper is located is taken as the initial unit area, and the initial position of the sweeper is taken as the initial search point; A bow-shaped traversal is performed using the initial search point. During the bow-shaped traversal, bow-shaped straight lines and bow-shaped turns are performed. The number of turns is incremented by 1 for each bow-shaped turn. When the sweeper reaches the boundary of the initial unit area, the position where the sweeper reaches the boundary is recorded as the end point, and the traversed area is marked as the traversed area. When the area of the traversed area is different from the area of the cleaning area, the remaining cleaning area is obtained, and the remaining cleaning area includes the other unit areas besides the initial unit area; Obtain the boundary point of the unit area closest to the end point in the remaining cleaning area, record it as the navigation point, drive the robot vacuum to the navigation point, and increment the navigation count by 1; The navigation distance is obtained by calculating the distance between the endpoint and the navigation point based on the path planning algorithm. Repeat the above steps until the remaining cleaning area has been traversed, then output the number of turns, the number of navigation steps, and the navigation distance. The formula for calculating the traversal score is as follows: score = α·number of turns + β·number of navigation attempts + γ·navigation distance Where score is the traversal score, α is the weight coefficient for the number of turns, β is the weight coefficient for the number of navigations, γ is the weight coefficient for the navigation distance, and α+β+γ=1.
2. The cleaning method applied to a sweeper as described in claim 1, characterized in that, The steps of acquiring an environmental image of the site to be cleaned and extracting the cleaning area from the environmental image include: Obtain the initial position of the robot vacuum cleaner and add the initial position as an element to an expanded list, wherein the expanded list is a set of elements that have not undergone four-neighbor expansion; Take an element from the extended list, perform a four-neighbor expansion, add elements that are not on the boundary, have not been visited, and are not in the visited list to the extended list, and add the element to the visited list, wherein the visited list is a set of elements that have already undergone four-neighbor expansion; When the elements in the extended list are empty, the elements in the accessed list are the extracted cleaning areas.
3. The cleaning method applied to a sweeper as described in claim 1, characterized in that, The step of dividing the cleaning area into multiple unit areas includes: Obstacles are identified in the cleaning area to obtain a first map containing the obstacles; Obtain all boundaries contained in the first map, where the boundaries include map boundaries and obstacle boundaries; Perform a rectangle segmentation operation, which includes: sorting all boundaries according to their length, taking the longest boundary as the first side, and using the endpoint of the first side as the starting point and a second side perpendicular to the starting point in the map direction to perform rectangle segmentation, thereby forming a unit region; Obtain a second map from the first map excluding the unit region, and obtain all remaining boundaries contained in the second map; Perform the rectangle segmentation operation on all remaining boundaries to divide other unit regions until rectangle segmentation is no longer possible.
4. The cleaning method applied to a sweeper as described in claim 1, characterized in that, The step of obtaining the boundary point of the unit area closest to the end point in the remaining cleaning area, denoted as the navigation point, driving the robot vacuum to the navigation point, and incrementing the navigation count by 1 includes: Obtain the vertex positions of each unit region in the remaining cleaning area; Calculate the navigation distance from the sweeping robot to each vertex position of each of the aforementioned unit areas; The vertex closest to the robot vacuum is used as the navigation point for the remaining cleaning area, and is denoted as the navigation point. The robot vacuum is directed to the navigation point in the remaining cleaning area, and the navigation count is incremented by 1.
5. The cleaning method applied to a sweeper as described in claim 3, characterized in that, The step of cleaning the cleaning area in the optimal cleaning direction includes: When there is a region that cannot be divided into rectangles, it is denoted as the region to be compensated. The unit region with the longest boundary length with the area to be compensated is obtained to obtain the bordering unit region; The area to be compensated is joined with the bordering unit area; When the sweeper moves to the adjacent unit area, it also cleans the area to be compensated.
6. A cleaning device for performing the cleaning method applied to a sweeper as described in claim 1, characterized in that, The cleaning device includes: The cleaning area extraction module is used to acquire an environmental image of the site to be cleaned and extract the cleaning area from the environmental image; The area division module is used to divide the cleaning area into multiple unit areas; The cleaning plan generation module is used to traverse multiple unit areas in the horizontal and vertical traversal directions respectively to form multiple different cleaning plans. The calculation module is used to calculate the number of navigation steps, the number of turns, and the navigation distance required to clean the cleaning area using different cleaning schemes. The traversal score calculation module is used to calculate the traversal score of different cleaning schemes based on the number of navigation steps, the number of turns, and the navigation distance. The optimal cleaning direction determination module is used to select the cleaning scheme with the smallest traversal score and obtain the cleaning direction of each unit area as the optimal cleaning direction for each unit area. The cleaning module is used to perform cleaning of the cleaning area in the optimal cleaning direction.
7. A computer device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the cleaning method applied to a sweeping machine as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by a processor, implements the steps of a cleaning method for a sweeping machine as described in any one of claims 1-5.
Citation Information
Patent Citations
Robot walking path searching method and electronic equipment
CN112515554A
Path planning method, robot cleaning method and related equipment
CN114397893A
Device controller, and self-traveling electronic device
JP2014071845A