The disclosure relates to the technical field of map region division, and in particular to a method for establishing map traversal blocks of a global grid map, a chip, and a mobile robot.
A prerequisite for a cleaning robot to perform cleaning tasks efficiently is to have a map describing the surrounding environment. In the aspect of establishment of the environment map, the robot can acquire environment information by adopting modes such as boundary learning through a sensor and combining the existing Simultaneous Localization and Mapping (SLAM) technology, and a grid map describing environment characteristics is established on this basis. After the map is established, the sweeping robot can perform cleaning work.
With the improvement of the requirement of people on the working efficiency of the cleaning robot, especially in some large-scale indoor global environments, the grid information quantity required to be collected by the sweeping robot is greatly increased, so that software resources for constructing and using the grid map are increased, and the efficiency of the robot for navigating by using the global grid map is reduced.
A method for establishing map traversal blocks of a global grid map includes: S1, side lengths of the map traversal blocks are set according to a size of the global grid map, so as to enable the map traversal blocks to occupy a sufficiently large grid region in the global grid map; S2, a coverage number of map traversal blocks in each of a global coordinate axis direction of the global grid map is calculated 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; and S3, according to a constraint effect of the coverage number of the map traversal blocks determined in S2, a row-by-row and column-by-column accumulated operation is carried out 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, and each of the map traversal block is formed by combining corresponding grids according to the mapping coordinates and the side length of the map traversal block.
Optionally, 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 and subjected to block processing to form regularly distributed map traversal blocks.
Optionally, S1 specifically includes: S11, a standard side length is preset; S12, whether a length and a width of the global grid map are both greater than 2 times of the standard side length or not is judged, 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, the side length of the map traversal block is set as the standard side length, otherwise, the process proceeds to S13; S13, whether the length and the width of the global grid map are both greater than the standard side length or not is judged, in a case that the length and the width of the global grid map are both greater than the standard side length, the side length of the map traversal block is set to be half of the standard side length, otherwise, the process proceeds to S14; and S14, the side length of the map traversal block is set to be one fourth of the standard side length, and the global grid map is a rectangular map region.
Optionally, S2 specifically includes: a ratio of an effective length of the global grid map to the side lengths 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 vertical coordinate axis direction of the global grid map; and a ratio of an effective width of the global grid map to the side lengths 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. Therefore, the map traversal blocks of the coverage number can completely mark the environment information of the global working region.
Optionally, S3 specifically includes: S31, by taking a grid position at a 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 vertical coordinate axis plus 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, it is determined 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, then the process proceeds to S33, and 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, 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 is judged, 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, the process proceeds to S34, otherwise, the process proceeds to S35; S34, 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 a mapping coordinate of an adjacent map traversal block in the same vertical coordinate axis direction on the vertical coordinate axis, meanwhile, it is determined 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, then the process returns 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, 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 a 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 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, then the process proceeds to S36, and 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, 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 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 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 a block processing of the global grid map is completed.
Optionally, S3 specifically includes: 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 original point on the vertical coordinate axis plus the side length of the map traversal blocks 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 returns to 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, and then the process proceeds to step 36, 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, 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 the block processing of the global grid map is completed. The technical effects of the technical solution are the same as those of the abovementioned technical solution.
Optionally, a coordinate of a grid point traversed by a robot in the vertical coordinate axis direction is greater than or equal to the mapping coordinate of the map traversal block in the vertical coordinate axis direction, the coordinate of the grid point traversed by the robot in the vertical coordinate axis direction is smaller than or equal to a result obtained by subtracting one from the sum of the mapping coordinate of the map traversal block in the vertical coordinate axis direction and the side length of the map traversal block, a coordinate of the grid point traversed by the robot in the horizontal coordinate axis direction is greater than or equal to the mapping coordinate of the map traversal block in the horizontal coordinate axis direction, the coordinate of the grid point traversed by the robot on the horizontal coordinate axis direction is smaller than or equal to a result obtained by subtracting one from the sum of the mapping coordinate of the map traversal block in the horizontal coordinate axis direction and the side length of the map traversal block, it is determined that the grid point traversed by the robot is located in the map traversal block, so that 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. According to the technical solution, 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 included in an inner region of an adjacent map traversal block in the horizontal coordinate axis direction, the lower boundary of the map traversal block is defined to be included in its inner region, and the upper boundary of the map traversal block is defined to be included in the inner region of the adjacent map traversal block in the vertical coordinate axis direction.
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. A mobile robot, having the built-in chip.
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.
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
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.
In the embodiment, as shown in the flowchart of the method for setting the side lengths of the map traversal blocks disclosed in
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.
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.
In the embodiment, as shown in the flowchart of the method for calculating mapping coordinates of the map traversal block disclosed by
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.
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.
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.
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.
A mobile robot, having the built-in chip.
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.
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.
Number | Date | Country | Kind |
---|---|---|---|
202010456789.7 | May 2020 | CN | national |
The present disclosure is a national stage filing of PCT Application No. PCT/CN2020/131197 filed on Nov. 24, 2020, which claims priority to Chinese patent application No. 202010456789.7, filed on May 26, 2020, and entitled “Method for Establishing Map Traversal Blocks of Global Grid Map, Chip, and Mobile Robot”, the contents of which are hereby incorporated by reference in its entirety.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2020/131197 | 11/24/2020 | WO |