Methods for determining work areas, computer equipment, and computer-readable storage media
By automatically determining the work area of self-moving equipment through grid maps and water-splashing algorithms, the problem of low efficiency in existing technologies is solved, and efficient, accurate and automated work area planning is achieved.
Patent Information
- Application Number
- CN202311473263.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-06
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-11-06
AI Technical Summary
In existing technologies, self-moving devices rely on physical boundary lines when determining the work area, resulting in low efficiency and poor flexibility.
The grid map method is adopted. The target grid is determined by marking the preset boundary on the grid map, and the grid outside the preset boundary is set to occupied state. The water splashing algorithm is used to traverse and set it to occupied state. Finally, the working area is determined according to the preset boundary and the empty grid.
It enables efficient, accurate, and automated determination of the work area for self-moving equipment, reducing manual intervention and improving work efficiency and flexibility.
Smart Images

Figure CN117668133B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and more particularly to a method for determining a work area, a computer device, and a computer-readable storage medium. Background Technology
[0002] Currently, self-moving equipment such as lawnmowers and snowplows need to have their work areas pre-defined before starting operation to help them better plan their routes and avoid overlapping or missing areas. In related technologies, physical boundary lines are typically used to define the work area. The self-moving equipment can detect these physical boundary lines using sensors to determine the work area. However, this method of using physical boundary lines to determine the work area has drawbacks: complex installation, poor flexibility, and a long time required for boundary line detection, thus reducing the efficiency of defining the work area.
[0003] Therefore, improving the efficiency of determining the operating area of self-moving equipment has become an urgent problem to be solved. Summary of the Invention
[0004] This application provides a method for determining a work area, a computer device, and a computer-readable storage medium, which solves the problem of low efficiency in related technologies that determine the work area by detecting physical boundary lines.
[0005] Firstly, this application provides a method for determining a work area, the method comprising:
[0006] A grid map is obtained, comprising multiple grids, each of which is set to an idle state; a preset boundary recorded on the grid map is marked to determine the target grid occupied by the preset boundary on the grid map; based on the target grid, the grids outside the preset boundary are traversed to set all grids outside the preset boundary to an occupied state; based on the preset boundary and the remaining idle grids, the work area is determined.
[0007] The above method marks the preset boundaries recorded on the grid map, determines the target grid cells occupied by the preset boundaries on the grid map, sets all grid cells outside the preset boundaries to an occupied state, and determines the work area based on the preset boundaries and the remaining idle grid cells. This method can automatically determine the work area based on the status of each grid cell in the grid map, solving the problem of low efficiency in related technologies that use physical boundary lines to determine the work area of self-moving equipment. Moreover, it does not require manual intervention and can effectively improve the efficiency of determining the work area of self-moving equipment.
[0008] Secondly, this application also provides a computer device, which includes a memory and a processor;
[0009] The memory is used to store computer programs;
[0010] The processor is configured to execute the computer program and, when executing the computer program, implement the job area determination method as described above.
[0011] Thirdly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the working area determination method described above. Attached Figure Description
[0012] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application;
[0014] Figure 2 This is a schematic flowchart of a method for determining a work area provided in an embodiment of this application;
[0015] Figure 3 This is a schematic diagram of a grid map provided in an embodiment of this application;
[0016] Figure 4 This is a schematic diagram of another raster map provided in an embodiment of this application;
[0017] Figure 5 This is a schematic diagram of another raster map provided in an embodiment of this application;
[0018] Figure 6 This is a schematic flowchart illustrating a sub-step for traversing a grid, as provided in an embodiment of this application.
[0019] Figure 7 This is a schematic diagram of another raster map provided in an embodiment of this application;
[0020] Figure 8 This is a schematic diagram of traversing a grid according to an embodiment of this application;
[0021] Figure 9 This is a schematic diagram of another raster map provided in an embodiment of this application;
[0022] Figure 10 This is a schematic diagram of another raster map provided in an embodiment of this application. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0025] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0026] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0027] Embodiments of this application provide a method for determining a work area, a computer device, and a computer-readable storage medium. The method for determining a work area can be applied to a computer device and can automatically determine the work area based on the state of each grid cell in a grid map. This solves the problem of low efficiency in related technologies that use physical boundary lines to determine the work area of a self-moving device, and it eliminates the need for manual intervention, effectively improving the efficiency of determining the work area of a self-moving device.
[0028] For example, a computer device can be a server or a terminal, or it can be a self-moving device. Self-moving devices can include, but are not limited to, mobile devices such as lawnmowers, snowplows, robotic vacuum cleaners, food delivery robots, and welcoming robots. A server can be a standalone server or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. A terminal can be a mobile energy storage device, a home energy storage device, a smartphone, a tablet, a laptop, or a desktop computer, among other energy storage devices.
[0029] It should be noted that, in this embodiment of the application, determining the working area of the self-moving device based on the state of each grid in the grid map can effectively improve the efficiency of determining the working area of the self-moving device, thereby enabling the self-moving device to perform efficient, accurate and automated operations based on the working area.
[0030] Understandably, automated mobile devices can plan optimal paths through work areas on a grid map, avoiding repetitive work or missing certain areas, thereby improving work efficiency. Simultaneously, automated mobile devices can accurately mark the boundaries of their operational areas on the grid map, preventing accidental entry into non-operational areas and improving work accuracy. Automated mobile devices can also automate operations through work areas on the grid map without manual intervention, significantly reducing the user's workload. Furthermore, when it's necessary to change the work area, only the grid map needs to be updated, making the operation simple and convenient, and improving operational flexibility.
[0031] Please see Figure 1 , Figure 1 This is a schematic diagram of the structure of a computer device 100 provided in an embodiment of this application. The computer device 100 may include a processor 1001 and a memory 1002, wherein the processor 1001 and the memory 1002 can be connected by a bus, which can be any applicable bus such as an Inter-integrated Circuit (I2C) bus.
[0032] The memory 1002 may include a storage medium and internal memory. The storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, cause the processor to perform the job region determination method described in any embodiment.
[0033] The processor 1001 provides computing and control capabilities to support the operation of the entire computer device 100.
[0034] The processor 1001 can be a Central Processing Unit (CPU), but it can also be a general-purpose processor, a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or it can be any conventional processor.
[0035] In one embodiment, the processor 1001 is configured to run a computer program stored in the memory 1002 to perform the following steps:
[0036] Obtain a grid map, which includes multiple grids, each set to an idle state; mark the preset boundaries recorded on the grid map to determine the target grids occupied by the preset boundaries on the grid map; based on the target grids, traverse the grids outside the preset boundaries to set all grids outside the preset boundaries to an occupied state; determine the work area based on the preset boundaries and the remaining idle grids.
[0037] In one embodiment, before implementing the traversal of the grid outside the preset boundary based on the target grid, the processor 1001 is also configured to implement:
[0038] Set the target grid to occupied state.
[0039] In one embodiment, when the processor 1001 traverses the grid outside the preset boundary according to the target grid to set all grids outside the preset boundary to an occupied state, it is used to implement:
[0040] The process involves determining the starting and ending traversal grids in the grid map and adding the starting traversal grid to a preset grid queue. The starting traversal grid is popped from the grid queue, and the process begins traversing the grids outside the preset boundary in a first direction, setting the currently traversed grid to an occupied state and adding the corresponding candidate grid to the grid queue, until a preset stopping traversal condition is met. Grids are then popped from the grid queue sequentially, and the popped grid is designated as the starting traversal grid. The process then returns to the previous steps, where the process continues traversing the grids outside the preset boundary in the first direction, setting the currently traversed grid to an occupied state and adding the corresponding candidate grid to the grid queue, until the stopping traversal condition is met. When the grid queue ends its traversal by popping grids from the queue, the ending traversal grid is set to an occupied state, and the traversal operation stops.
[0041] In one embodiment, when determining the start and end traversal grids in a grid map, the processor 1001 is used to implement:
[0042] Set the grid cells near the map boundary of the grid map to occupied state; determine the first remaining idle grid cell in the grid map that is outside the preset boundary as the starting traversal grid cell, and determine the last remaining idle grid cell in the grid map that is outside the preset boundary as the ending traversal grid cell.
[0043] In one embodiment, after implementing the setting of the traversed grid to the occupied state when the grid queue pops out of the stack, the processor 1001 is also used to implement:
[0044] The raster map is traversed to determine if any raster cells are missing. Missing raster cells are those that are idle and outside the preset boundary. If a missing raster cell is found, it is designated as the starting raster cell and added to the raster queue. The process then returns to the previous step, popping the starting raster cell from the queue and traversing the raster cells outside the preset boundary in the first direction. The current raster cell is set to occupied and the candidate raster cell corresponding to the current raster cell is added to the raster queue. This process continues until the traversal stops and the raster map is free of missing raster cells.
[0045] In one embodiment, when the processor 1001 determines the working area based on a preset boundary and the remaining idle grid cells, it is used to:
[0046] The work area is determined based on the preset boundary and the area enclosed by the remaining idle grid cells.
[0047] The following detailed description, in conjunction with the accompanying drawings, outlines some embodiments of this application. Unless otherwise specified, the following embodiments and features described herein can be combined with each other. Please refer to... Figure 2 , Figure 2 This is a schematic flowchart illustrating a method for determining a work area provided in an embodiment of this application. Figure 2 As shown, the method for determining the work area may include steps S101 to S104.
[0048] Step S101: Obtain a grid map, which includes multiple grids, and each grid is set to an idle state.
[0049] For example, a raster map can be generated at a preset resolution, and each raster in the entire raster map can be set to an idle state. The preset resolution can be set according to the actual situation, and the specific value is not limited here.
[0050] Please see Figure 3 , Figure 3 This is a schematic diagram of a raster map provided in an embodiment of this application. For example... Figure 3 As shown, each grid cell in the raster map is set to an idle state, where the value corresponding to the grid cell is set to 1 ( Figure 3 In the gray area, when 1) is displayed, it indicates that the raster is in an idle state. A raster in a raster map can be a rectangle or other polygons.
[0051] It should be noted that a grid map is a map that discretizes the external environment into grids of the same size. In the embodiments of this application, each grid cell in the grid map can be assigned a different state, such as an occupied state and an idle state. An idle state indicates that the grid cell has no obstacles, while an occupied state indicates that the grid cell has obstacles.
[0052] Step S102: Mark the preset boundaries recorded on the grid map to determine the target grid occupied by the preset boundaries on the grid map.
[0053] For example, after acquiring the raster map, a preset boundary recorded on the raster map can be marked, and the raster occupied by the preset boundary on the raster map can be determined as the target raster.
[0054] Please see Figure 4 , Figure 4 This is a schematic diagram of another raster map provided in an embodiment of this application. For example... Figure 4As shown, preset boundaries recorded by the user on a grid map can be marked. It should be noted that, in this embodiment, the preset boundaries are used to assist in determining the work area. For example, after marking the preset boundaries on the grid map, all grid cells outside the preset boundaries can be set to an occupied state, and the area enclosed by the preset boundaries and the remaining idle grid cells within the preset boundaries can be determined as the work area.
[0055] In the above embodiments, by marking the preset boundary recorded on the grid map, the target grid occupied by the preset boundary on the grid map can be determined. Subsequently, based on the target grid, the grids outside the preset boundary can be traversed, and all grids outside the preset boundary can be set to an occupied state.
[0056] Step S103: Based on the target grid, traverse the grids outside the preset boundary to set all grids outside the preset boundary to an occupied state.
[0057] In some embodiments, before traversing the grid outside the preset boundary according to the target grid, the method may further include setting the target grid to an occupied state.
[0058] Please see Figure 5 , Figure 5 This is a schematic diagram of another raster map provided in an embodiment of this application. For example... Figure 5 As shown, a target grid cell occupied by a preset boundary on a grid map can be set to an occupied state, where the value corresponding to the grid cell is set to 0. Figure 5 When white represents 0), it indicates that the grid is occupied.
[0059] It should be noted that since the target grid is a grid on a preset boundary, traversing the grid on the preset boundary would result in grids within the preset boundary being set to an occupied state, thus affecting the accuracy of the work area division. By setting the target grid to an occupied state, during grid traversal, if the next grid of the current grid is occupied, traversal stops. This avoids the situation where traversing the target grid on the preset boundary would result in grids within the preset boundary being set to an occupied state, thereby improving the accuracy of the work area division.
[0060] In some embodiments, after setting the target grid to an occupied state, the grids outside the preset boundary can be traversed according to the target grid to set all grids outside the preset boundary to an occupied state.
[0061] In this embodiment, since it is necessary to set all grids outside the preset boundary to an occupied state, the values corresponding to the grids outside the preset boundary are different from the values corresponding to the grids inside the preset boundary. Grids with different values are equivalent to uneven ground. In order to quickly and accurately segment grids with different values based on the preset boundary, a water-splashing algorithm can be used. Based on the target grid, the grids outside the preset boundary are traversed to set all grids outside the preset boundary to an occupied state. The following will describe in detail how to traverse the grids outside the preset boundary.
[0062] It's important to understand that the water-splashing algorithm works as follows: As water flows from high to low, it stops flowing and accumulates at local lowest points. Imagine gradually flooding an uneven surface; the water will follow the steepest descent to reach the water jet and accumulate until it overflows at the local highest point at the edge of the puddle. Once all the puddles are filled, they become small lakes of varying sizes and depths, with the boundaries of these lakes (i.e., local highest points) defining the puddles. Any excess water will automatically overflow and flow towards the infinitely deep seabed surrounding the image terrain. All these small lakes represent the various defects detected. When detecting water jets using the water-splashing algorithm, a minimum elevation point needs to be found on the image terrain beforehand. Starting from this point, if adjacent pixels have the same height, they are grouped together. Therefore, a puddle consists of a minimum elevation pixel and a set of pixels—a "group"—where the points in the puddle have a lower elevation than its lowest edge point.
[0063] Please see Figure 6 , Figure 6 This is a schematic flowchart illustrating a sub-step for traversing a grid, as provided in an embodiment of this application. Figure 6 As shown, step S103 may include steps S1031 to S1034.
[0064] Step S1031: Determine the starting and ending traversal grids in the grid map, and add the starting traversal grid to the preset grid queue.
[0065] In this embodiment of the application, before traversing the grid outside the preset boundary in the grid map, in order to determine the range of the traversed grid, it is necessary to first determine a starting traversed grid and an ending traversed grid, so that the traversal operation can start from the starting traversed grid and stop when the traversal reaches the ending traversed grid.
[0066] In some embodiments, determining the starting and ending traversal grids in a grid map may include: setting grids near the map boundary of the grid map to an occupied state; determining the first remaining grid in the grid map that is in an idle state and outside a preset boundary as the starting traversal grid; and determining the last remaining grid in the grid map that is in an idle state and outside a preset boundary as the ending traversal grid.
[0067] For example, the grid cells near the map boundary of the grid map can be the first row, first column, last row, and last column grid cells in the grid map.
[0068] Please see Figure 7 , Figure 7 This is a schematic diagram of another raster map provided in an embodiment of this application. For example... Figure 7 As shown, the first row, first column, last row, and last column of the raster map can be set to occupied state. Then, the first remaining idle raster in the raster map that is outside the preset boundary (e.g., raster A) can be determined as the starting traversal raster, and the last remaining idle raster in the raster map that is outside the preset boundary (e.g., raster B) can be determined as the ending traversal raster.
[0069] In the above embodiments, by setting the grid cells near the map boundary to an occupied state, subsequent grid traversal operations can exclude traversing these cells, thus improving traversal efficiency. By determining the first remaining idle grid cell outside the preset boundary as the starting traversal grid cell, and the last remaining idle grid cell outside the preset boundary as the ending traversal grid cell, the range of the traversal grid can be determined based on the starting and ending traversal grid cells. This allows the traversal operation to begin from the starting grid cell and stop when the ending traversal grid cell is reached.
[0070] In some embodiments, after determining the starting and ending traversal grids in the grid map, the starting traversal grid is added to a preset grid queue.
[0071] It should be noted that, in this embodiment, the grid queue is used to store candidate grids. During grid traversal, candidate grids of the currently traversed grid can be added to the grid queue. At the end of each round of grid traversal, a grid is popped from the grid queue as the starting grid for a new round of grid traversal. The grid queue pops grids in a first-in, first-out (FIFO) manner.
[0072] In the above embodiments, by adding the starting traversal grid to the grid queue, the subsequent grid queues can pop the starting traversal grid first based on the first-in-first-out method, so that the traversal operation can be performed starting from the starting traversal grid.
[0073] Step S1032: Pop the starting traversal grid from the grid queue, start traversing the grids outside the preset boundary in the first direction from the starting traversal grid, set the current traversed grid to the occupied state and add the candidate grid corresponding to the current grid to the grid queue, until the preset stop traversal condition is met.
[0074] For example, after adding the starting traversal grid to the grid queue, the starting traversal grid can be popped from the grid queue, and the grids outside the preset boundary can be traversed from the starting traversal grid in the first direction. The current traversed grid is set to the occupied state and the candidate grid corresponding to the current grid is added to the grid queue until the preset stop traversal condition is met.
[0075] The first direction can be from left to right, and the candidate grid is a grid that is idle above or below the current grid and outside the preset boundary. The stopping traversal condition is that the next grid after the current grid is occupied and / or on the preset boundary.
[0076] Please see Figure 8 , Figure 8 This is a schematic diagram illustrating a grid traversal method provided in an embodiment of this application. For example... Figure 8 As shown, during the first round of grid traversal, we can start from grid A and traverse the grids outside the preset boundary from left to right. When the current grid is grid A, it can be set to occupied state. At this time, the grids above grid A are also occupied and are not candidate grids of grid A. Grid G below grid A is idle and outside the preset boundary, so it is a candidate grid of grid A and can be added to the grid queue. Then, we traverse the grids after grid A in sequence. When we reach grid H, we set grid H to occupied state and add the idle grid M below grid H to the grid queue. Since the grid after grid H is occupied, the stop traversal condition is met, and the current round of grid traversal ends.
[0077] Step S1033: Pop grids from the grid queue one by one, determine the popped grid as the starting grid for traversal, return to execute the steps of traversing the grids outside the preset boundary in the first direction starting from the starting grid, setting the current grid to the occupied state and adding the candidate grid corresponding to the current grid to the grid queue, until the traversal stop condition is met.
[0078] For example, such as Figure 8As shown, during the second round of grid traversal, grid G can be popped from the grid queue and designated as the starting traversal grid. The process then returns to traversing the grids outside the preset boundary in the first direction, starting from the starting grid. This involves setting the currently traversed grid to an occupied state and adding the corresponding candidate grid to the grid queue, until the traversal stop condition is met. For example, when traversing to grid G, grid A above G is occupied and not a candidate grid for G, while the grid below G is idle and outside the preset boundary, making it a candidate grid for G. Therefore, the grid below G can be added to the grid queue. Since the next grid after G is on the preset boundary, the traversal stop condition is met, and the current round of grid traversal ends.
[0079] Step S1034: When the grid queue pops out of the stack and finishes traversing the grid, set the grid that was finished traversing to the occupied state and stop the traversal operation.
[0080] For example, when the grid queue pops a grid and finishes traversing a grid, the grid to be traversed is set to the occupied state, and the traversal operation stops. For instance, as shown... Figure 8 As shown, when grid B is popped from the grid queue, grid B is set to occupied state, and the traversal operation is stopped.
[0081] In the above embodiment, by using a water-splashing algorithm, grids in the grid queue are popped sequentially, and starting from the popped grids, the grids outside the preset boundary are traversed in the first direction. The current grid encountered is set to an occupied state, and the candidate grids corresponding to the current grid are added to the grid queue. This can achieve the goal of setting grids outside the preset boundary in the grid map to an occupied state.
[0082] It should be noted that in this embodiment of the application, after traversing the grid outside the preset boundary based on the water splashing algorithm, the grids outside the preset boundary may not be traversed because there is a narrow opening in the preset boundary. As a result, the grids that should be set to the occupied state outside the preset boundary are not set to the occupied state. Therefore, it is necessary to set these grids as the starting grids and re-execute the water splashing algorithm to set these grids to the occupied state.
[0083] In some embodiments, when the grid queue pops out of the stack and finishes traversing the grid, after setting the grid to be occupied, the process may further include: traversing the grid map to determine if there are any missing grids, where a missing grid is a grid that is in an idle state and outside a preset boundary; if there are missing grids in the grid map, then the missing grid is determined as the starting grid for traversal and added to the grid queue; returning to the previous step of popping the starting grid from the grid queue, traversing the grids outside the preset boundary in a first direction starting from the starting grid, setting the current grid encountered to an occupied state and adding the candidate grid corresponding to the current grid to the grid queue, until the stop traversal condition is met, until there are no missing grids in the grid map.
[0084] For example, the raster map can be traversed to identify rasters that are idle and outside a preset boundary as missing rasters.
[0085] Please see Figure 9 , Figure 9 This is a schematic diagram of another raster map provided in an embodiment of this application. For example... Figure 9 As shown, if grid O is idle and outside the preset boundary, it can be identified as a missing grid. Then, grid O is designated as the starting grid for traversal and added to the grid queue. Grid O is popped from the queue, and traversal begins from grid O, proceeding in the first direction to traverse the grids outside the preset boundary. The currently traversed grid is set to an occupied state, and the corresponding candidate grid is added to the grid queue, until the traversal stops. The traversal operation stops when no missing grids are found in the grid map. The specific process of traversing the grids can be found in the detailed description of the above embodiment, and is not limited here.
[0086] In the above embodiment, when it is determined that there are missing grids in the grid map, the missing grid is identified as the starting grid for traversal and added to the grid queue. The grids outside the preset boundary are traversed again from the starting grid in the first direction until there are no missing grids in the grid map. This ensures that all grids outside the preset boundary in the grid map are set to the occupied state.
[0087] Step S104: Determine the work area based on the preset boundary and the remaining idle grid cells.
[0088] For example, after traversing the grid outside the preset boundary according to the target grid to set all grids outside the preset boundary to an occupied state, the work area is determined according to the preset boundary and the remaining grids in an idle state.
[0089] In some embodiments, determining the work area based on a preset boundary and the remaining idle grid cells may include: determining the work area based on the area enclosed by the preset boundary and the remaining idle grid cells.
[0090] Please see Figure 10 , Figure 10 This is a schematic diagram of another raster map provided in an embodiment of this application. For example... Figure 10 As shown, the area enclosed by the preset boundary and the remaining idle grid cells can be defined as the work area.
[0091] The above embodiments, by marking the preset boundaries recorded on the grid map, determine the target grids occupied by the preset boundaries on the grid map, set all grids outside the preset boundaries to an occupied state, and determine the work area based on the preset boundaries and the remaining idle grids, can realize the automatic determination of the work area based on the state of each grid in the grid map. This solves the problem of low efficiency in related technologies that use physical boundary lines to determine the work area of self-moving equipment, and does not require manual intervention, which can effectively improve the efficiency of determining the work area of self-moving equipment.
[0092] The embodiments of this application also provide a computer-readable storage medium storing a computer program, which includes program instructions. A processor executes the program instructions to implement any of the working area determination methods provided in the embodiments of this application.
[0093] For example, when the program is loaded by the processor, it can perform the following steps:
[0094] Obtain a grid map, which includes multiple grids, each set to an idle state; mark the preset boundaries recorded on the grid map to determine the target grids occupied by the preset boundaries on the grid map; based on the target grids, traverse the grids outside the preset boundaries to set all grids outside the preset boundaries to an occupied state; determine the work area based on the preset boundaries and the remaining idle grids.
[0095] The computer-readable storage medium can be an internal storage unit of the computer device described in the foregoing embodiments, such as a hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD card), flash card, etc., provided on the computer device.
[0096] Furthermore, a computer-readable storage medium may primarily include a program storage area and a data storage area, wherein the program storage area may store the operating system, programs required for at least one function, etc.; and the data storage area may store data created according to each program, etc.
[0097] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A work area determination method characterized by comprising: The method includes: Obtain a grid map, which includes multiple grids, and each grid is set to an idle state; Mark the preset boundaries recorded on the grid map to determine the target grid occupied by the preset boundaries on the grid map; Set the target grid to an occupied state, and traverse the grids outside the preset boundary according to the target grid, so as to set all the grids outside the preset boundary to an occupied state. The work area is determined based on the preset boundary and the remaining idle grid cells; The step of traversing the grid outside the preset boundary according to the target grid, so as to set all grids outside the preset boundary to an occupied state, includes: Determine the starting and ending traversal grids in the grid map, and add the starting traversal grid to a preset grid queue; Pop the starting traversal grid from the grid queue, start traversing the grids outside the preset boundary in the first direction from the starting traversal grid, set the current traversed grid to the occupied state and add the candidate grid corresponding to the current grid to the grid queue, until the preset stop traversal condition is met. The grids in the grid queue are popped sequentially, and the popped grid is determined as the starting traversal grid. Then, the process is returned to traverse the grids outside the preset boundary in the first direction starting from the starting traversal grid, setting the current traversed grid to the occupied state and adding the candidate grid corresponding to the current grid to the grid queue, until the traversal stop condition is met. When the grid queue pops the grid that has ended its traversal, the grid that has ended its traversal is set to an occupied state, and the traversal operation is stopped.
2. The work area determination method according to claim 1, characterized by, The candidate grid is a grid that is idle above or below the current grid and outside the preset boundary.
3. The work area determination method according to claim 1, characterized by, The stopping traversal condition is that the next grid cell of the current grid cell is in an occupied state and / or a grid cell on the preset boundary.
4. The work area determination method according to claim 1, characterized by, Determining the starting and ending traversal grids in the grid map includes: Set the grid cells closest to the map boundary of the grid map to an occupied state; The first remaining idle grid cell in the grid map that is outside the preset boundary is determined as the starting traversal grid cell, and the last remaining idle grid cell in the grid map that is outside the preset boundary is determined as the ending traversal grid cell.
5. The work area determination method according to claim 1, characterized by, When the grid queue pops the end-of-traversal grid, after setting the end-of-traversal grid to an occupied state, the method further includes: The grid map is traversed to determine if there are any missing grid cells. The missing grid cells are those that are in an idle state and outside the preset boundary. If the grid map contains the missing grid, then the missing grid is determined as the starting traversal grid and added to the grid queue; Return to the execution step of popping the starting traversal grid from the grid queue, traversing the grids outside the preset boundary starting from the starting traversal grid in the first direction, setting the current traversed grid to the occupied state and adding the candidate grid corresponding to the current grid to the grid queue, until the step of stopping traversal is met, until the grid map has no missing grids.
6. The method for determining the work area according to claim 1, characterized in that, The step of determining the work area based on the preset boundary and the remaining idle grid cells includes: The work area is determined based on the preset boundary and the area enclosed by the remaining idle grid cells.
7. A computer device, characterized in that, The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and, in executing the computer program, implement the job area determination method as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the job area determination method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Path planning and navigating method of vacuum cleaning robot, computer device and computer readable storage medium
CN109540155A
Obstacle map creation method and system, robot and readable storage medium
CN112393737A
