Grid map optimization method and device, electronic equipment and computer program product
By identifying and updating the noise in the grid map, the problem of unreasonable middle routes in the robot navigation was solved, and the accuracy and reliability of the map was improved.
Patent Information
- Application Number
- CN202411546284.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-01-28
AI Technical Summary
There is noise in the raster map, which causes problems such as unreasonable routes and inability to move when navigating.
By obtaining the grid map, determine the area to be verified. If the number of raster units in the check area is greater than the threshold, it is determined to be updated in the non -pass raster unit to be updated and updated it to pass.
Eliminate an isolated and non -purse unit in a barrier -free area formed by high anti -anti -obstacles, reducing the noise of the grid map and improving the accuracy of the map.
Smart Images

Figure CN119374577A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of electronic maps, and in particular, relates to a method, device, electronic device and computer program product for optimizing a grid map. Background Art
[0002] In shopping malls, hotels, KTVs and other service places, robots can be used to perform tasks such as welcoming guests, guiding guests, and delivering meals in order to save labor costs. When robots work in these scenarios, they rely on grid maps for navigation and positioning. However, the constructed grid maps often have some noise points, and when robots are used directly, they are prone to problems such as unreasonable routes and inability to move. Summary of the invention
[0003] The embodiments of the present application provide a method, device, electronic device and computer program product for optimizing a grid map, which can solve the problems of noise and insufficient accuracy in grid maps in related technologies.
[0004] A first aspect of an embodiment of the present application provides a method for optimizing a grid map, comprising: obtaining a grid map, the grid map comprising a plurality of grid cells; determining an area to be verified in the grid map; if the number of first grid cells in the area to be verified is greater than a first number threshold, determining a grid cell to be updated in a second grid cell in the area to be verified, wherein the first grid cell is a passable grid cell in the area to be verified, and the second grid cell is an inpassable grid cell in the area to be verified; and updating the grid cell to be updated to a passable grid cell.
[0005] In some embodiments of the first aspect, determining the grid cell to be updated in the second grid cells in the area to be checked includes: traversing all second grid cells in the area to be checked; if the adjacent grid cells of the target grid cell are passable, and the number of passable adjacent grid cells is greater than a second quantity threshold, determining the target grid cell as the grid cell to be updated; if the adjacent grid cells of the target grid cell are passable, and the number of passable adjacent grid cells is less than or equal to the second quantity threshold, determining whether the target grid cell is the grid cell to be updated based on the corner point area of the area to be checked.
[0006] In some embodiments of the first aspect, determining whether the target grid cell is the grid cell to be updated based on the corner point area of the area to be checked includes: if, among the four corner point areas of the area to be checked, there are corner point areas greater than a third quantity threshold that are passable areas, determining that the target grid cell is the grid cell to be updated; if, among the four corner point areas of the area to be checked, there is no corner point area greater than the third quantity threshold that is a passable area, determining that the target grid cell is not the grid cell to be updated.
[0007] In some embodiments of the first aspect, the corner point area includes a corner point grid unit of the area to be checked and adjacent grid units of the corner point grid unit; the grid map optimization method also includes: for any of the corner point areas, if the number of passable grid units in the corner point area is greater than a fourth threshold number, determining that the corner point area is a passable area; if the number of passable grid units in the corner point area is less than or equal to the fourth threshold number, determining that the corner point area is an inaccessible area.
[0008] In some embodiments of the first aspect, determining the area to be verified in the grid map includes: acquiring the size of the robot; determining the area to be verified in the grid map according to the size of the robot; and determining the area to be verified.
[0009] In some embodiments of the first aspect, determining the area to be verified in the grid map based on the size of the robot includes: taking the origin of the grid map as a starting point, and sequentially taking areas with the same size as the robot as the area to be verified.
[0010] In some embodiments of the first aspect, after updating the to-be-updated grid unit to a passable grid unit, the method further includes: performing path planning according to the updated grid map to obtain a target path; and controlling the robot to perform a task according to the target path.
[0011] A second aspect of an embodiment of the present application provides a grid map optimization device, comprising: a map acquisition unit, used to acquire a grid map, the grid map comprising a plurality of grid cells; an area determination unit, used to determine, in the grid map, an area to be verified; a grid cell determination unit, used to determine, if the number of first grid cells in the area to be verified is greater than a first number threshold, a grid cell to be updated in a second grid cell in the area to be verified, wherein the first grid cell is a passable grid cell in the area to be verified, and the second grid cell is an inpassable grid cell in the area to be verified; and a map optimization unit, used to update the grid cell to be updated to a passable grid cell.
[0012] A third aspect of an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned grid map optimization method when executing the computer program.
[0013] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned grid map optimization method are implemented.
[0014] A fifth aspect of an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the steps of the above-mentioned grid map optimization method.
[0015] In an implementation manner of the present application, a grid map is obtained, and an area to be checked is determined in the grid map. If the number of first grid cells in the area to be checked is greater than a first quantity threshold, then in the second grid cells in the area to be checked, grid cells to be updated are determined, and the grid cells to be updated are updated to passable grid cells, wherein the first grid cell is a passable grid cell in the area to be checked, and the second grid cell is an inpassable grid cell in the area to be checked. In this way, isolated inpassable grid cells in the barrier-free area formed due to high reflection or dynamic obstacles when establishing the map can be eliminated, thereby reducing the noise of the grid map and improving the accuracy of the grid map. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0017] Figure 1 It is a schematic diagram of the implementation process of a grid map optimization method provided in an embodiment of the present application;
[0018] Figure 2 It is a schematic diagram of a specific implementation process of determining the area to be checked provided in an embodiment of the present application;
[0019] Figure 3 is a schematic diagram of a grid map provided in an embodiment of the present application;
[0020] Figure 4 is a schematic diagram of the area to be verified provided in an embodiment of the present application;
[0021] Figure 5 is a schematic diagram of a specific implementation process of determining a grid cell to be updated provided in an embodiment of the present application;
[0022] Figure 6 It is a structural schematic diagram of a grid map optimization device provided in an embodiment of the present application;
[0023] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are protected by the present application.
[0025] The robot can construct a grid map that can be used for positioning and navigation based on the Simultaneous Localization and Mapping (SLAM) algorithm. The constructed grid map often has some noise points. When the robot is used directly, problems such as unreasonable routes and inability to move are prone to occur.
[0026] In view of this, the present application proposes a grid map optimization method, which can eliminate isolated inaccessible grid cells existing in barrier-free areas formed by high reflection or dynamic obstacles when building the map, reduce the noise of the grid map, and improve the accuracy of the grid map.
[0027] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.
[0028] Figure 1 The present invention provides a schematic diagram of the implementation process of a grid map optimization method provided in an embodiment of the present invention, which can be applied to electronic devices. The electronic device can be a computer, a smart phone or other intelligent device, or a robot, an unmanned vehicle or other self-driving device that needs navigation, which is not limited by the present invention.
[0029] Specifically, the above-mentioned grid map optimization method may include the following steps S101 to S104.
[0030] Step S101, obtaining a grid map.
[0031] The present application does not limit the method of obtaining the grid map. For example, a robot may scan the environment and construct a grid map based on the scanned environment information; or, for another example, a pre-constructed grid map may be received from an external device.
[0032] The grid map includes multiple grid cells, each of which can represent one or more continuous grids. The above grid cells can be classified into passable grid cells and impassable grid cells according to the environmental information when the map is built, and the impassable grid cells can be further divided into grid cells in obstacle areas and grid cells in unknown areas.
[0033] Specifically, a passable grid cell can be represented in the grid map by a pixel value of 0 (white). A grid cell in an obstacle area can be represented in the grid map by a pixel value of 1 (black). A grid cell in an unknown area can be represented in the grid map by a pixel value of -1 (gray). In addition to representing classification by pixel value, the present application does not exclude other representations of classification, for example, each grid cell can carry a corresponding tag to record the corresponding classification.
[0034] Step S102: Determine the area to be checked in the grid map.
[0035] The area to be checked refers to the grid area that needs to be optimized at present, which may include multiple grid units. The multiple grid units are spliced together to form the area to be checked. The area to be checked may be located at any position in the grid map. For example, the area surrounded by 5*5 grid units in the lower right corner of the grid map may be used as an area to be checked.
[0036] Step S103: if the number of first grid cells in the area to be checked is greater than a first number threshold, then a grid cell to be updated is determined in a second grid cell in the area to be checked.
[0037] The first grid cell is a passable grid cell in the area to be checked. The second grid cell is an inaccessible grid cell in the area to be checked. The grid cell to be updated refers to a grid cell that needs to be updated and optimized.
[0038] In the implementation of the present application, according to the classification representation of the grid cells, the category of each grid cell in the area to be checked can be determined, and then the number of first grid cells in the area to be checked can be determined. Taking the aforementioned classification representation by pixel value as an example, by counting the number of grid cells with value 0 in the area to be checked, the number of first grid cells in the area to be checked can be obtained.
[0039] The first quantity threshold is used to determine whether most of the grid cells in the area to be checked are passable, and its value can be set according to the actual situation. If the number of the first grid cells is greater than the first quantity threshold, it means that most of the grid cells in the area to be checked are passable grid cells. Considering that the passable area in the actual physical environment is usually continuous, that is, the classification between the connected grid cells is usually continuous, it can be considered that the classification of the second grid cell in the area to be checked may be an erroneous classification caused by high reflection or dynamic obstacles when establishing the map. Therefore, the grid cell to be updated can be determined in the second grid cell in the area to be checked.
[0040] Step S104, updating the grid cell to be updated to a passable grid cell.
[0041] In an implementation manner of the present application, by updating the grid cell to be updated to a passable grid cell, for example, changing its pixel value to 0, the erroneous classification of the grid cell to be updated can be corrected, thereby removing isolated noise points in the grid map and optimizing the grid map.
[0042] In an implementation manner of the present application, a grid map is obtained, and an area to be checked is determined in the grid map. If the number of first grid cells in the area to be checked is greater than a first quantity threshold, then in the second grid cells in the area to be checked, grid cells to be updated are determined, and the grid cells to be updated are updated to passable grid cells, wherein the first grid cell is a passable grid cell in the area to be checked, and the second grid cell is an inpassable grid cell in the area to be checked. In this way, isolated inpassable grid cells in the barrier-free area formed due to high reflection or dynamic obstacles when establishing the map can be eliminated, thereby reducing the noise of the grid map and improving the accuracy of the grid map.
[0043] Furthermore, when the classification of grid cells is represented by pixel values, for the entire grid map, isolated black or gray noise points are corrected to white, which can effectively thin the black and gray areas.
[0044] Specifically, Figure 2 As shown, in the grid map, determining the area to be checked may include steps S201 to S202.
[0045] Step S201, obtaining the size of the robot.
[0046] Among them, the size of the robot can be obtained according to the model of the robot, and can also be obtained through visual inspection and other methods, which is not limited in this application.
[0047] Step S202, determining the area to be checked in the grid map according to the size of the robot.
[0048] Specifically, in the grid map, according to the size of the robot, an area of the same size as the size of the robot can be used as a to-be-verified area. Figure 3 As shown, the origin (0,0) of the pixel coordinate system of the grid map is in the lower left corner, and each square grid unit is 0.05m*0.05m. Assuming that the size of the robot is a square of 0.3m*0.3m, that is, it occupies 6 grid units in the x direction and 6 grid units in the y direction, and a total of 36 grid units. At this time, the area formed by the 6*6 grid units in the grid map can be used as a verification area. It can be understood that at this time, the grid unit to be verified can represent the size of a robot, and the grid map can ultimately be applied to the navigation and positioning of the robot. Navigation and positioning are also based on the size of the robot, so that the optimization process of the grid map can be adapted to the navigation and positioning process of the robot.
[0049] In some embodiments of the present application, determining the area to be verified in the grid map according to the size of the robot may include: starting from the origin of the grid map, and sequentially taking areas with the same size as the robot as the area to be verified. Figure 4 In the example, the 6*6 grid cells represented by (0,0) are first used as the area to be checked. After the optimization of the area to be checked is completed, the 6*6 grid cells represented by (0,1) or (1,0) can be used as the area to be checked for further optimization until the optimization of all areas in the grid map is completed.
[0050] Of course, in addition to using an area of the same size as the robot as the area to be verified, the size of the area to be verified may also be other values, such as a pre-set default size, and this application does not impose any limitation on this.
[0051] In some embodiments of the present application, after obtaining the number of the first grid cells in the area to be verified, if the number of the first grid cells is less than or equal to the number threshold, it means that most of the grid cells in the area to be verified are impassable grid cells. At this time, the classification of the second grid cells in the area to be verified can be considered accurate, or there is no need to update them, and the optimization of the area to be verified can be terminated. Specifically, if the area to be verified is the same size as the robot, most of the grid cells in the area to be verified are impassable grid cells. Even if some noise points are updated, the robot cannot pass through the area. Therefore, the second grid cells in the area to be verified can be not updated, which helps save computing power and improve the speed of map optimization.
[0052] If the number of the first grid cells is greater than the first number threshold, the grid cells to be updated may be determined in the second grid cells in the area to be checked, and the grid cells to be updated may be updated.
[0053] Specifically, in some embodiments of the present application, Figure 5 As shown, determining the grid cells to be updated in the second grid cells in the area to be checked may include steps S501 to S504.
[0054] Step S501, traverse all second grid cells in the area to be checked.
[0055] Specifically, each second grid cell in the area to be checked may be analyzed in turn as a target grid cell.
[0056] Step S502: If the adjacent grid cells of the target grid cell are passable, and the number of the passable adjacent grid cells is greater than a second number threshold, the target grid cell is determined as a grid cell to be updated.
[0057] Specifically, each second grid cell that is not passable is taken as a target grid cell, denoted as p(x,y,value), where x represents the coordinate value in the x direction, y represents the coordinate value in the y direction, and value represents the pixel value of the grid cell with coordinates (x,y). According to the coordinates of the target grid cell p, the classification of its adjacent grid cells can be determined, and the adjacent grid cells can be adjacent to the target grid cell in the x direction, y direction, or oblique direction.
[0058] For a non-edge target grid cell p of the grid map, the number of its adjacent grid cells can be 4 (i.e., adjacent in the x direction or y direction) or 8 (adjacent in the x direction, y direction, or oblique direction). Preferably, selecting 8 adjacent grid cells for analysis helps improve the accuracy of optimization.
[0059] The second quantity threshold is used to determine whether most of the grid cells around the target grid cell are passable, and the specific value can be set according to the actual situation. If the number of passable adjacent grid cells is greater than the second quantity threshold, it means that most of the grid cells around the target grid cell are passable. Since the classification between the connected grid cells is usually continuous, it can be considered that the classification of the target grid cell is an erroneous classification due to high reflection or dynamic obstacles when building the map, and the target grid cell is determined as a grid cell to be updated.
[0060] For example, if the number of pixel values of 0 in the adjacent grid cells of the target grid cell p is greater than 5 (the second number threshold), the pixel value of the target grid cell p is modified to 0.
[0061] Step S503 , if the adjacent grid cells of the target grid cell are passable and the number of the passable adjacent grid cells is less than or equal to the second number threshold, determine whether the target grid cell is a grid cell to be updated according to the corner point area of the area to be checked.
[0062] In the implementation of the present application, if the adjacent grid cells of the target grid cell are passable, and the number of passable adjacent grid cells is less than or equal to the second number threshold, it means that there are fewer passable grid cells around the target grid cell. At this time, the corner point area of the area to be checked can be considered to determine whether the target grid cell is a grid cell to be updated. Among them, the number of corner point areas is four, each corner point area can include a corner point grid cell of the area to be checked, and can also include a corner point grid cell of the area to be checked and the adjacent grid cells of the corner point grid cell.
[0063] Specifically, determining whether the target grid cell is a grid cell to be updated according to the corner point area of the area to be checked may include: if, among the four corner point areas of the area to be checked, there are corner point areas greater than a third quantity threshold that are passable areas, then determining that the target grid cell is a grid cell to be updated. If, among the four corner point areas of the area to be checked, there is no corner point area greater than the third quantity threshold that is a passable area, then determining that the target grid cell is not a grid cell to be updated.
[0064] Among them, whether the corner point area is a passable area can be determined according to the classification of the grid cells in the corner point area. Specifically, in some embodiments of the present application, for any corner point area, if the number of passable grid cells in the corner point area is greater than a fourth threshold number, the corner point area is determined to be a passable area; if the number of passable grid cells in the corner point area is less than or equal to the fourth threshold number, the corner point area is determined to be an inaccessible area.
[0065] The third quantity threshold and the fourth quantity threshold can be set according to actual conditions.
[0066] If the number of passable corner point areas is greater than the third quantity threshold, it means that the edges of the area to be checked are mostly passable, and the grid cells inside are also likely to be passable, then the target grid cell can be determined as the grid cell to be updated, so as to optimize the target grid cell. If the number of passable corner point areas is less than or equal to the third quantity threshold, it means that the edges of the area to be checked are mostly impassable, and the grid cells inside are also likely to be impassable, then the classification of the target grid cell can be retained.
[0067] For example, if the number of pixel values of 0 in the adjacent grid cells of the target grid cell p is less than or equal to 5 (the second quantity threshold), the target grid cell p is stored in the set B. The corner point areas of the four corners in the area to be checked are recorded as A11, A12, A13 and A14. If the number of passable corner point areas (white areas) in these four corner point areas is greater than 2 (the third quantity threshold), all target grid cells p in the set B are used as grid cells to be updated to change their pixel values to 0. If the number of passable corner point areas (white areas) in these four corner point areas is less than or equal to 2 (the third quantity threshold), the classification of all target grid cells p in the set B is retained.
[0068] Using the four corner point areas as the standard, continuous non-white areas can be removed without mistakenly removing obstacle areas.
[0069] Step S504: If the adjacent grid cells of the target grid cell are all impassable, it is determined that the target grid cell is not the grid cell to be updated.
[0070] That is to say, if the adjacent grid cells of the target grid cell are all impassable, it means that there are no impassable grid cells around the target grid cell, and the area formed by the target grid cell and its surrounding grid cells should be an obstacle area. Therefore, it can be determined that the target grid cell is not the grid cell to be updated, so as to avoid erroneously updating the target grid cell to a impassable grid cell.
[0071] In some embodiments of the present application, after the grid unit to be updated is updated to a passable grid unit, path planning can be performed based on the updated grid map to obtain a target path, and the robot can be controlled to perform the task based on the target path.
[0072] Specifically, according to the current location of the robot and the target location of the received task, path planning can be performed in the updated grid map to obtain the target path to the target location. According to the target path, the robot can be controlled to go to the target location to perform the task. The tasks include but are not limited to: welcoming guests, delivering meals, and guiding. In this way, the optimized grid map can be used to navigate and locate the robot, making the process of the robot performing the task more reliable.
[0073] It should be noted that, for the sake of simplicity of description, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the described order of actions, because according to the present application, certain steps can be performed in other orders.
[0074] like Figure 6FIG. 6 is a schematic diagram of the structure of a grid map optimization device 600 provided in an embodiment of the present application. The grid map optimization device 600 is configured on an electronic device.
[0075] Specifically, the grid map optimization device 600 may include:
[0076] A map acquisition unit 601 is used to acquire a grid map, where the grid map includes a plurality of grid units;
[0077] An area determination unit 602 is used to determine an area to be checked in the grid map;
[0078] The grid unit determination unit 603 is used to determine the grid unit to be updated in the second grid unit in the area to be checked if the number of the first grid units in the area to be checked is greater than the first number threshold, wherein the first grid unit is a passable grid unit in the area to be checked, and the second grid unit is an inpassable grid unit in the area to be checked;
[0079] The map optimization unit 604 is used to update the grid cells to be updated into passable grid cells.
[0080] In some embodiments of the present application, the grid cell determination unit 603 can be specifically used to: traverse all second grid cells in the area to be checked; if the adjacent grid cells of the target grid cell are passable, and the number of passable adjacent grid cells is greater than the second quantity threshold, then the target grid cell is determined as the grid cell to be updated; if the adjacent grid cells of the target grid cell are passable, and the number of passable adjacent grid cells is less than or equal to the second quantity threshold, then determine whether the target grid cell is the grid cell to be updated based on the corner point area of the area to be checked; if the adjacent grid cells of the target grid cell are all impassable, it is determined that the target grid cell is not the grid cell to be updated.
[0081] In some embodiments of the present application, the grid cell determination unit 603 can be specifically used to: if, among the four corner point areas of the area to be checked, there are corner point areas greater than a third quantity threshold that are passable areas, then determine that the target grid cell is the grid cell to be updated; if, among the four corner point areas of the area to be checked, there is no corner point area greater than the third quantity threshold that is a passable area, then determine that the target grid cell is not the grid cell to be updated.
[0082] In some embodiments of the present application, each of the corner point areas includes a corner point grid unit of the area to be checked and adjacent grid units of the corner point grid unit; the grid unit determination unit 603 can be specifically used to: for any of the corner point areas, if the number of passable grid units in the corner point area is greater than a fourth threshold number, then the corner point area is determined to be a passable area; if the number of passable grid units in the corner point area is less than or equal to the fourth threshold number, then the corner point area is determined to be an inaccessible area.
[0083] In some implementations of the present application, the area determination unit 602 may be specifically used to: obtain the size of the robot; and determine the area to be verified in the grid map according to the size of the robot.
[0084] In some embodiments of the present application, the area determination unit 602 may be specifically configured to: take the origin of the grid map as a starting point, and sequentially select areas having the same size as that of the robot as the areas to be verified.
[0085] In some embodiments of the present application, the grid map optimization device 600 may further include a control unit, which is used to: perform path planning according to the updated grid map to obtain a target path; and control the robot to perform a task according to the target path.
[0086] It should be noted that, for the convenience and simplicity of description, the specific working process of the above-mentioned grid map optimization device 600 can be referred to Figures 1 to 5 The corresponding process of the method will not be repeated here.
[0087] like Figure 7 , which is a schematic diagram of an electronic device provided in an embodiment of the present application. Specifically, the electronic device 7 may include: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70, such as a grid map optimization program. When the processor 70 executes the computer program 72, the steps in the above-mentioned grid map optimization method embodiments are implemented, such as Figure 1 Alternatively, when the processor 70 executes the computer program 72, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 6 The functions of the map acquisition unit 601, the area determination unit 602, the grid unit determination unit 603 and the map optimization unit 604 are shown.
[0088] The computer program may be divided into one or more modules / units, which are stored in the memory 71 and executed by the processor 70 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the electronic device.
[0089] For example, the computer program can be divided into: a map acquisition unit, an area determination unit, a grid unit determination unit, and a map optimization unit. The specific functions of each unit are as follows: a map acquisition unit, used to acquire a grid map, the grid map includes a plurality of grid units; a region determination unit, used to determine the area to be verified in the grid map; a grid unit determination unit, used to determine the grid unit to be updated in the second grid unit in the area to be verified if the number of the first grid units in the area to be verified is greater than a first number threshold, wherein the first grid unit is a passable grid unit in the area to be verified, and the second grid unit is an inpassable grid unit in the area to be verified; a map optimization unit, used to update the grid unit to be updated to a passable grid unit.
[0090] The electronic device may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will appreciate that Figure 7 These are merely examples of electronic devices and do not constitute a limitation of the electronic device. The electronic device may include more or fewer components than those shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0091] The processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), off-the-shelf programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0092] The memory 71 may be an internal storage unit of the electronic device, such as a hard disk or memory of the electronic device. The memory 71 may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Furthermore, the memory 71 may also include both an internal storage unit of the electronic device and an external storage device. The memory 71 is used to store the computer program and other programs and data required by the electronic device. The memory 71 may also be used to temporarily store data that has been output or is to be output.
[0093] It should be noted that, for the convenience and brevity of description, the structure of the above electronic device can also refer to the specific description of the structure in the method embodiment, which will not be repeated here.
[0094] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0095] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0096] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0097] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0098] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0099] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0100] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0101] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for optimizing a grid map, characterized in that: include: Acquire a grid map, wherein the grid map includes a plurality of grid units; In the grid map, determining an area to be verified; If the number of first grid cells in the area to be checked is greater than a first number threshold, then a grid cell to be updated is determined in a second grid cell in the area to be checked, wherein the first grid cell is a passable grid cell in the area to be checked, and the second grid cell is an inpassable grid cell in the area to be checked; The grid cell to be updated is updated to a passable grid cell.
2. The method for optimizing a grid map according to claim 1, wherein: Determining the grid cell to be updated in the second grid cell in the area to be checked includes: Traversing all second grid cells in the area to be checked; If the adjacent grid cells of the target grid cell are passable, and the number of the passable adjacent grid cells is greater than the second number threshold, the target grid cell is determined as the grid cell to be updated; If the adjacent grid cells of the target grid cell are passable, and the number of passable adjacent grid cells is less than or equal to the second quantity threshold, it is determined whether the target grid cell is the grid cell to be updated according to the corner point area of the area to be checked.
3. The method for optimizing a grid map according to claim 2, wherein: The step of determining whether the target grid cell is the grid cell to be updated according to the corner point area of the area to be verified comprises: If, among the four corner point areas of the area to be checked, there is a corner point area with a number greater than a third quantity threshold that is a passable area, determining the target grid cell as the grid cell to be updated; If, among the four corner point areas of the area to be checked, there is no corner point area with a number greater than a third quantity threshold that is a passable area, it is determined that the target grid cell is not the grid cell to be updated.
4. The method for optimizing a grid map according to claim 3, wherein: The corner point area includes a corner point grid unit of the area to be checked and adjacent grid units of the corner point grid unit; The grid map optimization method further includes: For any of the corner point regions, if the number of passable grid cells in the corner point region is greater than a fourth threshold number, the corner point region is determined to be a passable region; If the number of passable grid cells in the corner point area is less than or equal to a fourth threshold number, the corner point area is determined to be an inaccessible area.
5. The method for optimizing a grid map according to claim 1, wherein: Determining the area to be checked in the grid map includes: Get the size of the robot; The area to be checked is determined in the grid map according to the size of the robot.
6. The method for optimizing a grid map according to claim 5, wherein: Determining the area to be checked in the grid map according to the size of the robot includes: Taking the origin of the grid map as the starting point, areas with the same size as the robot are taken as the areas to be checked in sequence.
7. The method for optimizing a grid map according to any one of claims 1 to 6, characterized in that: After the to-be-updated grid cell is updated to a passable grid cell, the method further includes: According to the updated grid map, path planning is performed to obtain the target path; According to the target path, the robot is controlled to perform the task.
8. A grid map optimization device, characterized in that: include: A map acquisition unit, used to acquire a grid map, wherein the grid map includes a plurality of grid units; An area determination unit, used to determine an area to be checked in the grid map; A grid unit determination unit, configured to determine a grid unit to be updated in a second grid unit in the area to be checked if the number of first grid units in the area to be checked is greater than a first number threshold, wherein the first grid unit is a passable grid unit in the area to be checked, and the second grid unit is an inpassable grid unit in the area to be checked; The map optimization unit is used to update the grid cells to be updated into passable grid cells.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the grid map optimization method according to any one of claims 1 to 7 are implemented.
10. A computer program product, characterized in that The invention comprises a computer program, which, when being executed, enables the method for optimizing the grid map according to any one of claims 1 to 7 to be executed.