Robot mapping optimization method based on room area, chip and robot
By obtaining the room area from the robot mapping results, setting a preset threshold, and using different optimization methods, such as row-by-row and column-by-column scanning and projection analysis, the problem of erroneous room merging in robot mapping was solved, improving the accuracy and reliability of mapping.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AMICRO SEMICONDUCTOR CO LTD
- Filing Date
- 2022-06-02
- Publication Date
- 2026-05-05
AI Technical Summary
The presence of translucent objects such as glass and plastic, or mirrored objects, in robot mapping leads to large errors in the environmental information perceived by environmental sensors, resulting in chaotic room divisions and even situations where more than one room is merged into one room. Existing technologies are difficult to optimize effectively.
By obtaining the room area from the robot's mapping results, setting a preset area threshold, and determining different mapping optimization methods based on the room area, including row-by-row and column-by-column scanning, edge scanning, and projection analysis, the mapping results of the room are optimized in a targeted manner to ensure the integrity of the room.
This improved the reliability of the robot's mapping results, avoided erroneous room merging, and enhanced the accuracy and completeness of the mapping.
Smart Images

Figure CN117218178B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robot mapping technology, specifically to a robot mapping optimization method based on room area, a chip, and a robot. Background Technology
[0002] Currently, the presence of translucent objects such as glass and plastic, or mirrored surfaces, in the robot's working environment can easily lead to significant errors in the environmental information perceived by environmental sensors. This results in chaotic room divisions in the robot's mapping results, and even situations where multiple rooms are merged into one. When multiple rooms are merged into one in the mapping results, there may be instances where incomplete and complete rooms are combined together. How to better optimize the robot's mapping results in this situation remains to be solved. Summary of the Invention
[0003] To address the aforementioned problems, this invention provides a robot mapping optimization method, chip, and robot based on room area. By optimizing the mapping results through the selection of methods based on room area in the robot mapping results, it can specifically solve the optimization problem of mapping results where multiple rooms are merged into one, thereby improving the reliability of robot mapping results. The specific technical solution of this invention is as follows:
[0004] The robot mapping optimization method based on room area includes: obtaining all rooms in the robot mapping result; traversing and calculating the area of each room, and determining whether the area of the room is greater than a preset area threshold. If the area of the room is greater than the preset area threshold, the room is optimized using the first mapping optimization method; if the area of the room is less than or equal to the preset area threshold, the room is optimized using the second mapping optimization method.
[0005] Furthermore, the optimization of the room using the first mapping optimization method specifically includes: performing line scanning of the room row by row and column by column, determining whether the gray value of each pixel is less than a preset gray value; if so, deleting the pixel; if not, retaining the pixel, until the gray values of all pixels in the room have been scanned and determined, thus completing the room optimization.
[0006] Furthermore, the optimization of the room using the second mapping optimization method specifically includes: scanning the edges of the room, calculating the total edge length and unknown edge length of the room, and determining whether to delete the room from the mapping result based on the ratio of the unknown edge length to the total edge length of the room.
[0007] Furthermore, determining whether to delete a room from the mapping result based on the ratio of the unknown edge length of the room to its total edge length specifically includes: if the ratio of the unknown edge length of the room to its total edge length is greater than a first threshold, then the room is deleted from the mapping result.
[0008] Furthermore, the step of determining whether to delete a room from the mapping result based on the ratio of the unknown edge length of the room to its total edge length also includes: if the ratio of the unknown edge length of the room to its total edge length is less than a second threshold, then the room is retained in the mapping result; wherein the second threshold is less than the first threshold.
[0009] Furthermore, the step of determining whether to delete a room from the mapping result based on the ratio of the unknown edge length of the room to its total edge length also includes: if the ratio of the unknown edge length of the room to its total edge length is less than or equal to a first threshold and greater than or equal to a second threshold, then the room is optimized using a third mapping optimization method.
[0010] Furthermore, the optimization of the room using the third mapping optimization method specifically includes: performing horizontal and vertical projections on the room, and determining whether to delete the room from the mapping result based on the resulting shape of the horizontal and vertical projections.
[0011] Furthermore, determining whether to delete a room from the mapping result based on the resulting shape of the horizontal projection and the resulting shape of the vertical projection of the room specifically includes: if at least one of the resulting shapes of the horizontal projection or the vertical projection of the room satisfies the shape of a triangle or a trapezoid, then the room is deleted from the mapping result.
[0012] The present invention also discloses a robot mapping optimization method, comprising: obtaining all rooms in the robot mapping result; obtaining the area of each room; selecting the room with the largest area from all rooms; optimizing the room with the largest area using a first mapping optimization method; and optimizing the rooms that are not the largest in area using a second mapping optimization method.
[0013] Furthermore, the optimization of the room with the largest area using the first mapping optimization method specifically includes: performing line scanning of the room with the largest area row by row and column by column, determining whether the gray value of each pixel is less than a preset gray value, if so, deleting the pixel, if not, retaining the pixel, until the gray value of all pixels in the room with the largest area has been scanned and determined, thus completing the optimization of the room with the largest area.
[0014] Further, the optimization of non-largest rooms using the second mapping optimization method specifically includes: scanning the edges of each non-largest room, calculating the total edge length and unknown edge length of each non-largest room; calculating the ratio of the unknown edge length to the total edge length of each non-largest room; determining the relationship between the ratio of the unknown edge length to the total edge length of each non-largest room and a first threshold and a second threshold; if the ratio of the unknown edge length to the total edge length of a non-largest room is greater than the first threshold, then the non-largest room is deleted from the mapping result, completing the optimization of the non-largest room; if the ratio of the unknown edge length to the total edge length of a non-largest room is less than or equal to the first threshold and greater than or equal to the second threshold, then the non-largest room is optimized using the third mapping optimization method; if the ratio of the unknown edge length to the total edge length of a non-largest room is less than the second threshold, then the non-largest room is retained in the mapping result, completing the optimization of the non-largest room; wherein, the second threshold is less than the first threshold.
[0015] Furthermore, the optimization of the non-largest room using the third mapping optimization method specifically includes: performing horizontal and vertical projections on the non-largest room; determining whether the resulting shape of the horizontal projection or the resulting shape of the vertical projection of the non-largest room satisfies at least one triangular or trapezoidal shape; if satisfied, deleting the non-largest room from the mapping result to complete the optimization of the non-largest room; if not satisfied, retaining the non-largest room in the mapping result to complete the optimization of the non-largest room.
[0016] The present invention also discloses a chip that stores a computer program inside. When the computer program stored inside the chip is run by a processor, it executes the robot mapping optimization method based on room area as described above, or executes the robot mapping optimization method as described above.
[0017] The present invention also discloses a robot, specifically comprising: an environmental perception sensor for acquiring data of the robot's surrounding environment; a mapping module for generating robot mapping results based on the environmental data acquired by the environmental perception sensor; a chip as described above, internally storing a computer program, wherein the computer program is executed by a processor to perform the robot mapping optimization method based on room area as described above, or to perform the robot mapping optimization method as described above; and a processor for running the computer program stored internally in the chip.
[0018] The beneficial effects of this invention are as follows: Based on the comparison results of the area of all rooms in the robot mapping results with the preset area threshold, the type of mapping optimization method used for each room is determined in a targeted manner, thereby realizing targeted optimization of each room in the robot mapping results and improving the optimization effect of the robot mapping results. At the same time, by setting the preset area threshold, the problem of more than one actual room being mistakenly merged into one room in the mapping results is effectively solved, thereby improving the reliability of the robot mapping results. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating a robot mapping optimization method based on room area according to an embodiment of the present invention.
[0020] Figure 2 This is a schematic diagram of the process of using a first mapping optimization method for a room according to an embodiment of the present invention.
[0021] Figure 3 This is a schematic diagram of the process of using a second mapping optimization method for a room according to an embodiment of the present invention.
[0022] Figure 4 This is a schematic diagram of the process of using a third mapping optimization method for rooms according to an embodiment of the present invention.
[0023] Figure 5 This is a schematic flowchart of a robot mapping optimization method according to an embodiment of the present invention.
[0024] Figure 6 This is a schematic diagram of the process of using a second mapping optimization method for rooms that are not the largest in area, according to one embodiment of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this application clearer, the application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.
[0026] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may represent singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion, for example: a process, method, system, product, or apparatus that includes a series of steps or modules is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to such processes, methods, products, or apparatus.
[0027] Currently, the presence of translucent objects such as glass and plastic, or mirrored objects, in the working environment of robots can easily lead to large errors in the environmental information perceived by environmental sensors. This results in chaotic room divisions in the robot's mapping results, and even situations where more than one room is merged into one. When more than one room is merged into one, there may be cases where incomplete and complete rooms are combined together. To address this, directly deleting large areas of rooms can easily result in the deletion of both complete and incomplete rooms. This application provides a technical solution to this problem in the following embodiments. It should be noted that the environmental sensors mentioned in this invention can be, but are not limited to, sensors with environmental data information perception functions such as laser sensors or infrared sensors. Furthermore, the robot mentioned in this invention can be, but is not limited to, an intelligent mobile robot that acquires environmental data information based on environmental sensors, such as an intelligent mobile robot that maps based on environmental information acquired by a laser sensor or an intelligent mobile robot that maps based on environmental information acquired by an infrared sensor. The intelligent mobile robot can be, but is not limited to, a sweeping robot, a mopping robot, a sweeping and mopping robot, a lawnmower robot, a patrol robot, or an air-purifying robot.
[0028] As a preferred embodiment of the present invention, the first embodiment provides a robot mapping optimization method based on room area, such as... Figure 1 As shown, the process of this robot mapping optimization method based on room area includes:
[0029] Step 1: Obtain all rooms in the robot mapping result, proceed to Step 2; Specifically, the method of obtaining all rooms in the robot mapping result may be, but is not limited to, scanning and recognizing the robot mapping result to determine the edge of each room, thereby determining all rooms in the robot mapping result, or directly obtaining the marked room information in the robot mapping result, thereby obtaining all rooms in the robot mapping result.
[0030] Step 2: Calculate the area of each room, then proceed to Step 3; specifically, the area of each room can be calculated using, but is not limited to, a polygon area calculation method. This polygon area calculation method can be based on, but is not limited to, the coordinates of each vertex of the room. For example, if the coordinates of each vertex of the room specifically include: A(x1,y1), B(x2,y2)......N(x... n ,y n If the area of a room is 1, then the formula for calculating the room area is: Where, x n+1 =x1,y n+1 =y1. It should be noted that the method of calculating the area in this step differs depending on the setting of the preset area threshold. If the preset area threshold is set based on the room area ratio in the mapping result, the room area can be directly calculated from the coordinates of each vertex in the mapping result. Conversely, if the preset area threshold is set based on the room area in the actual environment, the room area calculated from the coordinates of each vertex needs to be proportionally converted according to the size ratio between the actual environment and the mapping result. For example, if the size ratio between the actual environment and the mapping result is 1000:1, 100:1, 10:1, 5:1, or 2:1, then the room area calculated from the coordinates of each vertex needs to be enlarged by a factor of 1000 squared, 100 squared, 10 squared, 5 squared, or 2 squared before being compared with the preset area threshold mentioned in step 4.
[0031] Step 3: Determine if there are any unoptimized rooms among all rooms. If yes, proceed to Step 4; otherwise, end the optimization of the robot mapping results. Specifically, in some embodiments, whether each room has been optimized can be identified by the optimization identifier in its room information. If a room has not been optimized, the optimization identifier in its room information is "unoptimized"; if a room has been optimized, the optimization identifier in its room information is "optimized". The determination in Step 3 only requires filtering the optimization identifier in the room information of each room to obtain the conclusion of whether there are any unoptimized rooms.
[0032] Step 4: Select an unoptimized room and determine if its area is greater than a preset area threshold. If the room area is greater than the preset area threshold, proceed to Step 5; if the room area is less than or equal to the preset area threshold, proceed to Step 6. Specifically, the preset area threshold refers to a pre-set area threshold used to identify whether more than one room has been merged into one room. In some embodiments, the preset area threshold may be set based on, but is not limited to, the largest room area in the robot's target working environment, or set by the user according to their requirements for the robot's room division effect, or set based on the empirical value of the largest room area that optimizes the robot's room division effect. The preset area threshold set based on the largest room area in the robot's target working environment may be set according to the actual area of the largest room in the robot's target working environment, or it may be set according to the area of the largest room in the robot's target working environment converted to the mapping result size. Similarly, the preset area threshold set by the user according to their requirements for the robot's room division effect may be set to the actual environmental area requirement corresponding to the robot's room division effect, or it may be set to the room area requirement in the mapping result corresponding to the robot's room division effect. Specifically, in some embodiments, the method of selecting an unoptimized room may be, but is not limited to, selecting the largest unoptimized room from all unoptimized rooms according to room size, or selecting the smallest unoptimized room; in other embodiments, the method of selecting an unoptimized room may also be, but is not limited to, selecting the unoptimized room closest to the previous optimized room from all unoptimized rooms, or selecting the unoptimized room that is not adjacent to the previous optimized room from all unoptimized rooms, or selecting the unoptimized room farthest from the previous optimized room from all unoptimized rooms, or randomly selecting an unoptimized room from all unoptimized rooms.
[0033] Step 5: Optimize the room using the first mapping optimization method. After optimizing the room, return to step 3. Specifically, the first mapping optimization method is a special optimization method for rooms where multiple rooms may be divided into one room in the mapping result. It is a mapping optimization method that does not directly delete rooms but only corrects them. In some embodiments, the first mapping optimization method may be, but is not limited to, a method for correcting the edges of rooms, or a method for optimizing rooms by comparing and deleting pixels one by one.
[0034] Step 6: Optimize the room using the second mapping optimization method. After optimizing the room, return to Step 3. Specifically, the second mapping optimization method is a special optimization method for rooms in the mapping results where it is unlikely that multiple rooms will be divided into one room. The second mapping optimization method may be, but is not limited to, a mapping optimization method that directly deletes rooms that do not meet certain conditions from the mapping results through filtering based on certain conditions.
[0035] This embodiment sets a preset area threshold and compares the area of each room in the mapping result with the preset area threshold. It selects an optimization method for each room based on the probability that each room is multiple rooms combined into one, thus achieving targeted optimization for each room. Specifically, it filters out rooms that are more likely to be multiple rooms combined into one, and for these rooms, a specially designed first mapping optimization method is used for optimization. This method performs detailed optimization without deleting the rooms, avoiding the deletion of complete rooms. Simultaneously, for rooms that are less likely to be multiple rooms combined into one, a specially designed second mapping optimization method is used. This method filters out rooms that do not meet certain conditions and deletes them from the mapping result. By specifically determining the type of mapping optimization method used for each room, it achieves more appropriate optimization of each room in the robot mapping result, improving the optimization effectiveness of the robot mapping result.
[0036] Based on the first embodiment described above, as a preferred embodiment of the present invention, in the second embodiment, the first mapping optimization method is configured as a method for optimizing a room by comparing and eliminating pixels one by one. Therefore, step 5: optimizing the room using the first mapping optimization method, as follows... Figure 2 As shown, it specifically includes:
[0037] The room is scanned row by row and column by column, meaning each pixel in the room is scanned and its grayscale value is acquired. It is then determined whether the grayscale value of the currently scanned pixel is less than a preset grayscale value. This preset grayscale value is a pre-set grayscale threshold used to compare with the pixel's grayscale value to determine if the pixel affects the integrity of the room. This preset grayscale value is an empirical value determined by the inventors through repeated experiments and is closely related to the type of environmental perception sensor used by the robot and its application environment. If the pixel's grayscale value is less than the preset grayscale value, the pixel is deleted; conversely, if the pixel's grayscale value is greater than or equal to the preset grayscale value, the pixel is retained. This process continues until all pixel grayscale values in the room have been scanned and determined, thus completing the room's optimization.
[0038] This embodiment uses the comparison result of a pixel's grayscale value with a preset grayscale value as a method to determine whether the pixel is an incomplete part of the room. Pixels with a grayscale value less than the preset grayscale value are regarded as incomplete parts of the room. Based on this, the room is scanned row by row and column by column, and the comparison result of the grayscale value of each pixel in the room with the preset grayscale value is judged to remove incomplete parts of the room. This achieves the goal of retaining the complete parts of the large room and removing the incomplete parts of the large room when multiple rooms are merged into one large room.
[0039] Based on the above embodiments, as a preferred embodiment of the present invention, in the third embodiment of the present invention, the second mapping optimization method is set as a method of optimizing the room by the proportion of unknown edges in the room's edges. Therefore, step 6: the method of optimizing the room using the second mapping optimization method, as follows... Figure 3 As shown, it specifically includes:
[0040] The edges of a room are scanned to calculate the total edge length and the length of its unknown edges. The unknown edge length refers to the cumulative length of edges belonging to unknown areas identified during the scanning process. The total edge length refers to the cumulative recorded edge length during the scanning process, including both known and unknown edge lengths. Known edges include edges explicitly occupied by obstacles and edges explicitly not occupied by obstacles. Unknown edges are those whose occupation status is unclear.
[0041] The method determines whether to remove a room from the mapping results based on the ratio of the unknown edge length to the total edge length of the room. Specifically, the ratio of the unknown edge length to the total edge length reflects the proportion of the room's edges that have been completely explored. Through repeated experiments, it has been found that when the proportion of a room's edges that are unknown is too high, the room is more likely to be an incomplete room. Therefore, in this method, the ratio of the unknown edge length to the total edge length of the room is used to determine whether the room is an incomplete room, thereby removing incomplete rooms from the mapping results.
[0042] In some embodiments, the method of determining whether to delete a room from the mapping result based on the ratio of the unknown edge length of the room to its total edge length may be, but is not limited to, by setting a ratio threshold, comparing the ratio of the unknown edge length of the room to its total edge length with the ratio threshold, thereby determining whether there is a situation where the proportion of unknown edges in the room's edges is too high.
[0043] In some embodiments, the proportion of unknown edges of a room can be determined based on the relationship between the unknown edge length and the total edge length of the room, thereby determining whether to delete the room from the mapping results. Specifically, this can be achieved by setting a threshold for the difference between the total edge length and the unknown edge length of the room, calculating the difference between them and comparing it to the threshold to determine if there is an excessively high proportion of unknown edges for a room. Specifically, a smaller difference between the total edge length and the unknown edge length indicates a higher proportion of unknown edges, and vice versa.
[0044] Based on the above embodiments, as a preferred embodiment of the present invention, the fourth embodiment of the present invention determines whether the room is incomplete by limiting a first threshold and a second threshold to determine whether there is a situation where the proportion of unknown edges in the room is too high. Specifically, the method steps for determining whether the room is incomplete using the first threshold and the second threshold are as follows: Figure 3 As shown, it includes:
[0045] The edges of the room are scanned to calculate the total edge length and the length of its unknown edges. The unknown edge length refers to the cumulative length of unknown edges identified during the scanning process. The total edge length refers to the cumulative recorded edge length of the room during the scanning process, including both known and unknown edge lengths.
[0046] Calculate the ratio of the unknown edge length of a room to its total edge length; determine whether the ratio of the unknown edge length of a room to its total edge length is greater than a first threshold; specifically, the first threshold is greater than a second threshold. The first threshold is a pre-set threshold used to determine whether the ratio of the unknown edge length of a room to its total edge length is too high, and can directly determine whether a room is incomplete. The setting of the first threshold can be, but is not limited to, an empirical value obtained by statistically analyzing the ratio of the unknown edge length to the total edge length of incomplete rooms in the robot's room division process.
[0047] If the ratio of the length of the unknown edge of a room to its total edge length is greater than a first threshold, it is confirmed that the room has an excessively high proportion of unknown edges, and the room is deleted from the mapping results. It can be understood that in the second mapping optimization method of this embodiment, the higher the proportion of the unknown edge of a room to its total edge length, the greater the possibility of deleting it from the mapping results.
[0048] If the ratio of the unknown edge length of a room to its total edge length is less than or equal to a first threshold, then it is determined whether the ratio of the unknown edge length of a room to its total edge length is less than a second threshold. Specifically, the second threshold is a pre-set threshold used to determine whether the ratio of the unknown edge length of a room to its total edge length does not affect the integrity of the room. The setting of the second threshold can be, but is not limited to, an empirical value obtained by statistically analyzing the ratio of the unknown edge length to the total edge length of a complete room in the process of room division by a robot.
[0049] If the ratio of the length of the unknown edge of a room to its total edge length is less than the second threshold, it is confirmed that the room does not have an excessively high proportion of unknown edges, and the room is included in the mapping results. It can be understood that in the second mapping optimization method of this embodiment, the smaller the proportion of the unknown edge of a room to its total edge length, the less likely it is to be deleted from the mapping results.
[0050] If the ratio of the unknown edge length to the total edge length of a room is less than or equal to a first threshold and greater than or equal to a second threshold, then the room is optimized using a third mapping optimization method. Specifically, when the ratio of the unknown edge length to the total edge length of a room does not clearly indicate whether it is an incomplete or complete room, the room is further optimized using the third mapping optimization method to improve the optimization effect of the robot mapping results. The third mapping optimization method can be, but is not limited to, a method that uses angles other than grayscale values and edge lengths to determine whether a room is complete. Examples include matching the shape of the room to the actual shape of the room to determine its completeness, or projecting the room and determining its completeness based on whether the projected shape meets the conditions for a pre-defined incomplete room projection.
[0051] In some embodiments, the method for scanning the edges of a room to calculate the total edge length and its unknown edge length, as described in the third and fourth embodiments of the present invention, may include, but is not limited to, the following steps: scanning all pixels of the room to obtain the edge pixels of the room; sorting the edge pixels of the room in a clockwise or counterclockwise direction; traversing the edge pixels of the room according to the sorting to determine whether each edge pixel belongs to a pixel occupied by an obstacle, a pixel in an open area (i.e., a pixel in an area clearly not occupied by an obstacle), or a pixel in an unknown area; calculating the sum of the Euclidean distances between adjacent pixels in all edge pixels of the room to obtain the total edge length of the room; calculating the sum of the Euclidean distances between adjacent pixels in the unknown area in all edge pixels of the room to obtain the unknown edge length of the room; wherein, the method for determining whether each edge pixel belongs to a pixel occupied by an obstacle, a pixel in an open area, or a pixel in an unknown area may be, but is not limited to, determining it by the grayscale value of each edge pixel. The calculation of the sum of Euclidean distances between adjacent pixels refers to adding the Euclidean distances between all adjacent pixels. The Euclidean distance is also known as Euclidean distance, which is often used to calculate the distance between two points.
[0052] Based on the above embodiments, as a preferred embodiment of the present invention, in the fifth embodiment, the third mapping optimization method is configured to optimize the robot mapping results by checking whether the projection shape of the room meets a preset shape, especially for rooms where the ratio of the unknown edge length to its total edge length is less than or equal to a first threshold and greater than or equal to a second threshold. Therefore, the method for optimizing the room using the third mapping optimization method described in the fourth embodiment, as... Figure 4 As shown, it specifically includes:
[0053] The room is projected horizontally and vertically to obtain the resulting shapes of the horizontal and vertical projections. Specifically, obtaining the resulting shape of the horizontal projection refers to the image shape obtained by projecting the room image in the map along the row direction to the y-axis, and obtaining the resulting shape of the vertical projection refers to the image shape obtained by projecting the room image in the map along the column direction to the x-axis. The resulting shapes of the horizontal and vertical projections can be, but are not limited to, triangular, trapezoidal, or rectangular shapes.
[0054] The system determines whether the horizontal and vertical projections of a room satisfy at least one of the following shapes: a triangle or a trapezoid. If the room's projection shape satisfies either a triangle or a trapezoid, the room is deleted from the drawing results. Conversely, if the room's projection shape does not satisfy either a triangle or a trapezoid, the room is retained in the drawing results, thus optimizing the room. It should be noted that a triangular projection shape means the layout of the projection resembles a triangle, i.e., its shape is triangular or similar. Similarly, a trapezoidal projection shape means the layout of the projection resembles a trapezoid, i.e., its shape distribution is trapezoidal or similar. A rectangular projection shape means the layout of the projection resembles a rectangle, i.e., its shape distribution is rectangular or similar.
[0055] In this method, the completeness of a room is determined by whether its horizontal and vertical projections conform to a triangular or trapezoidal shape. This is because existing rooms generally have rectangular or polygonal shapes. Repeated experiments have shown that rooms with triangular or trapezoidal projections are more likely to be incomplete. Therefore, the third mapping optimization method in this application matches the horizontal and vertical projections of the room with triangular and trapezoidal shapes to remove rooms that are likely incomplete, thus optimizing the mapping results.
[0056] Based on the above embodiments, as a preferred embodiment of the present invention, the sixth embodiment of the present invention provides a robot mapping optimization method, such as... Figure 5 As shown, the robot mapping optimization method specifically includes the following steps:
[0057] Obtain all rooms from the robot's mapping results; calculate the area of each room in the robot's mapping results; specifically, the area of each room can be calculated using, but is not limited to, a polygon area calculation method, which can be, but is not limited to, calculation based on the coordinates of each vertex of the room. For example, if the coordinates of each vertex of the room specifically include: A(x1,y1), B(x2,y2)......N(x... n ,y n If the area of a room is 1, then the formula for calculating the room area is: Where, x n+1 =x1,y n+1 =y1.
[0058] The system selects the room with the largest area from all rooms in the robot's mapping results. The room with the largest area is optimized using a first mapping optimization method, while the rooms that are not the largest are optimized using a second mapping optimization method. Specifically, the first mapping optimization method is specifically designed for rooms in the mapping results where multiple rooms may be grouped into one room; it is a mapping optimization method that does not directly delete rooms. The second mapping optimization method is specifically designed for rooms in the mapping results where multiple rooms are less likely to be grouped into one room. In this embodiment, the room with the largest area is considered the room most likely to be grouped into one room, and the first mapping optimization method is applied to it. Meanwhile, rooms that are not the largest are considered rooms with a lower probability of being grouped into one room. In some embodiments, the first mapping optimization method may be, but is not limited to, a method of edge correction for rooms, or a method of optimizing rooms by comparing and subtracting pixels one by one. The second mapping optimization method may be, but is not limited to, a mapping optimization method that directly deletes rooms through filtering based on certain limiting conditions.
[0059] Based on the above embodiments, as a preferred embodiment of the present invention, in the seventh embodiment of the present invention, the first mapping optimization method in the sixth embodiment is set as a method for optimizing the room with the largest area by comparing and deleting pixels one by one. Therefore, the method of optimizing the room with the largest area using the first mapping optimization method specifically includes: performing line scanning of the room with the largest area row by row and column by column; determining whether the gray value of the currently scanned pixel is less than a preset gray value; if the gray value of the pixel is less than the preset gray value, then deleting the pixel; if the gray value of the pixel is greater than or equal to the preset gray value, then retaining the pixel, until all pixel gray values in the room with the largest area have been scanned and determined, thus completing the optimization of the room with the largest area.
[0060] Based on the above embodiments, as a preferred embodiment of the present invention, in the eighth embodiment of the present invention, the second mapping optimization method in the sixth embodiment is set as a method for optimizing a room by adjusting the proportion of unknown room edges. Therefore, the method of optimizing a room using the second mapping optimization method is as follows: Figure 6 As shown, it specifically includes:
[0061] The edges of rooms that are not the largest in area are scanned to calculate the total edge length and the length of their unknown edges. The unknown edge length of the non-largest room refers to the cumulative length of edges in the non-largest room that are identified as being in an unknown state during the scanning process. The total edge length of the non-largest room refers to the cumulative recorded edge length of the non-largest room during the scanning process, including known edge lengths and unknown edge lengths. Known edges include edges clearly occupied by obstacles and edges clearly not occupied by obstacles. Unknown edges refer to edges whose occupation by obstacles cannot be determined.
[0062] The algorithm determines the relationship between the ratio of the unknown edge length to the total edge length of a room that is not the largest in area and a first threshold and a second threshold. If the ratio is greater than the first threshold, the room is removed from the mapping results, thus optimizing it. If the ratio is less than or equal to the first threshold but greater than or equal to the second threshold, a third mapping optimization method is applied to optimize the room. If the ratio is less than the second threshold, the room is retained in the mapping results, thus optimizing it. The second threshold is less than the first threshold. Specifically, the first threshold is a pre-set threshold used to determine whether the ratio of the unknown edge length of a room that is not the largest in area to its total edge length is too high. It can directly determine whether a room that is not the largest in area is incomplete. The setting of the first threshold can be, but is not limited to, an empirical value obtained by statistically analyzing the ratio of the unknown edge length of an incomplete room to its total edge length in the robot's room division process. The second threshold is a pre-set threshold used to determine whether the ratio of the unknown edge length of a room to its total edge length does not affect the integrity of the room. The setting of the second threshold can be, but is not limited to, an empirical value obtained by statistically analyzing the ratio of the unknown edge length of a complete room to its total edge length in the robot's room division process.
[0063] In this embodiment, the ratio of the unknown edge length of a non-largest room to its total edge length is used as the basis for judging whether a non-largest room is incomplete. Based on a large number of empirical values of the ratio of the unknown edge length of complete and incomplete rooms to their total edge length in the robot mapping results, a first threshold and a second threshold are set. This enables the optimization method to cover most application scenarios and obtain better judgment results for incomplete and complete rooms, ensuring the effectiveness of the mapping optimization method.
[0064] In some embodiments, the specific steps of optimizing the non-largest room using the third mapping optimization method in the eighth embodiment include: performing horizontal and vertical projections on the non-largest room; determining whether the resulting shape of the horizontal or vertical projection of the non-largest room satisfies at least one triangular or trapezoidal shape; if satisfied, deleting the non-largest room from the mapping results to complete the optimization of the non-largest room; if not satisfied, retaining the non-largest room in the mapping results to complete the optimization of the non-largest room. Since the shapes of existing rooms generally satisfy rectangular or polygonal shapes, repeated experiments have shown that when the projection result shape of a room satisfies a triangular or trapezoidal shape, the probability of the room being an incomplete room is relatively high. Therefore, in the third mapping optimization method of this application, the resulting shapes of the horizontal and vertical projections of the room are matched with triangular and trapezoidal shapes to delete rooms that are likely to be incomplete rooms, thereby optimizing the mapping results.
[0065] As a preferred embodiment of the present invention, the ninth embodiment of the present invention provides a chip, which stores a computer program. When the computer program stored in the chip is run by a processor, it executes the robot mapping optimization method based on room area as described in the previous embodiment or the robot mapping optimization method as described in the previous embodiment.
[0066] As a preferred embodiment of the present invention, the tenth embodiment provides a robot, the robot comprising: an environmental perception sensor for acquiring environmental data around the robot; a mapping module for generating robot mapping results based on the environmental data acquired by the environmental perception sensor; a chip as described in the ninth embodiment, internally storing a computer program, which, when run by a processor, executes the robot mapping optimization method based on room area as described above, or executes the robot mapping optimization method as described above; and a processor for running the computer program stored internally in the chip. It should be noted that the environmental perception sensor may be, but is not limited to, a laser sensor, an infrared sensor, or other sensors capable of sensing and acquiring environmental data.
[0067] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (such as a smartphone) to execute the methods described in the various embodiments of the present invention.
[0068] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0069] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A robot mapping optimization method based on room area, characterized in that, The robot mapping optimization method based on room area includes: Retrieve all rooms from the robot's mapping results; The area of each room is calculated and it is determined whether the area of the room is greater than the preset area threshold. If the area of the room is greater than the preset area threshold, the room is optimized using the first mapping optimization method. If the area of the room is less than or equal to the preset area threshold, the room is optimized using the second mapping optimization method. The first mapping optimization method refers to a mapping optimization method that does not directly delete rooms but only modifies them; the second mapping optimization method refers to a mapping optimization method that removes rooms that do not meet certain conditions from the mapping results through screening based on certain limiting conditions.
2. The robot mapping optimization method based on room area according to claim 1, characterized in that, The optimization of the room using the first mapping optimization method specifically includes: scanning the room row by row and column by column, determining whether the gray value of each pixel is less than a preset gray value, deleting the pixel if it is, and retaining the pixel if it is not, until the gray values of all pixels in the room have been scanned and determined, thus completing the room optimization.
3. The robot mapping optimization method based on room area according to claim 1, characterized in that, The optimization of the room using the second mapping optimization method specifically includes: scanning the edges of the room, calculating the total edge length and unknown edge length of the room, and determining whether to delete the room from the mapping result based on the ratio of the unknown edge length to the total edge length of the room. The total edge length of the room includes known edge length and unknown edge length. The known edges include edges that are clearly occupied by obstacles and edges that are clearly not occupied by obstacles. The unknown edges are edges whose status of being occupied by obstacles is unclear.
4. The robot mapping optimization method based on room area according to claim 3, characterized in that, The step of determining whether to delete a room from the mapping result based on the ratio of the unknown edge length of the room to its total edge length specifically includes: if the ratio of the unknown edge length of the room to its total edge length is greater than a first threshold, then the room is deleted from the mapping result.
5. The robot mapping optimization method based on room area according to claim 4, characterized in that, The step of determining whether to delete a room from the mapping result based on the ratio of the unknown edge length of the room to its total edge length further includes: if the ratio of the unknown edge length of the room to its total edge length is less than a second threshold, then the room is retained in the mapping result; wherein the second threshold is less than the first threshold.
6. The robot mapping optimization method based on room area according to claim 5, characterized in that, The step of determining whether to delete a room from the mapping result based on the ratio of the unknown edge length of the room to its total edge length further includes: if the ratio of the unknown edge length of the room to its total edge length is less than or equal to a first threshold and greater than or equal to a second threshold, then the room is optimized using a third mapping optimization method.
7. The robot mapping optimization method based on room area according to claim 5, characterized in that, The optimization of the room using the third mapping optimization method specifically includes: performing horizontal and vertical projections on the room, and determining whether to delete the room from the mapping results based on the resulting shapes of the horizontal and vertical projections.
8. The robot mapping optimization method based on room area according to claim 7, characterized in that, The step of determining whether to delete a room from the drawing results based on the horizontal and vertical projection results of the room specifically includes: if at least one of the horizontal or vertical projection results of the room satisfies the shape of a triangle or trapezoid, then the room is deleted from the drawing results.
9. A robot mapping optimization method, characterized in that, The robot mapping optimization method includes: Retrieve all rooms from the robot's mapping results; Get the area of each room; Select the room with the largest area from all rooms, and use the first mapping optimization method to optimize the room with the largest area, and use the second mapping optimization method to optimize the rooms that are not the largest in area. The first mapping optimization method refers to a mapping optimization method that does not directly delete rooms but only modifies them; the second mapping optimization method refers to a mapping optimization method that removes rooms that do not meet certain conditions from the mapping results through screening based on certain limiting conditions.
10. The robot mapping optimization method according to claim 9, characterized in that, The optimization of the largest room using the first mapping optimization method specifically includes: performing line scanning of the largest room row by row and column by column, determining whether the gray value of each pixel is less than a preset gray value; if so, deleting the pixel; if not, retaining the pixel, until all pixel gray values in the largest room have been scanned and determined, thus completing the optimization of the largest room.
11. The robot mapping optimization method according to claim 9, characterized in that, The second mapping optimization method is used to optimize rooms that are not the largest in area, specifically including: Scan the edges of each non-largest room and calculate the total edge length and unknown edge length for each non-largest room. Calculate the ratio of the unknown edge length of each non-largest room to its total edge length; Determine the relationship between the ratio of the unknown edge length of each non-largest room to its total edge length and the first and second thresholds; If the ratio of the unknown edge length of a non-largest room to its total edge length is greater than the first threshold, then the non-largest room is removed from the mapping results, thus completing the optimization of the non-largest room. If the ratio of the unknown edge length of a non-largest room to its total edge length is less than or equal to the first threshold and greater than or equal to the second threshold, then the third mapping optimization method is used to optimize the non-largest room. If the ratio of the unknown edge length of a non-largest room to its total edge length is less than the second threshold, then the non-largest room is retained in the mapping result, and the optimization of the non-largest room is completed. Wherein, the second threshold is less than the first threshold; The total edge length of the non-largest room refers to the total edge length of the non-largest room recorded during the scanning process. This includes known edge lengths and unknown edge lengths. The known edges include edges that are clearly occupied by obstacles and edges that are clearly not occupied by obstacles. The unknown edges refer to edges whose occupation by obstacles cannot be determined.
12. The robot mapping optimization method according to claim 11, characterized in that, The optimization of the non-largest room using the third mapping optimization method specifically includes: Perform horizontal and vertical projections on the room that is not the largest in area; Determine whether the horizontal or vertical projection of the non-largest room results in at least one triangular or trapezoidal shape. If the conditions are met, the room that is not the largest in area will be removed from the mapping results, thus completing the optimization of the room that is not the largest in area. If the conditions are not met, the room that is not the largest in area will be retained in the mapping results to complete the optimization of the room that is not the largest in area.
13. A robot, characterized in that, The robot includes: Environmental perception sensors are used to acquire data about the robot's surrounding environment; The mapping module is used to generate robot mapping results based on environmental data acquired by environmental perception sensors; The chip internally stores a computer program, which, when executed by a processor, performs the robot mapping optimization method based on room area as described in any one of claims 1 to 8, or the robot mapping optimization method as described in claims 9 to 12. A processor is used to run computer programs stored inside a chip.
Citation Information
Patent Citations
Grid map optimization method, storage medium and mobile robot
CN113110418A
Indoor space planning method and device, electronic equipment and storage medium
CN113393024A