Cost Map Generation Method, Device, Computer Equipment, and Storage Medium
By using at least two sensors to acquire point cloud data and combining forgetting processing algorithms to generate more accurate cost maps, the problem of low accuracy of cost maps caused by environmental volatility in the prior art is solved, and the robot's perception ability is improved.
Patent Information
- Application Number
- CN202210589410.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-27
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-05-27
AI Technical Summary
The existing cost map generation method is not accurate due to the volatile environment, making it difficult to effectively handle the grid state of the robot in the sensor blind spot.
At least two sensors are used to obtain the current frame point cloud data, update the grid state by projecting it into the grid map, and combine the preset forgetting processing algorithm to determine the current cost map corresponding to the sensor, and finally generate an output cost map.
Improve the accuracy of cost maps and enhance the robot's perception of the environment, especially in sensor blind areas, without affecting cost and data processing efficiency.
Smart Images

Figure CN114820973B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of environmental map modeling, and particularly to a cost map generation method, device, computer device, storage medium, and computer program product. Background Art
[0002] During the navigation process of a robot, a cost map is generally required to assist in navigation planning. Currently, the generation method of the cost map mainly relies on the fixed obstacle map generated during mapping. Due to the variability of the environment, the accuracy of its cost map is not high. Summary of the Invention
[0003] Based on this, in view of the above technical problems, it is necessary to provide a cost map generation method, device, computer device, computer-readable storage medium, and computer program product with higher accuracy.
[0004] In a first aspect, this application provides a cost map generation method. The method is applied to a robot, and at least two sensors are installed on the robot. The method includes:
[0005] Project the current position of the robot and the current frame point cloud data obtained by each of the at least two sensors into the corresponding current frame grid map to update the grid state of each grid in the current frame grid map;
[0006] Determine the current cost map corresponding to each sensor according to the grid state of each grid in each current frame grid map and a preset forgetting processing algorithm;
[0007] Determine the output cost map according to the current cost map corresponding to each sensor.
[0008] In one embodiment, the grid state includes occupied, free, and unknown; projecting the current position of the robot and the current frame point cloud data obtained by each of the at least two sensors into the corresponding current frame grid map to update the grid state of each grid in the current frame grid map includes:
[0009] Perform coordinate transformation according to the current position of the robot and the current frame point cloud data obtained by each sensor to determine the projection positions of the current position of the robot and the point cloud data in the current frame grid map;
[0010] For any grid in the current frame grid map, if there is projected point cloud data in any grid, set the grid state of any grid to occupied;
[0011] Determine the grids with free and unknown grid states in the current frame grid map according to the projection result of the current position of the robot in the current frame grid map and the grids with occupied grid states.
[0012] In one embodiment, determining the grids with free and unknown grid states in the current frame grid map according to the projection result of the current position of the robot in the current frame grid map and the grids with occupied grid states includes:
[0013] Taking the projection position of the current position of the robot in the current frame grid map as the starting point, emitting rays in all directions;
[0014] For any ray passing through a grid with an occupied grid state, setting the grid states of all grids passed by the ray between the grid with the occupied grid state passed by the ray and the position of the robot in the corresponding current frame grid map at the current moment to free;
[0015] Setting the grid states of the grids in the current frame grid map other than the grids with occupied and free grid states to unknown.
[0016] In one embodiment, the grid states include occupied, free, and unknown; determining the current cost map corresponding to each sensor according to the grid state of each grid in each current frame grid map and a preset forgetting processing algorithm includes:
[0017] If the grid state in the current frame grid map is occupied, setting the cost value of the corresponding grid in the current cost map to 1, and if the grid state in the current frame grid map is free, setting the cost value of the corresponding grid in the current cost map to 0;
[0018] If the grid state in the current frame grid map is unknown, determining the target grid corresponding to the grid with the unknown grid state in the previous cost map, where the previous cost map is the cost map output by projecting the previous frame of point cloud data obtained by the sensor onto the corresponding previous frame grid map;
[0019] Obtaining the target cost value of the target grid in the previous cost map, and determining the cost value of the grid with the unknown grid state in the current cost map corresponding to the sensor according to the preset forgetting processing algorithm and the target cost value.
[0020] In one embodiment, obtaining the target cost value of the target grid in the previous cost map, and determining the cost value of the grid with the unknown grid state in the current cost map corresponding to the sensor according to the preset forgetting processing algorithm and the target cost value includes:
[0021] If the cost value of the target grid in the previous cost map is greater than a preset threshold, calculating the cost value of the target grid in the current cost map corresponding to the sensor according to a first function, where the first function is a decreasing function with the current moment as the independent variable;
[0022] If the cost value of the target grid in the previous cost map is less than the preset threshold, then according to the second function, calculate the cost value of the target grid in the current cost map corresponding to the sensor. The second function is an increasing function with the current time as the independent variable;
[0023] If the cost value of the target grid in the previous cost map is equal to the preset threshold, then set the cost value of the target grid in the current cost map corresponding to the sensor to the preset constant.
[0024] In one of the embodiments, determining the output cost map according to the current cost map corresponding to each sensor includes:
[0025] For any grid in the output cost map, determine each cost value of the any grid in the current cost map corresponding to each sensor;
[0026] Take the maximum value among each cost value as the grid value corresponding to any grid in the output cost map.
[0027] In a second aspect, the present application also provides a cost map generation device. The device includes:
[0028] The first determination module is configured to project the current position of the robot and the current frame point cloud data acquired by each of at least two sensors into the corresponding current frame grid map to update the grid state of each grid in the current frame grid map;
[0029] The second determination module is configured to determine the current cost map corresponding to each sensor according to the grid state of each grid in each current frame grid map and the preset forgetting processing algorithm;
[0030] The third determination module is configured to determine the output cost map according to the current cost map corresponding to each sensor.
[0031] In a third aspect, the present application also provides a robot. The robot includes a memory and a processor. The memory stores a computer program. The processor, when executing the computer program, implements the following steps:
[0032] Project the current position of the robot and the current frame point cloud data acquired by each of at least two sensors into the corresponding current frame grid map to update the grid state of each grid in the current frame grid map;
[0033] Determine the current cost map corresponding to each sensor according to the grid state of each grid in each current frame grid map and the preset forgetting processing algorithm;
[0034] Determine the output cost map according to the current cost map corresponding to each sensor.
[0035] In one embodiment, the grid state includes occupied, free, and unknown; correspondingly, when the processor executes the computer program, the following steps are further implemented:
[0036] If the grid state in the current frame grid map is occupied, set the cost value of the corresponding grid in the current cost map to 1; if the grid state in the current frame grid map is free, set the cost value of the corresponding grid in the current cost map to 0.
[0037] If the grid state in the current frame grid map is unknown, determine the target grid in the previous cost map corresponding to the grid with the unknown grid state, where the previous cost map is the cost map output by projecting the previous frame of point cloud data acquired by the sensor onto the corresponding previous frame grid map.
[0038] Obtain the target cost value of the target grid in the previous cost map, and determine the cost value of the grid with the unknown grid state in the current cost map corresponding to the sensor according to the preset forgetting processing algorithm and the target cost value.
[0039] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium has a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
[0040] Project the current position of the robot and the current frame of point cloud data acquired by each of at least two sensors onto the corresponding current frame grid map to update the grid state of each grid in the current frame grid map.
[0041] Determine the current cost map corresponding to each sensor according to the grid state of each grid in each current frame grid map and the preset forgetting processing algorithm.
[0042] Determine the output cost map according to the current cost map corresponding to each sensor.
[0043] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0044] Project the current position of the robot and the current frame of point cloud data acquired by each of at least two sensors onto the corresponding current frame grid map to update the grid state of each grid in the current frame grid map.
[0045] Determine the current cost map corresponding to each sensor according to the grid state of each grid in each current frame grid map and the preset forgetting processing algorithm.
[0046] Determine the output cost map according to the current cost map corresponding to each sensor.
[0047] The above cost map generation method, device, computer device, storage medium, and computer program product include: projecting the current position of the robot and the current frame point cloud data acquired by each of at least two sensors onto the corresponding current frame grid map to update the grid state of each grid in the current frame grid map; determining the current cost map corresponding to each sensor according to the grid state of each grid in each current frame grid map and a preset forgetting processing algorithm; and determining the output cost map according to the current cost map corresponding to each sensor. By using the forgetting curve to process the grid state of the robot in the sensor blind area, fusing each layer after the update of each sensor layer, and combining historical data to determine the current cost map of the robot, and generating the cost map by referring to the human Ebbinghaus forgetting curve, the robot can process the problem of the perception blind area in a way that is more in line with human perception, increasing the perception area of the robot without affecting the cost and data processing efficiency. And on the one hand, fusing the current cost maps generated by at least two sensors to generate the output cost map effectively improves the diversity of sensor information, thereby improving the accuracy of the cost map. On the other hand, combining the current frame point cloud data makes it have better real-time performance, thus reducing the impact brought by environmental changes and improving the accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 is a schematic flowchart of the cost map generation method in one embodiment;
[0049] Figure 2 is a schematic flowchart of the cost map generation method in another embodiment;
[0050] Figure 3 is a schematic diagram of a ray during the cost map generation process in one embodiment;
[0051] Figure 4 is a partial schematic diagram of the grid map in one embodiment;
[0052] Figure 5 is a schematic flowchart of the cost map generation method in yet another embodiment;
[0053] Figure 6 is a function graph of the forgetting curve in one embodiment;
[0054] Figure 7 is a structural block diagram of the cost map generation device in one embodiment;
[0055] Figure 8 is an internal structure diagram of a computer device in one embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0056] In order to make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0057] The sensors of the robot are used to sense the external environment and provide navigation data for the robot. For the robot, it is desirable to have a wider view. For example, when the robot turns, due to the limited field of view of the sensors, it only sees the front and cannot see the two sides. At this time, the two sides are blind spots, and the cost map of the blind spots on both sides needs to be obtained when turning. The cost map is a two-dimensional or three-dimensional map established and updated by the robot collecting sensor information. It is a map with cost values constructed based on several layers. Generally, it is in the form of a grid, that is, a raster map. The raster value of each raster is within a certain range, and the size of the raster value represents three states of the raster: occupied (with obstacles), free area (without obstacles), and unknown area. For the cost map of the sensor blind spot, it is generally solved by increasing the number of sensors installed on the robot, but it will increase the sensor cost; or the robot rotates to obtain the cost map of the blind spots on both sides, but the obtained cost map is only the current detected state, and the working process of walking, rotating and detecting, and then walking will affect the efficiency of the robot.
[0058] To solve the above technical problems, in one embodiment, as Figure 1 shown, a cost map generation method is provided. The method is applied to a robot, and at least two sensors are installed on the robot, including:
[0059] Step 102, project the current position of the robot and the current frame point cloud data obtained by each of the at least two sensors into the corresponding current frame raster map to update the raster state of each raster in the current frame raster map;
[0060] Among them, the point cloud data is a set of vectors in a three-dimensional coordinate system with the sensor as the origin. Taking a lidar as an example, the lidar scans the surrounding environment with the emitted laser, represents the outer contour of the objects in the environment in the form of points, and each point contains three-dimensional coordinates. Some may also include color information or reflection intensity information. It can be seen that the point cloud data is three-dimensional data, while the cost map mentioned in this solution is a two-dimensional plane image. Therefore, the point cloud data needs to be projected into the raster map by projection to determine the cost map.
[0061] A raster map, also known as a rasterized map, refers to an image that has been discretized both spatially and in terms of brightness. The raster map divides the environment into a series of grids, and each grid is given a possible value representing the probability that the grid is occupied. In the solution of this application, after each acquisition of point cloud data, the same raster map is projected. However, after generating the cost map, the data in the raster map will be cleared, that is, when generating the current cost map from each point cloud data, the same grid in the raster map represents the same environment.
[0062] It should be noted that a robot senses the surrounding environment through sensors. Usually, at least two sensors are installed on the robot, such as a single-line lidar, a multi-line lidar, and a depth camera. Among them, the single-line lidar and the multi-line lidar acquire point cloud data, and the depth camera determines the position of the objects in the image through the acquired depth image, which can also be represented in the form of point clouds.
[0063] Specifically, through the relative relationship between the sensor coordinate system and the map coordinate system, the current frame of point cloud data is projected onto the current frame of raster map. Through the relative relationship between the robot coordinate system and the map coordinate system, the position of the robot is also projected onto the current frame of raster map. The grid state of each grid in the current frame of raster map is determined according to the number of point clouds falling into each grid in the current frame of raster map. For example, a point cloud quantity threshold can be set. When the number of point clouds falling into the grid is greater than this threshold, it is considered that the grid is occupied, or as long as there is a point cloud falling into the grid, it is considered to be in an occupied state. Among them, for the current frame of raster map, before the projection of the current frame of point cloud data, the current frame of raster map is blank.
[0064] Step 104, determine the current cost map corresponding to each sensor according to the grid state of each grid in each current frame of raster map and a preset forgetting processing algorithm;
[0065] According to the above explanation of the raster map, each grid has a grid value representing the probability that the grid is occupied. Thus, it can be known that the grid value of each grid is determined according to whether the point cloud or the position of the robot is projected onto the grid, and the grid state of the grid is determined according to the grid value of each grid.
[0066] It should be noted that due to the laser emission angle of the lidar itself and the installation angle of the lidar on the robot, the field of view that the robot can "see" is limited. However, considering that during the walking process of the robot, for the same sensor, for example, in the previous cost map determined from the previous frame of point cloud data acquired by the lidar, there is a large similarity with the current cost map generated from the currently acquired frame of point cloud data. Therefore, the relationship between the cost maps corresponding to two adjacent acquisition times can be utilized to predict the current cost map from the previous cost map.
[0067] In an alternative embodiment, each sensor corresponds to its own current grid map. Correspondingly, for each sensor, its own current cost map is also provided.
[0068] In an alternative embodiment, for the current grid map corresponding to the sensor, specifically, it can be a set of grid maps formed by all the point cloud data accumulated by the sensor since the current power-on. Optionally, at T = 0, the sensor starts to collect the point cloud data of area A, and the current frame grid map it obtains corresponds to area A. When the robot is continuously moving and at T = 1, the sensor collects the point cloud data of area B, then its current frame grid map corresponds to the union area of area A and area B, and accumulates in this way successively.
[0069] Therefore, after running for a period of time, there will be three grid states for the grid in the current frame grid map: occupied, free, and unknown. Among them, the grid states of the part directly perceivable by the sensor in the current frame grid map are either free or occupied, and the grid states of the part that the sensor cannot perceive at this time are unknown.
[0070] In another alternative embodiment, the current frame grid map can be a global grid map (i.e., the grid map constructed by the robot during the mapping process). After the robot is restarted, each frame of the grid map is initialized so that its grid states are all unknown, that is, the grid states of the current frame grid map are all unknown. Subsequently, after projecting the current frame point cloud data obtained by the sensor, the grid states of the current frame grid map are updated. For the grid directly projected by the current frame point cloud data, the grid state is changed to occupied, and the grid corresponding to the current position of the robot and the grid between the grid corresponding to the current position and the grid with the grid state of occupied are changed to free, and the grid states that cannot be projected by other previous frame point cloud data (i.e., the blind area of the sensor) are unknown.
[0071] However, for the robot, since it is constantly moving, the grid state of a certain grid in the current frame grid map is unknown, but the grid state corresponding to this grid in the previous frame grid map may be occupied or free. Therefore, the previous cost map corresponding to the previous frame grid map can be used to update the current cost map of the current frame grid map.
[0072] Specifically, a forgetting mechanism based on the human Ebbinghaus forgetting curve can be adopted to consider the influence of time on the correlation between the previous cost map and the current cost map. For example, for any sensor, if the current cost map corresponds to time T, then the previous cost map corresponds to time T-1. The grid value of each grid in the cost map at time T is calculated using the cost map at time T-1. It can be understood that the grid value at time T-1 is also related to the grid value at time T-2, and so on. A more accurate and larger-scale current cost map can be obtained based on the grid values in the historical cost map.
[0073] Step 106: Determine the output cost map according to the current cost map corresponding to each sensor.
[0074] It should be noted that there are generally multiple sensors on existing robots, such as single-line lidar, multi-line lidar, depth cameras, etc. For the current cost map generated by each sensor at the current moment, current cost map fusion can be performed to obtain a more accurate cost map. Specifically, taking 3 sensors as an example, for each grid, there will be 3 grid values. The maximum value among the 3 grid values can be used as the grid value corresponding to the current cost map, and then the state of the grid can be judged. Or the average value of the 3 grid values can be used as the grid value corresponding to the current cost map. Among them, the method used to determine the grid value in the current cost map corresponding to each sensor is not specifically limited here. The method in this solution can be adopted, or other methods can be found.
[0075] In addition, it should be noted that after determining the grid state of each grid based on the current frame point cloud data obtained by the sensor, the previous cost map corresponding to the sensor can also be used to predict the grid state of each grid in the current cost map. That is, not only the forgetting processing algorithm is used to predict the grid state in the sensor blind area, but the whole can be predicted, and then combined with the grid state of each grid in the current frame grid map determined by the current frame point cloud data to determine the current cost map corresponding to the sensor. Specifically, the two can be superimposed to determine the grid value of each grid in the current frame grid map. For the grids in the overlapping part, the grid value determined by the current frame point cloud data can be used as the standard, or the grid value corresponding to the previous cost map can be used as the standard, or the combination of the two can be obtained through a preset calculation formula.
[0076] In the method provided by the above embodiments, the current position of the robot and the current frame point cloud data obtained by each of at least two sensors are projected onto the corresponding current frame grid map to update the grid state of each grid in the current frame grid map; according to the grid state of each grid in each current frame grid map and a preset forgetting processing algorithm, the current cost map corresponding to each sensor is determined; and according to the current cost map corresponding to each sensor, the output cost map is determined. By using the forgetting curve to process the grid state of the robot in the sensor blind area, after each sensor layer is updated, the layers are fused, and the historical data is combined to determine the current cost map of the robot. By referring to the human Ebbinghaus forgetting curve to generate the cost map, the robot can process the problem of the perception blind area in a way that is more in line with human perception, increasing the perception area of the robot without affecting the cost and data processing efficiency.
[0077] In one of the embodiments, referring to Figure 2 , the grid state includes occupied, free, and unknown; correspondingly, projecting the current position of the robot and the current frame point cloud data obtained by each of at least two sensors onto the corresponding current frame grid map to update the grid state of each grid in the current frame grid map includes:
[0078] Step 202: Perform coordinate transformation according to the current position of the robot and the current frame point cloud data obtained by each sensor to determine the projection positions of the current position of the robot and the current frame point cloud data in the current frame grid map;
[0079] Among them, the current position of the robot is the data obtained according to the pose sensor of the robot, and this position data is in the coordinate system with the robot as the coordinate origin. The current frame point cloud data obtained by the sensor is in the coordinate system with the position of the sensor as the coordinate origin. When analyzing the current frame grid map according to the current frame point cloud data, all data needs to be converted into data in the same coordinate system.
[0080] Specifically, obtain the position and attitude data of the robot and the installation parameters of the sensor on the robot. Among them, the attitude data refers to the three-dimensional attitude data obtained by the robot through the sensor, which is represented by the angle between the "line of sight" of the robot at the current moment and the coordinate system; the installation parameters refer to the installation position and angle of the sensor on the robot; the attitude data and the installation parameters reflect the relative position relationship between the sensor, the robot coordinate system, and the world coordinate system. The preset resolution is used to convert the three-dimensional data in the world coordinate system into two-dimensional plane data in the map coordinate system. Through the relative relationship between all data, all the obtained point clouds are projected into the map coordinate system where the current frame grid map is located.
[0081] Step 204: For any grid in the current frame grid map, if there is projected current frame point cloud data in any grid, the grid state of any grid is set to occupied.
[0082] It can be understood that the point cloud is the position where "obstacles" may exist obtained by the sensor. Taking lidar as an example, when the lidar detects the surrounding environment, it is based on the principle that the emitted laser is reflected, and obtains the laser reflected by the "obstacle", and thus represents the position of the "obstacle" in the form of a point cloud vector. Therefore, in the current frame grid map, if there is projected point cloud data in the grid, it means that there is an "obstacle" at the position represented by this grid in the application scenario, and the grid state of this grid is set to occupied.
[0083] Step 206: Determine the grids with free and unknown grid states in the current frame grid map according to the projection result of the current position of the robot in the current frame grid map and the grids with occupied grid states.
[0084] It should be noted that in a specific embodiment, a grid value of 1 indicates that the state of the grid is occupied, that is, there is an "obstacle" at this grid, and a grid value of 0 indicates that the state of the grid is a free area. It can be understood that when the current frame point cloud data of the sensor is projected into the grid, the state of the grid at the current moment can be determined to be occupied, and the grid value is set to 1. And the grids within the field of view of the sensor and surrounded by "obstacles" are in a free state, and the remaining grids are the blind areas of the sensor, and the grid state is unknown.
[0085] In the method provided in the above embodiment, coordinate transformation is performed according to the current position of the robot and the current frame point cloud data obtained by each sensor to determine the projection positions of the current position of the robot and the current frame point cloud data in the current frame grid map; for any grid in the current frame grid map, if there is projected current frame point cloud data in any grid, the grid state of any grid is set to occupied; determine the grids with free and unknown grid states in the current frame grid map according to the projection result of the current position of the robot in the current frame grid map and the grids with occupied grid states. According to the projection situation of the current frame point cloud data of the sensor, the grid value of the grid is determined, and then according to the principle of the data obtained by the sensor, the grids in the free state are determined from the current position of the robot and the position of the obstacle, ensuring the accuracy of the generated cost map.
[0086] In one of the embodiments, determine the grids with free and unknown grid states in the initial grid according to the projection result of the current position of the robot in the current frame grid map and the grids with occupied grid states.
[0087] Starting from the projection position of the current position of the robot in the current frame grid map, emit rays in all directions.
[0088] For any ray passing through a grid with an occupied state, set the grid states of all grids passed by the ray between the grid with an occupied state passed by the ray and the position of the robot in the corresponding current frame grid map at the current moment to free;
[0089] Set the grid states of grids in the current frame grid map other than the occupied and free grid states to unknown.
[0090] Taking the sensor as a lidar as an example, when the lidar detects the surrounding environment, it obtains the laser reflected by the "obstacle" based on the principle of laser reflection, and determines the point cloud data accordingly. Then, it can be understood that since the ray is a straight line, there is no obstacle between the lidar emission point (approximately the position of the robot) and the position with an "obstacle", that is, the free movement area of the robot. See Figure 3 , after determining the position of the "obstacle", rays can be emitted from the position of the robot until the grid value encountered is 1. After traversing all grids with a grid value of 1, connect the lines between them and the position of the robot, and set the grid values of all grids passed by the straight line to 0. See Figure 4 , where the black grid represents the occupied grid state, the white grid represents the free grid state, and the gray grid represents the unknown grid state.
[0091] In the method provided by the above embodiment, taking the projection position of the current position of the robot in the current frame grid map as the starting point, rays are emitted in all directions; for any ray passing through a grid with an occupied state, set the grid states of all grids passed by the ray between the grid with an occupied state passed by the ray and the position of the robot in the corresponding current frame grid map at the current moment to free; set the grid states of grids in the current frame grid map other than the occupied and free grid states to unknown. Taking the position of the robot as the starting point, rays are emitted in all directions; combined with the detection principle of the lidar, the free and unknown grids are determined in the form of rays, ensuring the accuracy of the cost map.
[0092] In one of the embodiments, see Figure 5 , the grid states include occupied, free, and unknown; correspondingly, based on a preset forgetting processing algorithm, according to the grid state of each grid in each current frame grid map, determine the current cost map corresponding to each sensor, including:
[0093] Step 502, if the grid state in the current frame grid map is occupied, set the cost value of the corresponding grid in the current cost map to 1, and if the grid state in the current frame grid map is free, set the cost value of the corresponding grid in the current cost map to 0;
[0094] Step 504, if the grid state in the current frame grid map is unknown, determine the target grid corresponding to the grid with unknown state in the previous cost map. The previous cost map is the cost map output based on the projection of the previous frame of point cloud data obtained by the sensor onto the corresponding previous frame of grid map.
[0095] Step 506, obtain the target cost value of the target grid in the previous cost map, and determine the cost value of the grid with unknown state in the current cost map corresponding to the sensor according to the preset forgetting processing algorithm and the target cost value.
[0096] It should be noted that in the process of obtaining the cost map based on the current frame of point cloud data of the sensor, first obtain the position of the obstacle in the grid map, then regard the moving robot as a particle to form a configuration space, and then convert the grid map into a weighted graph as a layer, and then obtain the cost map. Therefore, in this embodiment, for the sake of easy understanding, the process of converting to the weighted graph layer is not explained. The grid corresponding to the current cost map is the grid corresponding to the grid in the current frame grid map after conversion. That is, the area represented by the grid map of the obstacle has a one-to-one corresponding position in the formed initial cost map, which is represented by the grid here.
[0097] Specifically, the cost map is a floating-point map, which represents the cost of the robot passing through the position in the cost map with a cost value ranging from 0.0 to 1.0. For example, set the cost value corresponding to the grid with an occupied state in the current frame grid map in the current cost map to 1.0, indicating that the robot cannot reach this area, and there are obstacles in this area. If the robot reaches or passes through, it needs to pay a large cost. Set the cost value corresponding to the grid with a free state in the current frame grid map in the current cost map to 0.0, indicating that the robot can move freely at this position or area. For the remaining grids in the cost map, which belong to the blind area of the sensor's representative area, they can be calculated according to the forgetting curve through the previous cost map corresponding to the sensor. For example, there are 2 sensors installed on the robot, namely lidar and depth camera. For the grids at the grid state positions determined by the current frame of point cloud obtained by the lidar in the current frame grid map, they are predicted by using the previous cost map generated by the lidar according to the previous frame of point cloud data. When the lidar generates the current cost map, the cost map data of the depth camera is not used. Before the output cost maps of different sensors are fused, data sharing is not performed.
[0098] In the method provided in the above embodiment, the cost map is generated by referring to the human Ebbinghaus forgetting curve, enabling the robot to handle the problem of the perception blind area in a way that is more in line with human perception, and increasing the robot's perception area without affecting the cost and data processing efficiency.
[0099] In one embodiment, the target cost value of the target grid in the previous cost map is obtained, and according to a preset forgetting processing algorithm and the target cost value, the cost value of the grid with an unknown grid state in the current cost map corresponding to the sensor is determined, including:
[0100] If the cost value of the target grid in the previous cost map is greater than a preset threshold, then according to the first function, the cost value of the target grid in the current cost map corresponding to the sensor is calculated, and the first function is a decreasing function with the current time as the independent variable;
[0101] If the cost value of the target grid in the previous cost map is less than the preset threshold, then according to the second function, the cost value of the target grid in the current cost map corresponding to the sensor is calculated, and the second function is an increasing function with the current time as the independent variable;
[0102] If the cost value of the target grid in the previous cost map is equal to the preset threshold, then the cost value of the target grid in the current cost map corresponding to the sensor is set to a preset constant.
[0103] It should be noted that the law of forgetting of new things by the human brain conforms to the Ebbinghaus forgetting curve. When a robot detects the surrounding environment to obtain a cost map, if a forgetting mechanism is used to connect the previous detection time and the current detection time, the behavior of the robot will be more in line with the intelligent expectation. See Figure 6 , a forgetting curve that can be used for generating the current cost map is provided. Curve 1 is the first function, and Curve 2 is the second function. The specific formulas are as follows:
[0104]
[0105] Among them, t represents the number of frames, that is, one acquisition of data by the sensor is 1 frame; f(t) represents the grid value of the grid in the cost map generated after the t-th acquisition of data; f(t + 1) represents the grid value of the grid in the cost map generated after the sensor's (t + 1)-th acquisition of point cloud data. It should be noted that each calculation is for one grid.
[0106] According to the formula, it can be known that when predicting the cost value of the grid in the current cost map of the sensor, the influence of the cost value of the grid in the previous cost map of the sensor on the cost value of the grid in the current cost map conforms to the forgetting law and both tend to a preset constant. Among them, the preset constant generally takes the middle value of the grid value range, representing the unknown area.
[0107] In the method provided by the above embodiment, if the cost value of the corresponding grid in the previous cost map is greater than the preset threshold, the cost value of the corresponding grid in the current cost map corresponding to each sensor is calculated according to the first function, where the first function is a decreasing function with the current time as the independent variable; if the cost value of the corresponding grid in the previous cost map is less than the preset threshold, the cost value of the corresponding grid in the current cost map corresponding to each sensor is calculated according to the second function, where the second function is an increasing function with the current time as the independent variable; if the cost value of the corresponding grid in the previous cost map is equal to the preset threshold, the cost value of the corresponding grid in the current cost map corresponding to each sensor is set to a preset constant. The cost map is generated by referring to the human Ebbinghaus forgetting curve, enabling the robot to process the problem of the perception blind area in a way more in line with human perception, and increasing the robot's perception area without affecting the cost and data processing efficiency.
[0108] In one of the embodiments, determining the output cost map according to the current cost map corresponding to each sensor includes:
[0109] For any grid in the output cost map, determine each cost value of the any grid in the current cost map corresponding to each sensor;
[0110] Take the maximum value among each cost value as the grid value corresponding to any grid in the output cost map.
[0111] It can be understood that when the robot generates a cost map using the data of multiple sensors, the current cost map generated by each sensor serves as a layer, and multiple layers are fused to obtain the final output current cost map. For example, the robot is equipped with three sensors: a single-line lidar, a multi-line lidar, and a depth camera. The sensors respectively obtain the corresponding current cost maps LaserMap, LidarMap, and RGBDMap according to the forgetting processing algorithm; traverse all grids in the current cost map, and take the maximum value corresponding to each grid in LaserMap, LidarMap, and RGBDMap as the final cost value. If the maximum value is greater than 0.7, the value on the cost map is set to occupied; if the maximum value is less than 0.3, the value on the cost map is set to free; otherwise, it is set to unknown.
[0112] In the method provided by the above embodiment, for any grid in the output cost map, determine each cost value of the any grid in the current cost map corresponding to each sensor; take the maximum value among each cost value as the grid value corresponding to any grid in the output cost map. The final cost map is obtained through multi-sensor data fusion, making full use of all data, fully identifying the perceived area, and obtaining a more accurate cost map.
[0113] It should be understood that although the steps in the flowcharts involved in the above embodiments are sequentially shown according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0114] Based on the same inventive concept, an embodiment of the present application also provides a cost map device for implementing the cost map generation method involved above. The implementation solutions provided by this device to solve problems are similar to the implementation solutions described in the above method. Therefore, the specific limitations in one or more embodiments of the cost map device provided below can refer to the limitations on the cost map method in the above text, and will not be repeated here.
[0115] In one embodiment, as Figure 7 shown, a cost map generation device is provided, including a first determination module 701, a second determination module 702, and a third determination module 703, specifically:
[0116] The first determination module 701 is configured to project the current position of the robot and the current frame point cloud data acquired by each of at least two sensors into the corresponding current frame grid map to update the grid state of each grid in the current frame grid map;
[0117] The second determination module 702 is configured to determine the current cost map corresponding to each sensor according to the grid state of each grid in each current frame grid map and a preset forgetting processing algorithm;
[0118] The third determination module 703 is configured to determine the output cost map according to the current cost map corresponding to each sensor.
[0119] In one of the embodiments, the first determination module 701 is further configured to:
[0120] Perform coordinate transformation according to the current position of the robot and the current frame point cloud data acquired by each sensor to determine the projection position of the current position of the robot and the current frame point cloud data in the current frame grid map;
[0121] For any grid in the current frame grid map, if there is projected current frame point cloud data in any grid, the grid state of any grid is set to occupied;
[0122] Determine the grids with free and unknown grid states in the current frame grid map according to the projection result of the current position of the robot in the current frame grid map and the grids with occupied grid states.
[0123] In one embodiment, the first determination module 701 is further configured to:
[0124] Emit rays in all directions starting from the projection position of the current position of the robot in the current frame grid map;
[0125] For any ray passing through a grid with an occupied grid state, set the grid states of all grids passed by the any ray between the grid with the occupied grid state passed by the any ray and the position of the robot in the corresponding current frame grid map at the current moment to free;
[0126] Set the grid states of the grids in the current frame grid map other than the occupied and free grid states to unknown.
[0127] In one embodiment, the grid states include occupied, free, and unknown; correspondingly, the second determination module 702 is further configured to:
[0128] If the grid state in the current frame grid map is occupied, set the cost value of the corresponding grid in the current cost map to 1, and if the grid state in the current frame grid map is free, set the cost value of the corresponding grid in the current cost map to 0;
[0129] If the grid state in the current frame grid map is unknown, determine the target grid corresponding to the grid with the unknown grid state in the previous cost map, where the previous cost map is the cost map output by projecting the previous frame of point cloud data acquired by the sensor onto the corresponding previous frame grid map;
[0130] Obtain the target cost value of the target grid in the previous cost map, and determine the cost value of the grid with the unknown grid state in the current cost map corresponding to the sensor according to the preset forgetting processing algorithm and the target cost value.
[0131] In one embodiment, the second determination module 702 is further configured to:
[0132] If the cost value of the target grid in the previous cost map is greater than a preset threshold, calculate the cost value of the target grid in the current cost map corresponding to the sensor according to the first function, where the first function is a decreasing function with the current moment as the independent variable;
[0133] If the cost value of the target grid in the previous cost map is less than a preset threshold, calculate the cost value of the target grid in the current cost map corresponding to the sensor according to the second function, where the second function is an increasing function with the current moment as the independent variable;
[0134] If the cost value of the target grid in the previous cost map is equal to the preset threshold, set the cost value of the target grid in the current cost map corresponding to the sensor to the preset constant.
[0135] In one embodiment, the third determination module 703 is further configured to:
[0136] For any grid in the output cost map, determine each cost value of the grid in the current cost map corresponding to each sensor;
[0137] Take the maximum value among each cost value as the grid value corresponding to any grid in the output cost map.
[0138] Each module in the above cost map generation device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.
[0139] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as Figure 8 shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the point cloud data acquired by the lidar. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a cost map generation method.
[0140] Those skilled in the art can understand that Figure 8 the structure shown in
[0141] is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0142] Project the current position of the robot and the current frame point cloud data obtained by each of at least two sensors onto the corresponding current frame grid map to update the grid state of each grid in the current frame grid map;
[0143] Determine the current cost map corresponding to each sensor according to the grid state of each grid in each current frame grid map and a preset forgetting processing algorithm;
[0144] Determine the output cost map according to the current cost map corresponding to each sensor.
[0145] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0146] Perform coordinate transformation according to the current position of the robot and the current frame point cloud data obtained by each sensor to determine the projection positions of the current position of the robot and the current frame point cloud data in the current frame grid map;
[0147] For any grid in the current frame grid map, if there is projected current frame point cloud data in any grid, set the grid state of any grid to occupied;
[0148] Determine the grids with free and unknown grid states in the current frame grid map according to the projection result of the current position of the robot in the current frame grid map and the grids with occupied grid states.
[0149] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0150] Take the projection position of the current position of the robot in the current frame grid map as the starting point and emit rays in all directions;
[0151] For any ray passing through a grid with an occupied grid state, set the grid states of all grids passed by any ray between the grid with the occupied grid state passed by and the position of the robot in the corresponding current frame grid map at the current moment to free;
[0152] Set the grid states of the grids in the current frame grid map other than the occupied and free grid states to unknown.
[0153] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0154] If the grid state in the current frame grid map is occupied, set the cost value of the corresponding grid in the current cost map to 1. If the grid state in the current frame grid map is free, set the cost value of the corresponding grid in the current cost map to 0;
[0155] If the grid status in the current frame grid map is unknown, determine the target grid in the previous cost map corresponding to the grid with unknown grid status. The previous cost map is the cost map output by projecting the previous frame of point cloud data obtained by the sensor onto the corresponding previous frame grid map;
[0156] Obtain the target cost value of the target grid in the previous cost map, and determine the cost value of the grid with unknown grid status in the current cost map corresponding to the sensor according to the preset forgetting processing algorithm and the target cost value.
[0157] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0158] If the cost value of the target grid in the previous cost map is greater than the preset threshold, calculate the cost value of the target grid in the current cost map corresponding to the sensor according to the first function. The first function is a decreasing function with the current time as the independent variable;
[0159] If the cost value of the target grid in the previous cost map is less than the preset threshold, calculate the cost value of the target grid in the current cost map corresponding to the sensor according to the second function. The second function is an increasing function with the current time as the independent variable;
[0160] If the cost value of the target grid in the previous cost map is equal to the preset threshold, set the cost value of the target grid in the current cost map corresponding to the sensor to the preset constant.
[0161] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0162] For any grid in the output cost map, determine each cost value of the any grid in the current cost map corresponding to each sensor;
[0163] Take the maximum value among each cost value as the grid value corresponding to any grid in the output cost map.
[0164] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0165] Project the current position of the robot and the current frame of point cloud data obtained by each sensor in at least two sensors onto the corresponding current frame grid map to update the grid status of each grid in the current frame grid map;
[0166] Determine the current cost map corresponding to each sensor according to the grid status of each grid in each current frame grid map and the preset forgetting processing algorithm;
[0167] Determine the output cost map according to the current cost map corresponding to each sensor.
[0168] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0169] Perform coordinate transformation based on the current position of the robot and the current frame point cloud data obtained by each sensor, and determine the projection position of the current position of the robot and the point cloud data in the current frame grid map;
[0170] For any grid in the current frame grid map, if there is projected point cloud data in any grid, set the grid state of any grid to occupied;
[0171] Determine the grids with free and unknown grid states in the current frame grid map according to the projection result of the current position of the robot in the current frame grid map and the grids with occupied grid states.
[0172] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0173] Starting from the projection position of the current position of the robot in the current frame grid map, emit rays in all directions;
[0174] For any ray passing through a grid with an occupied grid state, set the grid states of all grids passed by any ray between the grid with an occupied grid state passed by and the position of the robot in the corresponding current frame grid map at the current moment to free;
[0175] Set the grid states of the grids in the current frame grid map other than the occupied and free grid states to unknown.
[0176] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0177] If the grid state in the current frame grid map is occupied, set the cost value of the corresponding grid in the current cost map to 1. If the grid state in the current frame grid map is free, set the cost value of the corresponding grid in the current cost map to 0;
[0178] If the grid state in the current frame grid map is unknown, determine the target grid corresponding to the grid with an unknown grid state in the previous cost map. The previous cost map is the cost map output by projecting the previous frame point cloud data obtained by the sensor onto the corresponding previous frame grid map;
[0179] Obtain the target cost value of the target grid in the previous cost map, and determine the cost value of the grid with an unknown grid state in the current cost map corresponding to the sensor according to the preset forgetting processing algorithm and the target cost value.
[0180] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0181] If the cost value of the target grid in the previous cost map is greater than a preset threshold, then according to the first function, calculate the cost value of the target grid in the current cost map corresponding to the sensor. The first function is a decreasing function with the current time as the independent variable;
[0182] If the cost value of the target grid in the previous cost map is less than the preset threshold, then according to the second function, calculate the cost value of the target grid in the current cost map corresponding to the sensor. The second function is an increasing function with the current time as the independent variable;
[0183] If the cost value of the target grid in the previous cost map is equal to the preset threshold, then set the cost value of the target grid in the current cost map corresponding to the sensor to a preset constant.
[0184] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0185] For any grid in the output cost map, determine the cost value of any grid in the current cost map corresponding to each sensor;
[0186] Take the maximum value among each cost value as the grid value corresponding to any grid in the output cost map.
[0187] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0188] Project the current position of the robot and the current frame point cloud data acquired by each of at least two sensors into the corresponding current frame grid map to update the grid state of each grid in the current frame grid map;
[0189] According to the grid state of each grid in each current frame grid map and a preset forgetting processing algorithm, determine the current cost map corresponding to each sensor;
[0190] Determine the output cost map according to the current cost map corresponding to each sensor.
[0191] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0192] Perform coordinate transformation according to the current position of the robot and the current frame point cloud data acquired by each sensor to determine the projection position of the current position of the robot and the point cloud data in the current frame grid map;
[0193] For any grid in the current frame grid map, if there is projected point cloud data in any grid, the grid state of any grid is set to occupied;
[0194] Based on the projection result of the current position of the robot in the current frame grid map and the grids with the grid state of occupied, determine the grids with the grid state of free and unknown in the current frame grid map.
[0195] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0196] Taking the projection position of the current position of the robot in the current frame grid map as the starting point, emit rays in all directions;
[0197] For any ray passing through a grid with the grid state of occupied, set the grid states of all grids passed by the ray between the grid with the grid state of occupied passed by the ray and the position of the robot in the corresponding current frame grid map at the current moment to free;
[0198] Set the grid states of the grids in the current frame grid map other than the grids with the grid states of occupied and free to unknown.
[0199] In one embodiment, the grid state includes occupied, free, and unknown; when the computer program is executed by the processor, the following steps are further implemented:
[0200] If the grid state in the current frame grid map is occupied, set the cost value of the corresponding grid in the current cost map to 1, and if the grid state in the current frame grid map is free, set the cost value of the corresponding grid in the current cost map to 0;
[0201] If the grid state in the current frame grid map is unknown, determine the target grid corresponding to the grid with the grid state of unknown in the previous cost map, where the previous cost map is the cost map output by projecting the previous frame of point cloud data obtained by the sensor onto the corresponding previous frame grid map;
[0202] Obtain the target cost value of the target grid in the previous cost map, and determine the cost value of the grid with the grid state of unknown in the current cost map corresponding to the sensor according to the preset forgetting processing algorithm and the target cost value.
[0203] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0204] If the cost value of the target grid in the previous cost map is greater than the preset threshold, calculate the cost value of the target grid in the current cost map corresponding to the sensor according to the first function, where the first function is a decreasing function with the current moment as the independent variable;
[0205] If the cost value of the target grid in the previous cost map is less than a preset threshold, then according to the second function, calculate the cost value of the target grid in the current cost map corresponding to the sensor, where the second function is an increasing function with the current time as the independent variable;
[0206] If the cost value of the target grid in the previous cost map is equal to the preset threshold, then set the cost value of the target grid in the current cost map corresponding to the sensor to a preset constant.
[0207] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0208] For any grid in the output cost map, determine each cost value of the any grid in the current cost map corresponding to each sensor;
[0209] Take the maximum value among each cost value as the grid value corresponding to any grid in the output cost map.
[0210] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0211] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0212] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A cost map generation method, characterized in that, The method is applied to a robot, and at least two sensors are installed on the robot. The method includes: Projecting the current position of the robot and the current frame point cloud data obtained by each of the at least two sensors into corresponding current frame grid maps to update the grid state of each grid in the current frame grid map; the grid state includes occupied, free, and unknown; If the grid state in the current frame grid map is occupied, set the cost value of the corresponding grid in the current cost map to 1. If the grid state in the current frame grid map is free, set the cost value of the corresponding grid in the current cost map to 0; If the grid state in the current frame grid map is unknown, determine the target grid in the previous cost map corresponding to the grid with the unknown grid state. The previous cost map is the cost map output based on the previous frame point cloud data obtained by the sensor projected into the corresponding previous frame grid map; Obtain the target cost value of the target grid in the previous cost map, and determine the cost value of the grid with the unknown grid state in the current cost map corresponding to the sensor according to a preset forgetting processing algorithm and the target cost value; For any grid in the output cost map, determine each cost value of the any grid in the current cost map corresponding to each sensor; Take the maximum value among each cost value as the grid value corresponding to any grid in the output cost map.
2. The method according to claim 1, wherein The grid state includes occupied, free, and unknown; the step of projecting the current position of the robot and the current frame point cloud data obtained by each of the at least two sensors into corresponding current frame grid maps to update the grid state of each grid in the current frame grid map includes: Perform coordinate transformation according to the current position of the robot and the current frame point cloud data obtained by each sensor to determine the projection positions of the current position of the robot and the current frame point cloud data in the current frame grid map; For any grid in the current frame grid map, if there is projected current frame point cloud data in the any grid, set the grid state of the any grid to occupied; Determine the grids with free and unknown grid states in the current frame grid map according to the projection result of the current position of the robot in the current frame grid map and the grids with occupied grid states.
3. The method according to claim 2, wherein The step of determining the grids with free and unknown grid states in the current frame grid according to the projection result of the current position of the robot in the current frame grid map and the grids with occupied grid states includes: Emit rays in all directions starting from the projection position of the current position of the robot in the current frame grid map; For any ray passing through a grid with an occupied grid state, set the grid states of all grids passed by the any ray between the grid with the occupied grid state passed by the any ray and the position of the robot in the corresponding current frame grid map at the current moment to free; Set the grid states of the grids in the current frame grid map other than the grids with occupied and free grid states to unknown.
4. The method according to claim 1, wherein Obtaining the target cost value of the target grid in the previous cost map, and determining the cost value of the grid with an unknown grid state in the current cost map corresponding to the sensor according to a preset forgetting processing algorithm and the target cost value, includes: If the cost value of the target grid in the previous cost map is greater than a preset threshold, then according to a first function, calculate the cost value of the target grid in the current cost map corresponding to the sensor, where the first function is a decreasing function with the current time as the independent variable; If the cost value of the target grid in the previous cost map is less than the preset threshold, then according to a second function, calculate the cost value of the target grid in the current cost map corresponding to the sensor, where the second function is an increasing function with the current time as the independent variable; If the cost value of the target grid in the previous cost map is equal to the preset threshold, then set the cost value of the target grid in the current cost map corresponding to the sensor to a preset constant.
5. A cost map generation device, characterized in that, The device includes: A first determination module, configured to project the current position of the robot and the current frame point cloud data acquired by each of the at least two sensors into the corresponding current frame grid map to update the grid state of each grid in the current frame grid map; the grid state includes occupied, free, and unknown; A second determination module, configured to, if the grid state in the current frame grid map is occupied, set the cost value of the corresponding grid in the current cost map to 1, and if the grid state in the current frame grid map is free, set the cost value of the corresponding grid in the current cost map to 0; if the grid state in the current frame grid map is unknown, determine the target grid corresponding to the grid with an unknown grid state in the previous cost map, where the previous cost map is a cost map output based on the previous frame point cloud data acquired by the sensor projected into the corresponding previous frame grid map; obtain the target cost value of the target grid in the previous cost map, and determine the cost value of the grid with an unknown grid state in the current cost map corresponding to the sensor according to a preset forgetting processing algorithm and the target cost value; A third determination module, configured to, for any grid in the output cost map, determine each cost value of the any grid in the current cost map corresponding to each sensor; Take the maximum value among each cost value as the grid value corresponding to any grid in the output cost map.
6. The device according to claim 5, wherein The first determination module is further configured to: Perform coordinate transformation according to the current position of the robot and the current frame point cloud data acquired by each sensor to determine the projection positions of the current position of the robot and the current frame point cloud data in the current frame grid map; For any grid in the current frame grid map, if there is projected current frame point cloud data in the any grid, set the grid state of the any grid to occupied; Determine the grids with free and unknown grid states in the current frame grid map according to the projection result of the current position of the robot in the current frame grid map and the grids with an occupied grid state.
7. The device according to claim 5, characterized in that, The first determination module is further configured to: Taking the projection position of the current position of the robot in the current frame grid map as the starting point, emit rays in all directions; For any ray passing through a grid with an occupied grid state, set the grid states of all grids passed by the any ray between the grid with the occupied grid state passed by and the position of the robot in the corresponding current frame grid map at the current moment to free; Set the grid states of the grids in the current frame grid map other than the occupied and free grid states to unknown.
8. A robot, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the following steps are implemented: Project the current position of the robot and the current frame point cloud data acquired by each of the at least two sensors into the corresponding current frame grid map to update the grid state of each grid in the current frame grid map; the grid state includes occupied, free, and unknown; If the grid state in the current frame grid map is occupied, set the cost value of the corresponding grid in the current cost map to 1, and if the grid state in the current frame grid map is free, set the cost value of the corresponding grid in the current cost map to 0; If the grid state in the current frame grid map is unknown, determine the target grid in the previous cost map corresponding to the grid with the unknown grid state, where the previous cost map is the cost map output based on the previous frame point cloud data acquired by the sensor projected into the corresponding previous frame grid map; Obtain the target cost value of the target grid in the previous cost map, and determine the cost value of the grid with the unknown grid state in the current cost map corresponding to the sensor according to a preset forgetting processing algorithm and the target cost value; For any grid in the output cost map, determine each cost value of the any grid in the current cost map corresponding to each sensor; Take the maximum value among each cost value as the grid value corresponding to any grid in the output cost map.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 4 are implemented.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Grid map generation method and device, mobile smart equipment and storage medium
CN112102151A
Dynamic occupancy grid estimation method and apparatus
WO2022078342A1