Grid Map Construction Method, Robot, and Machine-readable Storage Medium
By using target point cloud data and raster mapping technology in the raster map construction method, the problem of small obstacles in the robot's viewing angle being cleared by the background is solved, and the high accuracy and completeness of the raster map is achieved.
Patent Information
- Application Number
- CN202210564754.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-23
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2042-05-23
AI Technical Summary
When drawing a raster map based on the camera, tiny obstacles at close range of the robot's perspective are easily cleared by the background, making it impossible to accurately describe it into the raster map.
By obtaining the target point cloud data of the robot in a specified spatial area, the obstacle position is calculated based on the depth map and the camera's internal and external parameters, and the reference grid, camera position grid, and robot position grid are determined on the initial grid map. Then, based on the state of these rasters, select an idle or unknown raster in the specified range from the initial raster map, update it to an occupied state, and generate a target raster map.
Accurate description of small obstacles at close range from the robot perspective is achieved, improving the accuracy of the grid map, and avoiding the omission of obstacles caused by background clearance.
Smart Images

Figure CN114779787B_ABST
Abstract
Description
Technical Field
[0001] This application relates to robots, and particularly to a grid map construction method, a robot, and a machine-readable storage medium. Background Art
[0002] During the mobile navigation process, a mobile robot needs a function similar to human vision to perceive the surrounding environment, so as to understand which areas are feasible areas and which areas are obstacle areas, etc. In applications, a two-dimensional grid map (also called a two-dimensional occupancy grid map), simply referred to as a grid map, is used to replace human vision to perceive the surrounding obstacles, so that the mobile robot can avoid obstacles and navigate.
[0003] Currently, there are usually two ways to draw a grid map. One is to draw a grid map based on radar scanning, and the other is to draw a grid map based on obtaining the three-dimensional point cloud of the scene by a camera. However, when drawing a grid map based on obtaining the three-dimensional point cloud of the scene by a camera, small obstacles at a close distance from the robot's perspective are often cleared by the background and cannot be accurately described in the grid map. Summary of the Invention
[0004] Embodiments of this application provide a grid map construction method, a robot, and a machine-readable storage medium to avoid the problem that small obstacles at a close distance from the robot's perspective are cleared by the background and cannot be accurately described in the grid map.
[0005] Embodiments of this application provide a grid map construction method, which is applied to a robot and includes:
[0006] Obtain target point cloud data when the robot works in a specified spatial area; the target point cloud data is calculated based on a depth map and the internal and external parameters of the camera, the depth map is obtained from the speckle image collected by the camera installed on the robot, and the target point cloud data at least includes the obstacle positions of each obstacle in the specified spatial area in the camera coordinate system;
[0007] On an initial grid map, determine a reference grid having a mapping relationship with each obstacle position in the target point cloud data, determine a first target grid having a mapping relationship with the camera position point, and determine a second target grid having a mapping relationship with the robot position point of the robot; the camera position point is the position when the camera collects the speckle image, and the robot position point is the position where the center of the robot is located when the camera collects the speckle image;
[0008] Determine the occupied grids with the occupied state, the free grids with the free state, and the unknown grids on the initial grid map based on the reference grid and the first target grid. Select at least one free grid and / or unknown grid within a specified range from the initial grid map, and update the selected grids to occupied grids with the occupied state to obtain a target grid map. The specified range is a range centered on the second target grid with a set distance r as the radius.
[0009] A robot, which includes:
[0010] A camera module, which at least includes a camera and a transmitter; the transmitter is used to transmit signals, and the camera is used to collect the speckle images formed when the signals irradiate the object surface;
[0011] A sensing module, which is used for:
[0012] Obtain the target point cloud data when the robot works in a specified spatial area; the target point cloud data is calculated based on the depth map and the internal and external parameters of the camera. The depth map is determined based on the speckle images collected by the camera. The target point cloud data at least includes the obstacle positions of each obstacle in the specified spatial area in the camera coordinate system; and,
[0013] Determine the reference grid on the initial grid map that has a mapping relationship with each obstacle position in the target point cloud data, determine the first target grid that has a mapping relationship with the camera position point, and determine the second target grid that has a mapping relationship with the robot position point of the robot; the camera position point is the position when the camera collects the speckle images, and the robot position point is the position where the center of the robot is located when the camera collects the speckle images; and,
[0014] Determine the occupied grids with the occupied state, the free grids with the free state, and the unknown grids on the initial grid map based on the reference grid and the first target grid. Select at least one free grid and / or unknown grid within a specified range from the initial grid map, and update the selected grids to occupied grids with the occupied state to obtain a target grid map. The specified range is a range centered on the second target grid with a set distance r as the radius.
[0015] The embodiment of the present application also provides a machine-readable storage medium, which is characterized in that the machine-readable storage medium stores machine-executable instructions that can be executed;
[0016] The machine-executable instructions are executed to implement the steps of the above method.
[0017] As can be seen from the above technical solutions, in this embodiment, by determining the occupied grids with the occupied state, the free grids with the free state, and the unknown grids on the initial grid map based on the reference grid and the first target grid, and after determining the free grids and the unknown grids, selecting at least one free grid and / or unknown grid within a specified range from the initial grid map and updating the selected grids to the occupied grids with the occupied state, the construction of the two-dimensional grid map of the visual mobile robot is realized based on the grid mapping and the obstacle supplement strategy for eliminating the grid map errors, avoiding the problem that the small obstacles at the close range of the robot's perspective are cleared by the background and cannot be accurately described in the grid map;
[0018] Further, after mapping each obstacle position in the target point cloud data to the reference grid on the initial grid map, first directly determining the occupied grids with the occupied state, the free grids with the free state, and the unknown grids on the initial grid map based on the reference grid and the first target grid, avoiding the operation of traversing the counter of the entire map in the similar technologies, and having higher efficiency;
[0019] Further, in this embodiment, when drawing the grid map, selecting at least one free grid and / or unknown grid within a specified range from the initial grid map and updating the selected grids to the occupied grids with the occupied state realizes the supplement of the small obstacles at the close range by adopting the obstacle supplement strategy and improves the accuracy of the grid map. Description of the Drawings
[0020] The drawings here are incorporated into the specification and form a part of this specification, showing the embodiments consistent with the present disclosure and used together with the specification to explain the principles of the present disclosure.
[0021] Figure 1 It is the flowchart of the method provided by the embodiment of the present application;
[0022] Figure 2 It is the schematic diagram of the obstacle distribution provided by the embodiment of the present application;
[0023] Figure 3 It is the flowchart of the grid update provided by the embodiment of the present application;
[0024] Figure 4 It is another flowchart of the grid update provided by the embodiment of the present application;
[0025] Figure 5 It is the structure diagram of the robot provided by the embodiment of the present application. Detailed Embodiments
[0026] Exemplary embodiments will be described in detail herein, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0027] The terms used in the present application are for the purpose of describing particular embodiments only and are not intended to limit the present application. The singular forms "a", "the", and "said" used in the present application and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise.
[0028] To enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application and to make the above-mentioned objects, features, and advantages of the embodiments of the present application more apparent and understandable, the technical solutions in the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0029] See Figure 1 , Figure 1 which is the flowchart of the method provided by the embodiment of the present application. As an embodiment, this method is applied to a robot.
[0030] As Figure 1 shown, the process may include the following steps:
[0031] Step 101, obtain target point cloud data when the robot works in a specified spatial area.
[0032] In this embodiment, the specified spatial area here is, for example, a living room, a bedroom, an office, etc., and this embodiment does not specifically limit it.
[0033] In the above-mentioned specified spatial area, when the robot works in a specified working mode, such as a working mode of walking along the edge or a working mode of bypassing obstacles along the edge, it will execute the step of obtaining the target point cloud data when the robot works in the specified spatial area in step 101.
[0034] In this embodiment, the target point cloud data is calculated based on the depth map and the internal and external parameters of the camera. Here, the depth map is obtained from the speckle image collected by the camera installed on the robot, for example, a real-time depth map of the application scenario is obtained based on the speckle image and the stereo matching ranging method. The depth can be obtained by a specified device, such as a processing module installed on the robot.
[0035] Optionally, the transmitting source installed on the robot will emit a signal, and the camera will collect the above-mentioned speckle image formed when the signal is irradiated onto the surface of the object. The speckle image here is related to the type of camera. For example, if the camera is an infrared camera, the speckle image corresponds to an infrared speckle image.
[0036] Optionally, in this embodiment, there are many ways to obtain the target point cloud data when the robot works in the specified space area, such as obtaining the candidate point cloud data when the robot works in the specified space area, where the candidate point cloud data is the obstacle position of each obstacle in the specified space area in the camera coordinate system, Figure 2 Examples are given of various obstacles within the specified spatial area; then, the locations that do not meet the requirements in the candidate point cloud data are eliminated through filtering operations to obtain the target point cloud data.
[0037] Optionally, in this embodiment, positions that do not meet the requirements, such as invalid positions, outlier positions, etc., are eliminated through operations such as through filtering and statistical filtering.
[0038] Step 102, determine on the initial grid map a grid (referred to as a reference grid) that has a mapping relationship with each obstacle position in the target point cloud data, determine a first target grid that has a mapping relationship with the camera position point, and determine a second target grid that has a mapping relationship with the robot position point of the robot.
[0039] In this embodiment, if the grid map is constructed for the first time, the initialization grid map is an original grid map set according to the set map size and the set grid size (the actual distance represented by each grid). On the original grid map, each grid pixel value is set to a first preset value, such as 128. Here, the first preset value is used to represent an unknown grid.
[0040] Of course, as an embodiment, if the grid map is not constructed for the first time, the initialized grid map may preferably be the grid map constructed last time according to the point cloud data.
[0041] It should be noted that, in order to simplify the process, the grid map can also be initialized by default as the above-mentioned original grid map.
[0042] In this embodiment, there are many grids on the initial grid map. In this embodiment, each obstacle position in the target point cloud data is mapped to a corresponding grid based on a mapping relationship (for ease of distinction, the grid is recorded as a reference grid). In this embodiment, the mapping relationship can be a mapping relationship between a camera coordinate system and a two-dimensional coordinate system corresponding to the grid map.
[0043] Further, in this embodiment, grids that have a mapping relationship with the camera position point and grids that have a mapping relationship with the robot position point of the robot will also be determined on the initial grid map based on the above mapping relationship (for easy distinction, denoted as the first target grid and the second target grid respectively).
[0044] As an embodiment, the camera position point refers to the position of the camera when the above speckle image is collected.
[0045] The robot position point is the position where the center of the robot is located when the above speckle image is collected by the camera.
[0046] It should be noted that, in this embodiment, after the above reference grid is determined on the initial grid map, the pixel value of the reference grid can be further updated. Among them, the updated pixel value is smaller than the pixel value before the update. For example, subtracting a set value from the pixel value before the update gives the above updated pixel value. In this embodiment, the smaller the pixel value of any grid, the greater the probability that the grid is an occupied grid, and the larger the pixel value of any grid, the smaller the probability that the grid is an occupied grid. By updating the pixel value of the reference grid, the distribution of each obstacle in the above specified spatial area can be initially displayed on the initial grid map.
[0047] It should also be noted that, in this embodiment, after any obstacle position is mapped to the reference grid on the initial grid map, the number of obstacle positions mapped to this grid can be further recorded. For example, if the number of obstacle position mappings associated with this grid has not been recorded, then record the number of obstacle position mappings associated with this grid as an initial value, such as 1. If the number of obstacle position mappings associated with this grid has already been recorded, then increase the recorded number of obstacle position mappings associated with this grid by a preset value, such as 1.
[0048] Step 103: Determine occupied grids with an occupied state, free grids with a free state, and unknown grids on the initial grid map based on the reference grid and the first target grid. Select at least one free grid and / or unknown grid within a specified range from the initial grid map, and update the selected grid to an occupied grid with an occupied state to obtain a target grid map. The specified range is a range centered on the second target grid with a set distance r as the radius.
[0049] Optionally, in this embodiment, step 103 mainly performs real-time updates of dynamic and static obstacles in the grid map based on the accumulation and subtraction of grid pixels of the Bresenham algorithm (constructed using a similar technology application counting method), and constructs a two-dimensional grid map of a visual mobile robot based on a grid map obstacle mis-removal compensation strategy to obtain the final target grid map.
[0050] As an embodiment, to improve efficiency (avoiding the operation of traversing the entire map counter as in related technologies), this embodiment mainly uses the relatively simple addition, subtraction, and bit shift operations in the Bresenham algorithm to update the dynamic and static obstacles in the grid map in real time, so as to finally determine the occupied grids with the occupied state, the free grids with the free state, and the unknown grids on the initial grid map based on the reference grid and the first target grid. Figure 3 This will be described by examples and will not be elaborated here.
[0051] As another embodiment, when drawing the grid map, an obstacle supplement strategy is adopted to supplement the small obstacles at close range, improving the accuracy of the grid map. Figure 4 Examples are given to show how to supplement the free grids and / or unknown grid states to occupied grids, which will not be elaborated here.
[0052] So far, the Figure 1 shown process is completed.
[0053] Through Figure 1 the shown process, it can be seen that in this embodiment, by determining the occupied grids with the occupied state, the free grids with the free state, and the unknown grids on the initial grid map based on the reference grid and the first target grid, and after determining the free grids and the unknown grids, selecting at least one free grid and / or unknown grid within a specified range from the initial grid map and updating the selected grid to an occupied grid with the occupied state, the construction of the two-dimensional grid map of the visual mobile robot is realized based on the grid mapping and the obstacle supplement strategy for eliminating grid map errors, avoiding the problem that the small obstacles at close range in the robot's perspective are cleared by the background and cannot be accurately described in the grid map;
[0054] Further, after mapping each obstacle position in the target point cloud data to the reference grid on the initial grid map, first directly determine the occupied grids with the occupied state, the free grids with the free state, and the unknown grids on the initial grid map based on the reference grid and the first target grid, avoiding the operation of traversing the entire map counter as in related technologies, and having high efficiency;
[0055] Further, in this embodiment, when drawing the grid map, selecting at least one free grid and / or unknown grid within a specified range from the initial grid map and updating the selected grid to an occupied grid with the occupied state realizes the supplement of small obstacles at close range by using the obstacle supplement strategy and improves the accuracy of the grid map.
[0056] Next, the Figure 3 shown process will be described:
[0057] See Figure 3 , Figure 3 which is the grid update flow chart provided by the embodiment of the present application. Through this process, occupied grids with an occupied state, free grids with a free state, and unknown grids can be determined on the initial grid map based on the reference grid and the first target grid.
[0058] As Figure 3 shown, this process may include the following steps:
[0059] Step 301, for each reference grid, determine the shortest straight line segment from the reference grid to the first target grid, and update the pixel values of the grids on the shortest straight line segment.
[0060] In this embodiment, to update the pixel values of the grids on the shortest straight line segment, for example, increase the pixel values of the grids on the shortest straight line segment by a set value so that the updated pixel values are greater than the pixel values before update, and reduce the obstacle occupancy probability.
[0061] Step 302, for each grid on the initial grid map, determine whether the grid is an occupied grid, a free grid, or an unknown grid according to the pixel value of the grid; wherein, when the pixel value of the grid is the first preset value, it indicates that the grid is an unknown grid, when the pixel value of the grid is less than or equal to the set obstacle threshold, it indicates that the grid is an occupied grid, and when the pixel value of the grid is greater than the set obstacle threshold and less than the first preset value, determine that the grid is a free grid.
[0062] Through Figure 3 the process shown, occupied grids with an occupied state, free grids with a free state, and unknown grids are finally preliminarily determined on the initial grid map.
[0063] The following describes how to select occupied grids from free grids and / or unknown grids to supplement occupied grids (obstacles):
[0064] See Figure 4 , Figure 4 which is another grid update flow chart of the embodiment of the present application. This process supplements obstacle grids with higher credibility by discriminating the connection between the front and rear frames, avoiding incorrect filling of grid obstacles due to noise in a certain frame.
[0065] Figure 4 When the process shown is executed, the breakdown times of the grids need to be involved. Optionally, in this embodiment, the above determination of the shortest straight line segment from the reference grid to the first target grid further includes: for each grid on the shortest straight line segment, if the breakdown times of the grid have been recorded, increase the recorded breakdown times of the grid by a second preset value such as 1, otherwise, record the breakdown times of the grid as the second preset value such as 1.
[0066] After that, execute the process as follows: Figure 4 shown:
[0067] Step 401: For each grid on the initial grid map within the specified range, if the grid is a free grid or an unknown grid, then execute Step 402.
[0068] In this embodiment, the specified range is a range centered on the second target grid with a set distance r as the radius. r can be set according to actual needs.
[0069] Step 402: When the breakdown times of the grid meet the set requirements, update the pixel value of the grid to a third preset value to indicate that the grid is updated to an occupied grid with an occupied state, and the third preset value is less than or equal to the set obstacle threshold.
[0070] Optionally, in this embodiment, the breakdown times of the reference grid at least meet the following conditions:
[0071]
[0072] Among them, occ(i) represents the number of obstacle positions mapped to the i-th reference grid in the target point cloud data; threshold is a preset point cloud noise judgment threshold; befor_free(i) represents that if this is the first time to execute the construction of the grid map, then befor_free(i) is a fourth preset value such as 0, otherwise, befor_free(i) represents the breakdown times of the i-th grid when constructing the grid map based on the historical point cloud data obtained last time, free(i) represents the breakdown times of the i-th grid; THRE is a fifth preset value.
[0073] So far, the Figure 4 shown process is completed.
[0074] Through the Figure 4 shown process, it is realized to supplement the occupied grids within a certain distance range of the current position of the robot through the obstacle supplement strategy to avoid mis-eliminating obstacles.
[0075] The method provided by the embodiments of the present application has been described above. Next, the robot provided by the embodiments of the present application will be described:
[0076] Refer to Figure 5 , Figure 5 which is the structural diagram of the robot provided by the embodiments of the present application. The robot mainly includes: a camera module and a perception module.
[0077] Among them, the camera module includes at least a camera and a transmitter; wherein, the transmitter is used to transmit signals, and the camera is used to collect the speckle image formed when the signals irradiate the object surface.
[0078] As an embodiment, the camera module further includes a processing module. Among them, the processing module is used to determine the depth map based on the speckle image collected by the camera. Here, the processing module can be implemented by software or by a hardware chip, and this embodiment does not specifically limit. Figure 5 Taking the camera module including a processing module as an example for illustration.
[0079] As another embodiment, the camera module may not include a processing module, and the above depth map is determined by an external device or other existing modules of the robot.
[0080] The perception module is used for:
[0081] Obtain the target point cloud data when the robot works in the specified spatial area; the target point cloud data is calculated based on the depth map and the internal and external parameters of the camera, and the target point cloud data at least includes the obstacle positions of each obstacle in the specified spatial area in the camera coordinate system; and determine the reference grid having a mapping relationship with each obstacle position in the target point cloud data on the initial grid map, determine the first target grid having a mapping relationship with the camera position point, and determine the second target grid having a mapping relationship with the robot position point of the robot; the camera position point is the position when the camera collects the infrared speckle image, and the robot position point is the position where the center of the robot is located when the camera collects the infrared speckle image; and,
[0082] Based on the reference grid and the first target grid on the initial grid map, determine the occupied grid with the occupied state, the free grid with the free state, and the unknown grid, select at least one free grid and / or unknown grid within the specified range from the initial grid map, and update the selected grid to the occupied grid with the occupied state to obtain the target grid map, where the specified range is a range centered on the second target grid with a set distance r as the radius.
[0083] Optionally, obtaining the target point cloud data when the robot works in the specified spatial area includes:
[0084] Obtain the candidate point cloud data when the robot works in the specified spatial area;
[0085] Eliminate the positions that do not meet the requirements in the candidate point cloud data through a filtering operation to obtain the target point cloud data.
[0086] Optionally, further comprising, on the initial grid map, determining a reference grid having a mapping relationship with each obstacle position in the target point cloud data: updating the pixel value of the reference grid, and the updated pixel value is less than the pixel value before the update; wherein, the smaller the pixel value of any grid, the greater the probability that the grid is an occupied grid, and the larger the pixel value of any grid, the smaller the probability that the grid is an occupied grid.
[0087] Optionally, determining, on the initial grid map, an occupied grid in an occupied state, a free grid in a free state, and an unknown grid based on the reference grid and the first target grid includes:
[0088] For each reference grid, determining the shortest straight line segment from the reference grid to the first target grid, and updating the pixel value of the grid on the shortest straight line segment; the updated pixel value is greater than the pixel value before the update; for each grid on the initial grid map, determining whether the grid is an occupied grid, a free grid, or an unknown grid based on the pixel value of the grid; wherein, when the pixel value of the grid is a first preset value, it indicates that the grid is an unknown grid, when the pixel value of the grid is less than or equal to the set obstacle threshold, it indicates that the grid is an occupied grid, and when the pixel value of the grid is greater than the set obstacle threshold and less than the first preset value, it is determined that the grid is a free grid.
[0089] Optionally, further comprising, in determining the shortest straight line segment from the reference grid to the first target grid: for each grid on the shortest straight line segment, if the breakdown count of the grid has been recorded, increasing the recorded breakdown count of the grid by a second preset value, otherwise, recording the breakdown count of the grid as the second preset value;
[0090] Selecting, from the initial grid map, at least one free grid and / or an occupied grid with an unknown grid state in an occupied state includes: for each grid within a specified range on the initial grid map, if the grid is a free grid or an unknown grid, when the breakdown count of the grid meets the set requirements, updating the pixel value of the grid to a third preset value to indicate that the grid is updated to an occupied grid in an occupied state, and the third preset value is less than or equal to the set obstacle threshold;
[0091] Wherein, the breakdown count of the reference grid meeting the set requirements includes: the breakdown count of the reference grid at least meets the following conditions:
[0092]
[0093] Wherein, occ(i) represents the number of obstacle positions mapped to the i-th reference grid in the target point cloud data; threshold is a preset threshold for judging point cloud noise; befor_free(i) represents that if this is the first time to execute grid map construction, befor_free(i) is a fourth preset value such as 0, otherwise, befor_free(i) represents the breakdown times of the i-th grid when constructing the grid map based on the historical point cloud data obtained last time, and free(i) represents the breakdown times of the i-th grid; THRE is a fifth preset value.
[0094] So far, the description of the structure of the Figure 5 shown robot is completed.
[0095] The embodiment of the present application also provides a machine-readable storage medium, on which several computer instructions are stored. When the computer instructions are executed by a processor, the methods disclosed in the above examples of the present application can be implemented.
[0096] Exemplarily, the above machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as optical disk, DVD, etc.), or similar storage media, or a combination thereof.
[0097] The systems, devices, modules or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver device, a game console, a tablet computer, a wearable device, or a combination of any several of these devices.
[0098] For the convenience of description, when describing the above devices, they are described separately as various units according to functions. Of course, when implementing the present application, the functions of each unit can be implemented in one or more software and / or hardware.
[0099] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0100] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0101] Moreover, these computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing devices to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device that implements the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0102] These computer program instructions can also be loaded onto a computer or other programmable data processing devices, such that a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable devices provide steps for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0103] The above are only the embodiments of the present application and are not used to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. A method for constructing a grid map, characterized in that, this method is applied to a robot and includes: obtaining target point cloud data when the robot works in a specified spatial area; the target point cloud data is calculated based on a depth map and internal and external parameters of a camera, the depth map is obtained from a speckle image collected by the camera installed on the robot, and the target point cloud data at least includes the obstacle positions of each obstacle in the specified spatial area in the camera coordinate system; determining a reference grid on the initial grid map that has a mapping relationship with each obstacle position in the target point cloud data, determining a first target grid that has a mapping relationship with the camera position point, and determining a second target grid that has a mapping relationship with the robot position point of the robot; the camera position point is the position when the camera collects the speckle image, and the robot position point is the position where the center of the robot is located when the camera collects the speckle image; for each reference grid, determining the shortest straight line segment from this reference grid to the first target grid, and updating the pixel values of the grids on this shortest straight line segment; the updated pixel value is greater than the pixel value before the update; for each grid on the initial grid map, determining whether this grid is an occupied grid, a free grid, or an unknown grid according to the pixel value of this grid; wherein, when the pixel value of this grid is a first preset value, it indicates that this grid is an unknown grid, when the pixel value of this grid is less than or equal to a set obstacle threshold, it indicates that this grid is an occupied grid, and when the pixel value of this grid is greater than the set obstacle threshold and less than the first preset value, it is determined that this grid is a free grid; selecting at least one free grid and / or unknown grid within a specified range from the initial grid map, and updating the selected grids to occupied grids with an occupied state to obtain a target grid map, where the specified range is a range centered on the second target grid with a set distance r as the radius.
2. The method according to claim 1, characterized in that, obtaining the target point cloud data when the robot works in a specified spatial area includes: obtaining candidate point cloud data when the robot works in a specified spatial area; eliminating the positions that do not meet the requirements in the candidate point cloud data through a filtering operation to obtain the target point cloud data.
3. The method according to claim 1, characterized in that, further including in determining the reference grid on the initial grid map that has a mapping relationship with each obstacle position in the target point cloud data: updating the pixel value of the reference grid, and the updated pixel value is less than the pixel value before the update; wherein, the smaller the pixel value of any grid, the greater the probability that this grid is an occupied grid, and the larger the pixel value of any grid, the smaller the probability that this grid is an occupied grid.
4. The method according to claim 1, characterized in that, The determining of the shortest straight line segment from the reference grid to the first target grid further includes: for each grid on the shortest straight line segment, if the breakdown count of the grid has been recorded, increasing the recorded breakdown count of the grid by a second preset value; otherwise, recording the breakdown count of the grid as the second preset value; The selecting of at least one free grid and / or unknown grid within a specified range from the initial grid map and updating the selected grids to occupied grids with an occupied state includes: For each grid within the specified range on the initial grid map, if the grid is a free grid or an unknown grid, when the breakdown count of the grid meets the set requirements, updating the pixel value of the grid to a third preset value to indicate that the grid is updated to an occupied grid with an occupied state, where the third preset value is less than or equal to the set obstacle threshold.
5. The method according to claim 4, wherein, The breakdown count of the reference grid meeting the set requirements includes: The breakdown count of the reference grid at least meets the following conditions: wherein, occ(i) represents the number of obstacle positions in the target point cloud data mapped to the i-th reference grid; threshold is a preset point cloud noise judgment threshold; befor_free(i) represents that if this is the first time to execute the construction of the grid map, befor_free(i) is a fourth preset value, otherwise, befor_free(i) represents the breakdown count of the i-th grid when constructing the grid map based on the historical point cloud data obtained last time, and free(i) represents the breakdown count of the i-th grid; THRE is a fifth preset value.
6. A robot, wherein, The robot includes: A camera module, the camera module at least includes a camera and a transmitter; the transmitter is used to transmit signals, and the camera is used to collect the speckle image formed when the signals irradiate the object surface; A sensing module, for: Obtaining target point cloud data when the robot works in a specified spatial area; the target point cloud data is calculated based on a depth map and the internal and external parameters of the camera, the depth map is determined according to the speckle image collected by the camera, and the target point cloud data at least includes the obstacle positions of each obstacle in the specified spatial area in the camera coordinate system; and, Determining a reference grid on the initial grid map that has a mapping relationship with each obstacle position in the target point cloud data, determining a first target grid that has a mapping relationship with the camera position point, and determining a second target grid that has a mapping relationship with the robot position point of the robot; the camera position point is the position when the camera collects the speckle image, and the robot position point is the position where the center of the robot is located when the camera collects the speckle image; For each reference grid, determine the shortest straight line segment from the reference grid to the first target grid, and update the pixel values of the grids on this shortest straight line segment; the updated pixel value is greater than the pixel value before the update; for each grid on the initial grid map, determine whether the grid is an occupied grid, a free grid, or an unknown grid according to the pixel value of the grid; wherein, when the pixel value of the grid is the first preset value, it indicates that the grid is an unknown grid, when the pixel value of the grid is less than or equal to the set obstacle threshold, it indicates that the grid is an occupied grid, and when the pixel value of the grid is greater than the set obstacle threshold and less than the first preset value, determine that the grid is a free grid; and, Select at least one free grid and / or unknown grid within a specified range from the initial grid map, and update the selected grid to an occupied grid with an occupied state to obtain a target grid map, where the specified range is a range centered on the second target grid with a set distance r as the radius.
7. The robot according to claim 6, wherein, Obtaining the target point cloud data when the robot works in a specified spatial area includes: Obtaining the candidate point cloud data when the robot works in a specified spatial area; Eliminating the positions that do not meet the requirements in the candidate point cloud data through a filtering operation to obtain the target point cloud data; and / or, The further determination of the reference grid on the initial grid map that has a mapping relationship with each obstacle position in the target point cloud data further includes: updating the pixel value of the reference grid, and the updated pixel value is less than the pixel value before the update; wherein, the smaller the pixel value of any grid, the greater the probability that the grid is an occupied grid, and the larger the pixel value of any grid, the smaller the probability that the grid is an occupied grid.
8. The robot according to claim 6, wherein, The further determination of the shortest straight line segment from the reference grid to the first target grid further includes: for each grid on this shortest straight line segment, if the breakdown times of the grid have been recorded, then increase the recorded breakdown times of the grid by a second preset value, otherwise, record the breakdown times of the grid as the second preset value; The selection of at least one free grid and / or unknown grid state within a specified range from the initial grid map and the update of the selected grid to an occupied grid with an occupied state include: for each grid within the specified range on the initial grid map, if the grid is a free grid or an unknown grid, then when the breakdown times of the grid meet the set requirements, update the pixel value of the grid to a third preset value to indicate that the grid is updated to an occupied grid with an occupied state, and the third preset value is less than or equal to the set obstacle threshold; wherein, the breakdown times of the reference grid meeting the set requirements include: the breakdown times of the reference grid at least meet the following conditions: Wherein, occ(i) represents the number of obstacle positions mapped to the i-th reference grid in the target point cloud data; threshold is a preset point cloud noise judgment threshold; befor_free(i) represents that if it is the first time to execute the construction of the grid map, befor_free(i) is the fourth preset value, otherwise, befor_free(i) represents the breakdown times of the i-th grid when constructing the grid map based on the historical point cloud data obtained last time, free(i) represents the breakdown times of the i-th grid; THRE is the fifth preset value.
9. A machine-readable storage medium, characterized in that, the machine-readable storage medium stores machine-executable instructions that can be executed; when the machine-executable instructions are executed, the method steps of any one of claims 1-5 are implemented.
Citation Information
Patent Citations
Map construction method and device, terminal equipment and storage medium
CN114219905A
Path planning method and device of mobile equipment and navigation system
CN114355939A