Method for Establishing Map Traversal Blocks of Global Grid Map, Chip, and Mobile Robot
20230337880 · 2023-10-26
Inventors
- Ming LI (Zhuhai, Guangdong, CN)
- Qinwei LAI (Zhuhai, Guangdong, CN)
- Yongyong LI (Zhuhai, Guangdong, CN)
Cpc classification
A47L2201/04
HUMAN NECESSITIES
International classification
A47L11/40
HUMAN NECESSITIES
Abstract
A method for establishing map traversal blocks of a global grid map, a chip, and a mobile robot. The method for establishing the map traversal blocks includes: step 1, setting side lengths of the map traversal blocks according to a size of the global grid map; step 2, calculating a coverage number of map traversal blocks in each of a global coordinate axis direction of the global grid map in combination with a ratio relationship between the size of the global grid map and the side lengths of the map traversal blocks determined in step 1; step 3, according to a constraint effect of the coverage number of the map traversal blocks determined in step 2, performing a row-by-row and column-by-column accumulated operation on the side lengths of the map traversal blocks determined in step 1 to calculate mapping coordinates of each of a map traversal block.
Claims
1. A method for establishing map traversal blocks of a global grid map, comprising: S1, setting side lengths of the map traversal blocks according to a size of the global grid map; S2, calculating a coverage number of map traversal blocks in each of a global coordinate axis direction of the global grid map in combination with a ratio relationship between the size of the global grid map and the side lengths of the map traversal blocks determined in S1; S3, according to a constraint effect of the coverage number of the map traversal blocks determined in S2, carrying out a row-by-row and column-by-column accumulated operation on the side lengths of the map traversal blocks determined in S1 to calculate mapping coordinates of each of a map traversal block, so as to enable the map traversal blocks to be established in each row and each column of the global grid map; wherein each of the map traversal block is formed by combining corresponding grids according to its mapping coordinates and side length.
2. The method for establishing the map traversal blocks according to claim 1, wherein map traversal blocks of each row of the global grid map are arranged in a horizontal coordinate axis direction and projections of the map traversal blocks in a vertical coordinate axis direction are overlapped, and map traversal blocks of each column of the global grid map are arranged in the vertical coordinate axis direction and projections of the map traversal blocks in the horizontal coordinate axis direction are overlapped; the global coordinate axis directions comprise the vertical coordinate axis direction and the horizontal coordinate axis direction.
3. The method for establishing the map traversal blocks according to claim 2, wherein S1 specifically comprises: S11, presetting a standard side length, and then entering S12; S12, judging whether a length and a width of the global grid map are both greater than 2 times of the standard side length or not, in a case that the length and the width of the global grid map are both greater than 2 times of the standard side length, setting the side length of the map traversal blocks as the standard side length, otherwise, entering S13; S13, judging whether the length and the width of the global grid map are both greater than the standard side length or not, in a case that the length and the width of the global grid map are both greater than the standard side length, setting the side length of the map traversal blocks to be half of the standard side length, otherwise, entering S14; S14, setting the side length of the map traversal blocks to be one fourth of the standard side length; wherein the global grid map is a rectangular map region, and the map traversal blocks are squares.
4. The method for establishing the map traversal blocks according to claim 3, wherein S2 specifically comprises: calculating a ratio of an effective length of the global grid map to the side length of the map traversal blocks, and carrying out plus-one processing to obtain a coverage number of the map traversal blocks in the vertical coordinate axis direction of the global grid map; and calculating a ratio of an effective width of the global grid map to the side length of the map traversal blocks, and carrying out plus-one processing to obtain a coverage number of the map traversal blocks in the horizontal coordinate axis direction of the global grid map.
5. The method for establishing the map traversal blocks according to claim 4, wherein S3 specifically comprises: S31, taking a grid position at a lower left corner of the global grid map as a reference original point, and then entering S32; S32, starting from the reference original point, adding a coordinate of the reference original point on the vertical coordinate axis with the side length of the map traversal block to calculate and determine a mapping coordinate of a currently determined map traversal block on the vertical coordinate axis, meanwhile, determining that a mapping coordinate of a currently determined map traversal block on the horizontal coordinate axis is equal to a coordinate of the reference original point on the horizontal coordinate axis, and then entering S33, wherein the reference original point is a position with a minimum coordinate value on each of the global coordinate axis of the global grid map; S33, judging whether a number of the map traversal blocks of which the mapping coordinates have been determined in the vertical coordinate axis direction is smaller than the coverage number of the map traversal blocks in the vertical coordinate axis direction of the global grid map or not, in a case that the mapping coordinates have been determined in the vertical coordinate axis direction is smaller than the coverage number of the map traversal blocks in the vertical coordinate axis direction of the global grid map, entering S34, otherwise, entering S35; S34, adding the mapping coordinate of the currently determined map traversal block on the vertical coordinate axis with the side length of the map traversal block to calculate and determine a mapping coordinate of an adjacent map traversal block in the same vertical coordinate axis direction on the vertical coordinate axis, meanwhile, determining that a mapping coordinate of the adjacent map traversal block in the same vertical coordinate axis direction on the horizontal coordinate axis is the same as the mapping coordinate of the currently determined map traversal block on the horizontal coordinate axis, and then returning to S33, so that mapping coordinates of each of the map traversal block in the same vertical coordinate axis direction are determined row by row under a constraint effect of a coverage number in the same vertical coordinate axis direction; S35, adding the mapping coordinate of the currently determined map traversal block on the horizontal coordinate axis with the side length of the map traversal block to calculate and determine a mapping coordinate of the adjacent map traversal block in the same horizontal coordinate axis direction on the horizontal coordinate axis, meanwhile, determining that a mapping coordinate of the adjacent map traversal block in the same horizontal coordinate axis direction on the vertical coordinate axis is the same as the mapping coordinate of the currently determined map traversal block on the vertical coordinate axis, and then entering S36, so that mapping coordinates of each of the map traversal block in the same horizontal coordinate axis direction are determined column by column under a constraint effect of a coverage number in the same horizontal coordinate axis direction; S36, judging whether a number of the map traversal blocks of which the mapping coordinates have been determined in the horizontal coordinate axis direction is smaller than the coverage number of the map traversal blocks in the horizontal coordinate axis direction of the global grid map or not, in a case that the number of the map traversal blocks of which the mapping coordinates have been determined in the horizontal coordinate axis direction is smaller than the coverage number of the map traversal blocks in the horizontal coordinate axis direction of the global grid map, returning to S33, otherwise, determining that the mapping coordinates of each of the map traversal block in the global grid map have been calculated row by row and column by column, so that the map traversal blocks are established in each row and each column of the global grid map, and a block processing of the global grid map is completed.
6. The method for establishing the map traversal blocks according to claim 4, wherein S3 specifically comprises: S31, taking the grid position at the lower left corner of the global grid map as a reference original point, and then entering S32; S32, starting from the reference original point, adding a coordinate of the reference original point on the horizontal coordinate axis with the side length of the map traversal block to calculate and determine the mapping coordinate of the adjacent map traversal block in the same horizontal coordinate axis direction on the horizontal coordinate axis, meanwhile, determining that the mapping coordinate of the currently determined map traversal block on the vertical coordinate axis is equal to the coordinate of the reference original point on the vertical coordinate axis, and then entering S33, wherein the reference original point is the position with the minimum coordinate value on each of the global coordinate axis of the global grid map; S33, judging whether the number of the map traversal blocks of which the mapping coordinates have been determined in the horizontal coordinate axis direction is smaller than the coverage number of the map traversal blocks in the horizontal coordinate axis direction of the global grid map or not, in a case that the number of the map traversal blocks of which the mapping coordinates have been determined in the horizontal coordinate axis direction is smaller than the coverage number of the map traversal blocks in the horizontal coordinate axis direction of the global grid map, entering S34, otherwise, entering S35; S34, adding the mapping coordinate of the currently determined map traversal block on the horizontal coordinate axis with the side length of the map traversal block to calculate and determine the mapping coordinate of the adjacent map traversal block in the same horizontal coordinate axis direction on the horizontal coordinate axis, meanwhile, determining that the mapping coordinate of the adjacent map traversal block in the same horizontal coordinate axis direction on the vertical coordinate axis is the same as the mapping coordinate of the currently determined map traversal block on the vertical coordinate axis, and then entering S33, so that the mapping coordinates of each of the map traversal block in the same horizontal coordinate axis direction are determined column by column under the constraint effect of the coverage number in the same horizontal coordinate axis direction; S35, adding the mapping coordinate of the currently determined map traversal block on the vertical coordinate axis with the side length of the map traversal block to calculate and determine the mapping coordinate of the adjacent map traversal block in the same vertical coordinate axis direction on the vertical coordinate axis, meanwhile, determining that the mapping coordinate of the adjacent map traversal block in the same vertical coordinate axis direction on the horizontal coordinate axis is the same as the mapping coordinate of the currently determined map traversal block on the horizontal coordinate axis, and then entering S36, so that the mapping coordinates of each of the map traversal block in the same vertical coordinate axis direction are determined row by row under the constraint effect of the coverage number in the same vertical coordinate axis direction; S36, judging whether the number of the map traversal blocks of which the mapping coordinates have been determined in the vertical coordinate axis direction is smaller than the coverage number of the map traversal blocks in the vertical coordinate axis direction of the global grid map or not, in a case that the number of the map traversal blocks of which the mapping coordinates have been determined in the vertical coordinate axis direction is smaller than the coverage number of the map traversal blocks in the vertical coordinate axis direction of the global grid map, returning to S33, otherwise, determining that the mapping coordinates of each of the map traversal block in the global grid map have been calculated row by row and column by column, so that the map traversal blocks are established in each row and each column of the global grid map, and the block processing of the global grid map is completed.
7. The method for establishing the map traversal blocks according to claim 5, wherein a coordinate of a grid point traversed by a robot on the vertical coordinate axis is greater than or equal to the mapping coordinate of the map traversal block on the vertical coordinate axis; the coordinate of the grid point traversed by the robot on the vertical coordinate axis is smaller than or equal to a result obtained by subtracting one from the sum of the mapping coordinate of the map traversal block on the vertical coordinate axis and the side length of the map traversal block; a coordinate of the grid point traversed by the robot on the horizontal coordinate axis is greater than or equal to the mapping coordinate of the map traversal block on the horizontal coordinate axis; the coordinate of the grid point traversed by the robot on the horizontal coordinate axis is smaller than or equal to a result obtained by subtracting one from the sum of the mapping coordinate of the map traversal block on the horizontal coordinate axis and the side length of the map traversal block, and it is determined that the grid point traversed by the robot is located in the map traversal block.
8. The method for establishing the map traversal blocks according to claim 7, wherein when a cleaning robot traverses any grid in the map traversal block, a corresponding map traversal block is marked as a traversed map traversal block.
9. A chip, having a built-in control program, wherein the control program is configured to divide a global grid map constructed by a mobile robot in real time by executing a method for establishing the map traversal blocks of a global grid map, comprising: S1, setting side lengths of the map traversal blocks according to a size of the global grid map; S2, calculating a coverage number of map traversal blocks in each of a global coordinate axis direction of the global grid map in combination with a ratio relationship between the size of the global grid map and the side lengths of the map traversal blocks determined in S1; S3, according to a constraint effect of the coverage number of the map traversal blocks determined in S2, carrying out a row-by-row and column-by-column accumulated operation on the side lengths of the map traversal blocks determined in S1 to calculate mapping coordinates of each of a map traversal block, so as to enable the map traversal blocks to be established in each row and each column of the global grid map; wherein each of the map traversal block is formed by combining corresponding grids according to its mapping coordinates and side length.
10. A mobile robot, having the built-in chip according to claim 9.
11. The method for establishing the map traversal blocks according to claim 6, wherein a coordinate of a grid point traversed by a robot on the vertical coordinate axis is greater than or equal to the mapping coordinate of the map traversal block on the vertical coordinate axis; the coordinate of the grid point traversed by the robot on the vertical coordinate axis is smaller than or equal to a result obtained by subtracting one from the sum of the mapping coordinate of the map traversal block on the vertical coordinate axis and the side length of the map traversal block; a coordinate of the grid point traversed by the robot on the horizontal coordinate axis is greater than or equal to the mapping coordinate of the map traversal block on the horizontal coordinate axis; the coordinate of the grid point traversed by the robot on the horizontal coordinate axis is smaller than or equal to a result obtained by subtracting one from the sum of the mapping coordinate of the map traversal block on the horizontal coordinate axis and the side length of the map traversal block, and it is determined that the grid point traversed by the robot is located in the map traversal block.
12. The chip according to claim 9, wherein map traversal blocks of each row of the global grid map are arranged in a horizontal coordinate axis direction and projections of the map traversal blocks in a vertical coordinate axis direction are overlapped, and map traversal blocks of each column of the global grid map are arranged in the vertical coordinate axis direction and projections of the map traversal blocks in the horizontal coordinate axis direction are overlapped; the global coordinate axis directions comprise the vertical coordinate axis direction and the horizontal coordinate axis direction.
13. The chip according to claim 12, wherein S1 specifically comprises: S11, presetting a standard side length, and then entering S12; S12, judging whether a length and a width of the global grid map are both greater than 2 times of the standard side length or not, in a case that the length and the width of the global grid map are both greater than 2 times of the standard side length, setting the side length of the map traversal blocks as the standard side length, otherwise, entering S13; S13, judging whether the length and the width of the global grid map are both greater than the standard side length or not, in a case that the length and the width of the global grid map are both greater than the standard side length, setting the side length of the map traversal blocks to be half of the standard side length, otherwise, entering S14; S14, setting the side length of the map traversal blocks to be one fourth of the standard side length; wherein the global grid map is a rectangular map region, and the map traversal blocks are squares.
14. The chip according to claim 13, wherein S2 specifically comprises: calculating a ratio of an effective length of the global grid map to the side length of the map traversal blocks, and carrying out plus-one processing to obtain a coverage number of the map traversal blocks in the vertical coordinate axis direction of the global grid map; and calculating a ratio of an effective width of the global grid map to the side length of the map traversal blocks, and carrying out plus-one processing to obtain a coverage number of the map traversal blocks in the horizontal coordinate axis direction of the global grid map.
15. The chip according to claim 14, wherein S3 specifically comprises: S31, taking a grid position at a lower left corner of the global grid map as a reference original point, and then entering S32; S32, starting from the reference original point, adding a coordinate of the reference original point on the vertical coordinate axis with the side length of the map traversal block to calculate and determine a mapping coordinate of a currently determined map traversal block on the vertical coordinate axis, meanwhile, determining that a mapping coordinate of a currently determined map traversal block on the horizontal coordinate axis is equal to a coordinate of the reference original point on the horizontal coordinate axis, and then entering S33, wherein the reference original point is a position with a minimum coordinate value on each of the global coordinate axis of the global grid map; S33, judging whether a number of the map traversal blocks of which the mapping coordinates have been determined in the vertical coordinate axis direction is smaller than the coverage number of the map traversal blocks in the vertical coordinate axis direction of the global grid map or not, in a case that the mapping coordinates have been determined in the vertical coordinate axis direction is smaller than the coverage number of the map traversal blocks in the vertical coordinate axis direction of the global grid map, entering S34, otherwise, entering S35; S34, adding the mapping coordinate of the currently determined map traversal block on the vertical coordinate axis with the side length of the map traversal block to calculate and determine a mapping coordinate of an adjacent map traversal block in the same vertical coordinate axis direction on the vertical coordinate axis, meanwhile, determining that a mapping coordinate of the adjacent map traversal block in the same vertical coordinate axis direction on the horizontal coordinate axis is the same as the mapping coordinate of the currently determined map traversal block on the horizontal coordinate axis, and then returning to S33, so that mapping coordinates of each of the map traversal block in the same vertical coordinate axis direction are determined row by row under a constraint effect of a coverage number in the same vertical coordinate axis direction; S35, adding the mapping coordinate of the currently determined map traversal block on the horizontal coordinate axis with the side length of the map traversal block to calculate and determine a mapping coordinate of the adjacent map traversal block in the same horizontal coordinate axis direction on the horizontal coordinate axis, meanwhile, determining that a mapping coordinate of the adjacent map traversal block in the same horizontal coordinate axis direction on the vertical coordinate axis is the same as the mapping coordinate of the currently determined map traversal block on the vertical coordinate axis, and then entering S36, so that mapping coordinates of each of the map traversal block in the same horizontal coordinate axis direction are determined column by column under a constraint effect of a coverage number in the same horizontal coordinate axis direction; S36, judging whether a number of the map traversal blocks of which the mapping coordinates have been determined in the horizontal coordinate axis direction is smaller than the coverage number of the map traversal blocks in the horizontal coordinate axis direction of the global grid map or not, in a case that the number of the map traversal blocks of which the mapping coordinates have been determined in the horizontal coordinate axis direction is smaller than the coverage number of the map traversal blocks in the horizontal coordinate axis direction of the global grid map, returning to S33, otherwise, determining that the mapping coordinates of each of the map traversal block in the global grid map have been calculated row by row and column by column, so that the map traversal blocks are established in each row and each column of the global grid map, and a block processing of the global grid map is completed.
16. The chip according to claim 14, wherein S3 specifically comprises: S31, taking the grid position at the lower left corner of the global grid map as a reference original point, and then entering S32; S32, starting from the reference original point, adding a coordinate of the reference original point on the horizontal coordinate axis with the side length of the map traversal block to calculate and determine the mapping coordinate of the adjacent map traversal block in the same horizontal coordinate axis direction on the horizontal coordinate axis, meanwhile, determining that the mapping coordinate of the currently determined map traversal block on the vertical coordinate axis is equal to the coordinate of the reference original point on the vertical coordinate axis, and then entering S33, wherein the reference original point is the position with the minimum coordinate value on each of the global coordinate axis of the global grid map; S33, judging whether the number of the map traversal blocks of which the mapping coordinates have been determined in the horizontal coordinate axis direction is smaller than the coverage number of the map traversal blocks in the horizontal coordinate axis direction of the global grid map or not, in a case that the number of the map traversal blocks of which the mapping coordinates have been determined in the horizontal coordinate axis direction is smaller than the coverage number of the map traversal blocks in the horizontal coordinate axis direction of the global grid map, entering S34, otherwise, entering S35; S34, adding the mapping coordinate of the currently determined map traversal block on the horizontal coordinate axis with the side length of the map traversal block to calculate and determine the mapping coordinate of the adjacent map traversal block in the same horizontal coordinate axis direction on the horizontal coordinate axis, meanwhile, determining that the mapping coordinate of the adjacent map traversal block in the same horizontal coordinate axis direction on the vertical coordinate axis is the same as the mapping coordinate of the currently determined map traversal block on the vertical coordinate axis, and then entering S33, so that the mapping coordinates of each of the map traversal block in the same horizontal coordinate axis direction are determined column by column under the constraint effect of the coverage number in the same horizontal coordinate axis direction; S35, adding the mapping coordinate of the currently determined map traversal block on the vertical coordinate axis with the side length of the map traversal block to calculate and determine the mapping coordinate of the adjacent map traversal block in the same vertical coordinate axis direction on the vertical coordinate axis, meanwhile, determining that the mapping coordinate of the adjacent map traversal block in the same vertical coordinate axis direction on the horizontal coordinate axis is the same as the mapping coordinate of the currently determined map traversal block on the horizontal coordinate axis, and then entering S36, so that the mapping coordinates of each of the map traversal block in the same vertical coordinate axis direction are determined row by row under the constraint effect of the coverage number in the same vertical coordinate axis direction; S36, judging whether the number of the map traversal blocks of which the mapping coordinates have been determined in the vertical coordinate axis direction is smaller than the coverage number of the map traversal blocks in the vertical coordinate axis direction of the global grid map or not, in a case that the number of the map traversal blocks of which the mapping coordinates have been determined in the vertical coordinate axis direction is smaller than the coverage number of the map traversal blocks in the vertical coordinate axis direction of the global grid map, returning to S33, otherwise, determining that the mapping coordinates of each of the map traversal block in the global grid map have been calculated row by row and column by column, so that the map traversal blocks are established in each row and each column of the global grid map, and the block processing of the global grid map is completed.
17. The chip according to claim 15, wherein a coordinate of a grid point traversed by a robot on the vertical coordinate axis is greater than or equal to the mapping coordinate of the map traversal block on the vertical coordinate axis; the coordinate of the grid point traversed by the robot on the vertical coordinate axis is smaller than or equal to a result obtained by subtracting one from the sum of the mapping coordinate of the map traversal block on the vertical coordinate axis and the side length of the map traversal block; a coordinate of the grid point traversed by the robot on the horizontal coordinate axis is greater than or equal to the mapping coordinate of the map traversal block on the horizontal coordinate axis; the coordinate of the grid point traversed by the robot on the horizontal coordinate axis is smaller than or equal to a result obtained by subtracting one from the sum of the mapping coordinate of the map traversal block on the horizontal coordinate axis and the side length of the map traversal block, and it is determined that the grid point traversed by the robot is located in the map traversal block.
18. The chip according to claim 16, wherein a coordinate of a grid point traversed by a robot on the vertical coordinate axis is greater than or equal to the mapping coordinate of the map traversal block on the vertical coordinate axis; the coordinate of the grid point traversed by the robot on the vertical coordinate axis is smaller than or equal to a result obtained by subtracting one from the sum of the mapping coordinate of the map traversal block on the vertical coordinate axis and the side length of the map traversal block; a coordinate of the grid point traversed by the robot on the horizontal coordinate axis is greater than or equal to the mapping coordinate of the map traversal block on the horizontal coordinate axis; the coordinate of the grid point traversed by the robot on the horizontal coordinate axis is smaller than or equal to a result obtained by subtracting one from the sum of the mapping coordinate of the map traversal block on the horizontal coordinate axis and the side length of the map traversal block, and it is determined that the grid point traversed by the robot is located in the map traversal block.
19. The chip according to claim 17, wherein when a cleaning robot traverses any grid in the map traversal block, a corresponding map traversal block is marked as a traversed map traversal block.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0013]
[0014]
[0015]
DETAILED DECEPTION OF THE EMBODIMENTS
[0016] The technical solutions in the embodiments of the disclosure will be described in detail below with reference to the drawings in the embodiments of the disclosure. The accompanying drawings are provided for further illustrating the embodiments. The accompanying drawings, which are incorporated in and constitute a part of the disclosure, mainly illustrate the embodiments, together with the description of the specification, serve to explain the principles of the embodiments. With these references, those of ordinary skill in the art will appreciate other possible implementation modes and advantages of the disclosure. The components in the figures are not drawn to scale, and similar reference numerals are generally used to denote similar components.
[0017] The embodiments of the disclosure disclose a method for establishing map traversal blocks of a global grid map, which can be executed before a cleaning robot carries out cleaning traversal on a global working region in a preset cleaning mode, so that the mobile robot can clean the global working region after block processing. As shown in
[0018] It is to be noted that map traversal blocks of each row of the global grid map are arranged in a horizontal coordinate axis direction and projections of the map traversal blocks in a vertical coordinate axis direction are overlapped, and map traversal blocks of each column of the global grid map are arranged in the vertical coordinate axis direction and projections of the map traversal blocks in the horizontal coordinate axis direction are overlapped; and the global coordinate axis directions include the vertical coordinate axis direction and the horizontal coordinate axis direction. In the disclosure, the grids on the global map are combined row by row and column by column to establish regularly distributed map traversal blocks. It is equivalent that the global map is divided into small map blocks.
[0019] In the embodiment, as shown in the flowchart of the method for setting the side lengths of the map traversal blocks disclosed in
[0020] In the embodiment, a ratio of an effective length of the global grid map to the side length of the map traversal blocks is calculated, and plus-one processing is carried out to obtain a coverage number of the map traversal blocks established in the vertical coordinate axis direction of the global grid map; and a ratio of an effective width of the global grid map to the side length of the map traversal blocks is calculated, and plus-one processing is carried out to obtain a coverage number of the map traversal blocks in the horizontal coordinate axis direction of the global grid map. The necessity of plus-one processing here is that a software system rounds the ratio of the effective length of the global grid map to the side length of the map traversal blocks, and ignores the decimal part, so that plus-one processing is needed to ensure that the map traversal blocks with the coverage number completely record the actually covered global working region, and the redundancy of the spatial region is improved.
[0021] On the basis that the side lengths of the map traversal blocks are determined according to the above-mentioned method, the number of the map traversal blocks in each of the global coordinate axis direction of the global grid map is determined through calculation, specifically including that: the number H of the map traversal blocks in the vertical coordinate axis direction (namely in the length direction) of the global grid map=the ratio of the effective length of the global grid map to the side lengths of the map traversal blocks+1, and the number W of the map traversal blocks in the horizontal coordinate axis direction (namely in the width direction) of the global grid map=the ratio of the effective width of the global grid map to the side lengths of the map traversal blocks+1. The effective length and effective width in the embodiment include a grid region for the robot to traverse for constructing the map traversal blocks.
[0022] In the embodiment, as shown in the flowchart of the method for calculating mapping coordinates of the map traversal block disclosed by
[0023] In another embodiment, S3 can further include: S31, by taking the grid position at the lower left corner of the global grid map as a reference original point, the process proceeds to S32; S32, starting from the reference original point, a coordinate of the reference original point on the horizontal coordinate axis plus the side length of the map traversal block to calculate and determine the mapping coordinate of the adjacent map traversal block in the same horizontal coordinate axis direction on the horizontal coordinate axis, meanwhile, it is determined that the mapping coordinate of the currently determined map traversal block on the vertical coordinate axis is equal to the coordinate of the reference original point on the vertical coordinate axis, then the process proceeds to S33, and the reference original point is the position with the minimum coordinate value on each of the global coordinate axis of the global grid map; S33, whether the number of the map traversal blocks of which the mapping coordinates have been determined in the horizontal coordinate axis direction is smaller than the coverage number of the map traversal blocks in the horizontal coordinate axis direction of the global grid map or not is judged, in a case that the number of the map traversal blocks of which the mapping coordinates have been determined in the horizontal coordinate axis direction is smaller than the coverage number of the map traversal blocks in the horizontal coordinate axis direction of the global grid map, the process proceeds to S34, otherwise, the process proceeds to S35; S34, the mapping coordinate of the currently determined map traversal block on the horizontal coordinate axis plus the side length of the map traversal block to calculate and determine the mapping coordinate of the adjacent map traversal block in the same horizontal coordinate axis direction on the horizontal coordinate axis, meanwhile, it is determined that the mapping coordinate of the adjacent map traversal block in the same horizontal coordinate axis direction on the vertical coordinate axis is the same as the mapping coordinate of the currently determined map traversal block on the vertical coordinate axis, then the process enters S33, so that the mapping coordinates of each of the map traversal block in the same horizontal coordinate axis direction are determined column by column under the constraint effect of the coverage number in the same horizontal coordinate axis direction; S35, the mapping coordinate of the currently determined map traversal block on the vertical coordinate axis plus the side length of the map traversal block to calculate and determine the mapping coordinate of the adjacent map traversal block in the same vertical coordinate axis direction on the vertical coordinate axis, meanwhile, it is determined that the mapping coordinate of the adjacent map traversal block in the same vertical coordinate axis direction on the horizontal coordinate axis is the same as the mapping coordinate of the currently determined map traversal block on the horizontal coordinate axis, then the process proceeds to S36, and the mapping coordinates of each of the map traversal block in the same vertical coordinate axis direction are determined row by row under the constraint effect of the coverage number in the same vertical coordinate axis direction; S36, whether the number of the map traversal blocks of which the mapping coordinates have been determined in the vertical coordinate axis direction is smaller than the coverage number of the map traversal blocks in the vertical coordinate axis direction of the global grid map or not is judged, in a case that the number of the map traversal blocks of which the mapping coordinates have been determined in the vertical coordinate axis direction is smaller than the coverage number of the map traversal blocks in the vertical coordinate axis direction of the global grid map, the process returns to S33, otherwise, it is determined that the mapping coordinates of each of the map traversal block in the global grid map have been calculated row by row and column by column, so that the map traversal blocks are established in each row and each column of the global grid map, and block processing of the global grid map is completed. Compared with the previous embodiment, in the embodiment, the current row is traversed first and then the next row is traversed until all rows of map traversal blocks distributed in the vertical coordinate axis direction are traversed, and the involved coordinate value accumulation step is similar to that of the previous embodiment, so that no detailed elaboration will be made herein.
[0024] In another embodiment, a coordinate of a grid point traversed by a robot on the vertical coordinate axis is greater than or equal to the mapping coordinate of the map traversal block on the vertical coordinate axis; the coordinate of the grid point traversed by the robot on the vertical coordinate axis is smaller than or equal to a result obtained by subtracting one from the sum of the mapping coordinate of the map traversal block on the vertical coordinate axis and the side length of the map traversal block; a coordinate of the grid point traversed by the robot on the horizontal coordinate axis is greater than or equal to the mapping coordinate of the map traversal block on the horizontal coordinate axis; the coordinate of the grid point traversed by the robot on the horizontal coordinate axis is smaller than or equal to a result obtained by subtracting one from the sum of the mapping coordinate of the map traversal block on the horizontal coordinate axis and the side length of the map traversal block, and it is determined that the grid point traversed by the robot is located in the map traversal block. Therefore, the method for judging whether a grid position coordinate (a, b) of the global grid map belongs to a traversal map block or not includes: whether a is greater than or equal to X (i, j) and smaller than or equal to X (i, j)+e−1 is judged; meanwhile, whether b is greater than or equal to Y (i, j) and smaller than or equal to Y (i, j)+e−1 or not is judged; and when the grid position coordinate (a, b) meets the two judgment conditions at the same time, it is determined that the grid position coordinate (a, b) is located in the map traversal block. When a cleaning robot traverses any grid in the map traversal block, a corresponding map traversal block is marked as a traversed map traversal block, in the embodiment, the left boundary of the map traversal block is defined to be contained in its inner region, the right boundary of the map traversal block is defined to be contained in the inner region of the adjacent map traversal block in the horizontal coordinate axis direction, so that the region between the left boundary and the right boundary of the map traversal block and the left boundary of the map traversal block belong to the same map traversal block, grids contained inside belong to the grids forming the map traversal block, meanwhile, the lower boundary of the map traversal block is defined to be contained in its inner region, the upper boundary of the map traversal block is defined to be contained in the inner region of the adjacent map traversal block in the vertical coordinate axis direction, the region between the lower boundary and the upper boundary of the map traversal block and the lower boundary of the map traversal block belong to the same map traversal block, and the grids contained inside belong to the grids forming the map traversal block.
[0025] When the cleaning robot traverses any grid in the map traversal block according to the preset cleaning mode, for example, when the cleaning robot traverses the grid position coordinate (a, b), the corresponding map traversal block is marked as the traversed map traversal block; a cleaning path traversed by the cleaning robot in a global working region is composed of the traversed map traversal blocks, and compared with a mode of grid marking one by one, the map traversal blocks record a larger path region range, the number of marking blocks used for marking the same path is reduced, the requirements on the computing power of the cleaning robot and the requirements on the storage space are reduced, and the map constructing time is reduced.
[0026] A chip, having a built-in control program for dividing a global grid map constructed by a mobile robot in real time by executing the method for establishing the map traversal blocks. It is to be understood that the embodiments described herein can be implemented by hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation mode, a processing unit can be implemented within one or more of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a processor, a controller, a micro-controller, a microprocessor, other electronic units designed to perform the functions described herein, or a combination thereof. When the embodiments are implemented in software, firmware, middleware or microcode, program code or code segments, they can be stored in a machine-readable medium, such as a storage component.
[0027] A mobile robot, having the built-in chip.
[0028] The logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, (such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions). For the purposes of this description, the “computer-readable medium” can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM or flash memory), an optical fiber device, and a portable Compact Disc Read-Only Memory (CDROM). In addition, the computer-readable medium can even be paper or another suitable medium upon which the program can be printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiling, interpreting or otherwise processing in a suitable manner if necessary, and then is stored in a computer memory.
[0029] The above embodiments are only for illustrating the technical idea and features of the disclosure, and the purpose is to enable those skilled in the art to understand the content of the disclosure and implement the disclosure accordingly, and not to limit the protection scope of the disclosure accordingly. All equivalent changes and modifications made according to the spirit of the disclosure should be covered in the protection scope of the disclosure.