Map updating method, electronic equipment and storage medium
By using the keyframes of lidar to obtain the probability of raster occupation, generate a new raster map and update the prior map, the problem of inefficiency of existing map update methods is solved, and the accuracy of robot positioning and navigation is improved.
Patent Information
- Application Number
- CN202411864634.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-05-06
AI Technical Summary
The existing map update method is inefficient, resulting in a decrease in robot positioning and navigation accuracy when environmental changes.
By using the keyframes of the lidar, the occupancy probability of each grid is obtained, a new raster map is generated, and the updated reference data is selected from the local map based on the map, and the prior map is updated.
Reduce unnecessary map updates, improve the efficiency of map updates, and ensure the accuracy of robot positioning and navigation.
Smart Images

Figure CN119935114A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of laser radar positioning technology, and in particular to a map updating method, electronic device and storage medium. Background Art
[0002] Map updates are crucial for autonomous driving, robot navigation, and many other location-based service applications. Mobile robots are often used to perform tasks in industrial production and warehousing logistics environments. However, due to semi-dynamic changes such as the movement of shelf locations, temporary parking of vehicles, or reflective objects, mobile robots may encounter significant mismatches between their surroundings and the prior map constructed during initial deployment during long-term operation. Excessive mismatches can directly impact the robot's positioning and navigation accuracy, and thus the accuracy and efficiency of its mission execution. Therefore, timely and effective updates to the prior map are crucial.
[0003] However, current map update methods typically select point cloud data from a specific time period and directly integrate the newly acquired point cloud map into the existing prior map. This selected time period may contain a large amount of unnecessary data information, resulting in many unnecessary update operations and low map update efficiency. Summary of the Invention
[0004] The main technical problem solved by this application is to provide a map updating method, electronic device and storage medium, which can improve the efficiency of map updating.
[0005] In order to solve the above technical problems, a technical solution adopted in the present application is: providing a map updating method, the method comprising: using several key frames of a laser radar to obtain the occupancy probability of each first grid, wherein the several key frames are selected from multiple scanning frames collected by the laser radar for the target environment, and the occupancy probability can represent the probability that the first grid is occupied, and the first grid is at least one of the multiple grids formed by dividing the target environment; based on the occupancy probability of each first grid, generating a new grid map corresponding to the target environment, wherein the new grid map includes multiple grids formed by dividing the target environment, and the state of each grid represents whether the grid is occupied; based on the grid state in the new grid map, selecting updated reference data from the local map corresponding to the target environment; and using the updated reference data to update the prior map.
[0006] In order to solve the above technical problems, another technical solution adopted by the present application is: to provide an electronic device, which includes a memory and a processor, the memory stores program instructions, and the processor is used to execute the program instructions to implement the above map updating method.
[0007] In order to solve the above technical problems, another technical solution adopted by the present application is: providing a computer-readable storage medium, which is used to store program instructions, and the program instructions can be executed to implement the above map updating method.
[0008] The above solution utilizes several keyframes from a lidar to obtain the occupancy probability of each first grid cell. Based on these occupancy probabilities, a new grid map corresponding to the target environment is generated. The new grid map contains multiple grid cells divided into the target environment, and the state of each grid cell indicates whether the grid cell is occupied. Based on the grid state in the new grid map, update reference data is selected from the local map corresponding to the target environment. This updated reference data is then used to update the prior map. A new grid map corresponding to the target environment is generated using several keyframes. Based on the grid state in the new grid map, update reference data is selected from the local map corresponding to the target environment for updating. This reduces unnecessary map updates and further improves map update efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 This is a flowchart of an embodiment of a map updating method provided by this application;
[0010] Figure 2 This is a schematic diagram of a specific embodiment of setting the unknown state of a priori map grid provided by this application;
[0011] Figure 3 This is a schematic diagram of a specific embodiment of a map change picture provided by this application;
[0012] Figure 4 This is a flowchart of a specific embodiment of the map updating method provided by this application;
[0013] Figure 5 This is a flowchart of an embodiment of a map updating device of the present application;
[0014] Figure 6 This is a schematic diagram of the framework of an embodiment of the electronic device of the present application;
[0015] Figure 7 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0016] In order to make the purpose, technical solutions and effects of this application clearer and more specific, this application is further described in detail below with reference to the accompanying drawings and examples.
[0017] It should be noted that the term "several" in this article means at least one, and the terms "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. The term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the previous and subsequent associated objects are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.
[0018] See also Figure 1 , Figure 1 It is a flowchart of an embodiment of the map updating method provided by this application. It should be noted that if there is substantially the same result, this embodiment does not use Figure 1 The process sequence shown is limited. Figure 1 As shown, this embodiment includes:
[0019] Step S11: using several key frames of the laser radar, obtaining the occupancy probability of each first grid.
[0020] Among them, several key frames are selected from multiple scanning frames collected by the laser radar of the target environment, and the occupancy probability can represent the probability of the first grid being occupied. The first grid is at least one of the multiple grids formed by dividing the target environment.
[0021] The corresponding operation information in each scanning frame can be obtained to assist in selecting a number of key frames from multiple scanning frames. The operation information can be used to characterize the operation status and operation changes of the lidar in each scanning frame.
[0022] In one embodiment, the operation information includes the operation distance, the rotation angle and the operation time interval. In a specific embodiment, the operation distance and rotation angle corresponding to each scanning frame can be obtained by using an odometer, and the operation time interval corresponding to each scanning frame can be obtained by using a timestamp or a scanning frame rate. According to the operation information, the scanning frame that meets the key frame determination conditions is used as the corresponding key frame. For example, when the operation time interval is the time length corresponding to 10 scanning frames, the operation distance is 0.8m, and the rotation angle is 10 degrees as the key frame determination conditions, the operation time interval corresponding to a scanning frame and the previous key frame is the time length corresponding to 11 scanning frames, the operation distance is 0.9m, and the rotation angle is 10 degrees, and the scanning frame is used as the key frame. It should be noted that, when determining the first key frame, the operation time interval refers to the operation time interval between the scanning frame and the first scanning frame. In determining subsequent key frames, the operation time interval refers to the operation time interval between the scanning frame and the previous key frame, which will not be repeated here.
[0023] Given that lidar radar operates over long periods of time and on a large scale, the number of recorded keyframes continues to grow, leading to a continuous increase in memory usage. Memory usage can be reduced by deleting redundant keyframes. For example, redundant keyframes can be deleted based on the similarity between keyframes in the historical record. Another example is to traverse the keyframes in the historical record and compare the time intervals between adjacent keyframes. Redundant keyframes are deleted when the time interval is less than a preset time threshold. Another example is to perform cluster analysis on the keyframes in the historical record, grouping keyframes with high similarity into the same category. A representative keyframe from each category is selected as a non-redundant keyframe and then deleted.
[0024] Considering the need for dynamic detection of the target environment by the LiDAR, the LiDAR in this embodiment can be installed on a mobile device. In one embodiment, the LiDAR is installed on a mobile robot. The mobile robot can integrate multiple devices to perform target environment surveys and LiDAR motion monitoring. For example, the mobile robot includes a motion controller, motor, battery, embedded computer, odometer, LiDAR, and more.
[0025] In one embodiment, obtaining the occupancy probability of each first grid using several key frames of the lidar is performed in response to a map save policy. In another specific embodiment, obtaining the first occupancy probability of each first grid using several key frames of the lidar is performed upon receiving a map save instruction from a user. In another specific embodiment, obtaining the first occupancy probability of each first grid using several key frames of the lidar is performed upon receiving a signal indicating that the mobile robot has been operating in the target environment for a time exceeding a preset time threshold.
[0026] In this embodiment, the keyframes contain target data, wherein the target data includes at least one of a point cloud and an artificial marker. The target data in the keyframes can be used to obtain the occupancy probability corresponding to each first grid. In one embodiment, the occupancy probability of each first grid is iteratively calculated using the target data corresponding to each keyframe. Each calculated occupancy probability corresponds to a keyframe. The first calculated occupancy probability is determined based on the observed occupancy probability of the keyframe corresponding to the first grid. The non-first calculated occupancy probability is determined based on the observed occupancy probability of the keyframe corresponding to the first grid and the occupancy probability calculated the last time. The observed occupancy probability of the keyframe corresponding to the first grid represents the probability that the first grid is occupied under observation in the corresponding keyframe. The observed occupancy probability of each first grid corresponding to the keyframe is related to the first mapping position of the target data corresponding to the keyframe in the grid map coordinate system. The occupancy probability of the first grid calculated in the last time is used as the final occupancy probability of the first grid. In which, the target data includes at least one of a point cloud and artificial marker information. When the target data is a point cloud, the final occupancy probability of the first grid includes a first occupancy probability, which represents the probability that the first grid is occupied by an obstacle. When the target data is artificial marker information, the final occupancy probability of the first grid includes a second occupancy probability, which represents the probability that the first grid is occupied by an artificial marker.
[0027] The first mapping position can be obtained by methods such as coordinate system conversion or data mapping. In one embodiment, the target data corresponding to the key frame can be directly mapped to the grid map coordinate system. In another embodiment, the target data corresponding to the key frame can be mapped to an intermediate coordinate system, and then mapped from the intermediate coordinate system to the grid map coordinate system, wherein the intermediate coordinate system can be any coordinate system and is not limited here. For example, the target data corresponding to the key frame can be mapped to the map coordinate system, and then the position of the target data corresponding to the key frame in the map coordinate system is mapped to the grid map coordinate system to obtain the corresponding first mapping position.
[0028] The keyframes also include optimized pose information. In one specific embodiment, the optimized pose information of the keyframes can be used to convert the target data corresponding to the keyframes into a map coordinate system. The target data includes at least one of a point cloud and artificial marker information. The target data position of each keyframe in the map coordinate system is converted to a grid map coordinate system to obtain a first mapping position of the target data corresponding to each keyframe in the grid map coordinate system.
[0029] Before obtaining the occupancy probability of each first grid using several key frames of the laser radar, the optimized pose information of the corresponding key frames can be obtained from the poses of multiple scanning frames, or the optimized pose information of the key frames can be obtained in real time before obtaining the occupancy probability of each first grid. In one embodiment, the odometer is used to align with the prior map to obtain the optimized pose information corresponding to the scanning frame, and the optimized pose information of the corresponding key frame is obtained from the poses of multiple scanning frames to further obtain the first mapping position corresponding to the target data. In another embodiment, a local submap can be constructed, and the odometer and the local submap can be preliminarily aligned, and then further aligned with the prior map to obtain the optimized pose information corresponding to the scanning frame, and the optimized pose information of the corresponding key frame is obtained from the poses of multiple scanning frames to further obtain the first mapping position corresponding to the target data.
[0030] In one specific embodiment, a laser radar is mounted on a mobile robot. A local submap is constructed using multiple scan frames acquired by the laser radar from the target environment. For each scan frame, the first pose information of the scan frame is obtained by aligning the point cloud of the scan frame with the point cloud in the local submap. The first pose information is then combined with the second pose information of the mobile robot's odometry corresponding to the scan frame to construct the initial pose information of the front-end odometry corresponding to the scan frame. The initial pose information is optimized using the alignment results between the point cloud of the scan frame and the point cloud in the prior map to obtain optimized pose information corresponding to the scan frame. Using the optimized pose information corresponding to the keyframe, target data corresponding to the keyframe is converted to a map coordinate system. The target data includes at least one of a point cloud and artificial marker information. The target data position of each keyframe in the map coordinate system is converted to a grid map coordinate system to obtain a first mapping position of the target data corresponding to each keyframe in the grid map coordinate system. The first mapping position is used to calculate the occupancy probability.
[0031] For example, a local submap is constructed using multiple scanning frames collected by a laser radar on the target environment. For each scanning frame, the point cloud collected by the laser radar on the target environment is aligned with the point cloud in the local submap to obtain the first pose information of the scanning frame. Among them, the alignment can be performed using algorithms such as iterative nearest point and feature matching. A filter (such as Kalman filter, extended Kalman filter, unscented Kalman filter, etc.) is used to fuse the first pose information obtained by alignment with the second pose information corresponding to the odometer to obtain the initial pose information of the scanning frame corresponding to the front-end odometer. The point cloud collected by the laser radar on the target environment is aligned with the point cloud in the prior map to obtain the third pose information of the scanning frame. The third pose information is fused with the initial pose information corresponding to the front-end odometer to obtain the optimized pose information corresponding to the scanning frame.
[0032] The observed occupancy probability may also be related to the second mapping position of the lidar in the grid map coordinate system. In one specific embodiment, the observed occupancy probability of each key frame corresponding to the first grid is determined based on the first mapping position of the target data corresponding to the key frame in the grid map coordinate system and the second mapping position of the lidar in the grid map coordinate system.
[0033] The method for obtaining the second mapping position may refer to the method for obtaining the first mapping position described above, and will not be described in detail here.
[0034] Taking the acquisition of the first mapping position and the second mapping position as an example, traverse each key frame and obtain the corresponding posture T of each key frame wl , target data P l , and the position P of the laser radar l Among them, the position of the laser radar P l From the pose T wl Get the target data P l With LiDAR P l Convert to the map coordinate system and obtain the corresponding target data P w With LiDAR P w , where the target data P w With LiDAR P w Both can use P w =T wl P l Generate the corresponding point cloud map and record the boundary p of the point cloud map min :{x min ,y min} and p max :{x max ,y max Set the grid map refresh resolution to r, the rotation angle θ between the grid map and the point cloud map, and generate the corresponding grid map. min Align and correspond each key frame to the target data P w With LiDAR P w Map to the grid map coordinate system and obtain the corresponding first mapping position p0 and second mapping position p0. The first mapping position p0 and the second mapping position p0 can be based on get.
[0035] In one specific embodiment, the occupancy probability calculated initially is the target logarithm of the observed occupancy probability for the keyframe corresponding to the first grid, where the target logarithm is the logarithm of the ratio between the corresponding observed occupancy probability and a probability difference, where the probability difference is the difference between a preset value and the corresponding observed occupancy probability. The occupancy probability calculated non-initial is the sum of the target logarithm of the observed occupancy probability for the keyframe corresponding to the first grid and the occupancy probability calculated last.
[0036] For example, the observed occupancy probability of the first grid corresponding to the tth (non-first) key frame is: Among them, c i Refers to the first grid of i, P(c i |z) refers to the probability that the first grid is occupied under the observation of the lidar, l t-1 (c i ) refers to the observed occupancy probability of the first grid corresponding to the t-1th (i.e., the last) key frame. Among them, the P(c i |z). That is, a straight line is formed by connecting the grids corresponding to the first mapping positions of the target data and the grids corresponding to the second mapping positions of the laser radar. The first grid where the midpoint of the straight line is located is in the occupied state, and the other first grids on the straight line are in the idle state. The number of times the first grid is in the occupied state or the idle state is counted, and the P(c i |z).
[0037] Step S12: generating a new grid map corresponding to the target environment based on the occupancy probabilities of the first grids.
[0038] The new grid map includes multiple grids formed by dividing the target environment, and the state of each grid represents whether the grid is occupied. In one embodiment, the new grid map can be, but is not limited to, a probabilistic grid map.
[0039] The first grid in this embodiment refers to the grid where the first mapping position of the target data in each key frame is located in the new grid map coordinate system, the grid where the second mapping position of the laser radar is located in the new grid map coordinate system, and the grid on the straight line connecting the grid where the first mapping position is located and the grid where the second mapping position is located.
[0040] In one embodiment, for each grid in the new grid map: if the grid has an occupancy probability and the occupancy probability is greater than a first probability threshold, the grid is in an occupied state. If the grid has an occupancy probability and the occupancy probability is less than a second probability threshold, the grid is in an occupied state. If the grid has no occupancy probability, or has an occupancy probability and the occupancy probability is between the first and second probability thresholds, the grid is in an unknown state.
[0041] In this embodiment, the second grid refers to at least one of the remaining grids after removing the first grid from the multiple grids formed by dividing the target environment.
[0042] For example, the first probability threshold is p ooc , the second probability threshold is p free , the occupancy probability in the first grid is greater than p ooc In the case of , the state of the first grid is occupied. When the occupancy probability of the first grid is less than p free In the case of , the state of the first grid is idle. When the occupancy probability of the first grid is less than or equal to p ooc , and the occupancy probability of the first grid is greater than or equal to p free In the case of , the state of the first grid is unknown. The state of the second grid is unknown.
[0043] In one embodiment, the new grid map may include at least one of a first new grid map and a second new grid map.
[0044] Step S13: Based on the grid status in the new grid map, update reference data is selected from the local map corresponding to the target environment.
[0045] In one embodiment, when the new grid map only includes the first new grid map, the first new grid map is generated based on the first occupancy probability of each first grid, the first occupancy probability is obtained by computing the point clouds corresponding to a plurality of key frames, and the first occupancy probability represents the probability that the first grid is occupied by an obstacle.
[0046] Before determining the local map between the first new grid map and the prior map, the first grid map and the prior map can be preprocessed to ensure a one-to-one correspondence between the first grid map and the grids in the prior map. In one embodiment, the resolutions of the prior map and the first new grid map are downsampled to the same resolution. For example, if the resolution of the prior map is 0.08 and the resolution of the first grid map is 0.07, the least common multiple of the two is used as the downsampled resolution, i.e., 0.56 is used as the corresponding resolution of the first grid map and the prior map after downsampling.
[0047] The local map in this embodiment includes the intersection area and the newly added area between the first new grid map and the prior map. Updated reference data can be selected from the intersection area and the newly added area respectively.
[0048] Considering that the a priori map only has occupied and idle states, and the first grid map still has unknown states, directly comparing the a priori map with the first grid map will introduce errors. In one embodiment, for a first grid whose state is unknown in the first grid map, the state of its corresponding grid in the a priori map is also determined to be unknown.
[0049] Combine Figure 2 To illustrate, Figure 2 This is a schematic diagram of a specific embodiment of setting the unknown state of the prior map grid provided by this application. p is the intersection area of the prior map, m c is the intersection area of the new grid map. The gray area represents the grid in unknown state, the black area represents the grid in occupied state, and the white area represents the grid in idle state. c For the grid with unknown state in the prior map, the state of its corresponding grid in the prior map is also determined.
[0050] For unknown states, obtain the corresponding prior map m after setting the grid of unknown states p . Using m c
[0051] With m p Perform a comparison to obtain the grid status in the new grid map.
[0052] To ensure the accuracy of the grid status, a grid in the intersection area whose status in the first new grid map is not unknown can be used as a third grid. The grid status is then obtained based on the third grid. In one embodiment, the intersection area between the first new grid map and the prior map is determined. The status of each third grid in the intersection area of the first new grid map and the prior map is compared to obtain a map change rate for the intersection area, where the third grid is at least one grid in the intersection area. Based on the map change rate, it is determined that the intersection area meets the first update condition, and a point cloud corresponding to the intersection area is obtained from the local map as a first update reference point cloud. The first update reference point cloud is used as the corresponding update reference data.
[0053] The map change rate can be determined by comparing the number of grid cells whose states have changed in each third grid cell in the intersection area between the first new grid map and the prior map. Alternatively, the map change rate can be determined by comparing the grid area whose states have changed in each third grid cell in the intersection area between the first new grid map and the prior map. In one embodiment, the states of each third grid cell in the intersection area between the first new grid map and the prior map are compared to determine the number of third grid cells whose states have changed between the first new grid map and the prior map. The ratio of this number of grid cells to the total number of third grid cells is used as the map change rate.
[0054] In a specific embodiment, in response to a map change rate being greater than a preset change rate, a point cloud corresponding to the intersection area is obtained from the local map as a first updated reference point cloud.
[0055] In another specific embodiment, in response to an update instruction sent by an operator based on the map change rate, a point cloud corresponding to the intersection area is obtained from a local map as a first updated reference point cloud. For example, a map change picture is sent to the robot platform, wherein the map change picture includes each third grid in the intersection area and the map change rate, and there is a visibility difference between the third grid whose state has changed and the third grid whose state has not changed in the map change picture. In response to an update instruction sent by an operator through the robot platform, a point cloud corresponding to the intersection area is obtained from a local map as a first updated reference point cloud. The visibility difference can be that the third grid that has changed exists in red, and the third grid whose state has not changed exists in black. Alternatively, the third grid that has changed exists in a highlighted form, and the third grid whose state has not changed exists in a gray form, which is not limited here.
[0056] Combine Figure 3 To illustrate, Figure 3 This is a schematic diagram of a specific embodiment of a map change image provided by this application. The changed third grid is in red, and the unchanged third grid is in black.
[0057] In another specific embodiment, the map change rate is greater than a preset change amount, and in response to an update instruction sent by an operator, a point cloud corresponding to the intersection area is obtained from the local map as a first updated reference point cloud.
[0058] For example, the number of rows in the intersection area is col, and the number of columns is row, that is, the total number of grids in the intersection area is col*row. The number of grids whose states have changed between the first new grid map and the prior map is m, and the number of grids whose states are unknown between the first new grid map and the prior map is n. Then the map change rate is A map change image is sent to the robot platform. The image contains each third grid in the intersection area and the map change rate. Third grids with changed states are displayed in red, while third grids with unchanged states are displayed in black. If the map change rate is greater than the preset rate and in response to an update instruction sent by the operator, the point cloud corresponding to the intersection area is obtained from the local map and used as the first update reference point cloud.
[0059] In another embodiment, a newly added area other than the intersection area is determined in the first new grid map, where the intersection area is the area where the first new grid map and the prior map intersect. In response to the newly added area satisfying the second update condition, a point cloud corresponding to the newly added area is obtained from the local map as a second update reference point cloud. The second update reference point cloud is used as the corresponding update reference data.
[0060] In a specific embodiment, the ratio between the number of grids in the third grid in an unknown state in the newly added area and the total number of grids in the newly added area is less than the first ratio, and a point cloud corresponding to the newly added area is obtained from the local map as the second updated reference point cloud.
[0061] In another specific embodiment, the area ratio of the newly added region in the new grid map is greater than the second ratio, and a point cloud corresponding to the newly added region is obtained from the local map as the second updated reference point cloud.
[0062] In another specific embodiment, the ratio between the number of grids in the third grid in an unknown state in the newly added area and the total number of grids in the newly added area is less than the first ratio, and the area proportion of the newly added area in the new grid map is greater than the second ratio, and a point cloud corresponding to the newly added area is obtained from the local map as the second updated reference point cloud.
[0063] For example, the ratio of the number of grids in the third grid in the newly added area that are in an unknown state to the total number of grids in the newly added area is less than r c , and the area of the newly added area in the new grid map is greater than the second ratio r s , obtain the point cloud corresponding to the newly added area from the local map as the second updated reference point cloud.
[0064] In another embodiment, when the new grid map includes only the second new grid map, the second new grid map is generated based on a second occupancy probability of the first grid, where the second occupancy probability is calculated using artificial marker information of a plurality of key frames, and the second occupancy probability represents a probability that the first grid is occupied by the artificial marker.
[0065] In one embodiment, occupied grids in the second new grid map are found as marker grids, positions corresponding to the marker grids in the local map are used as first marker positions, and the first marker positions are used as corresponding updated reference data.
[0066] Before finding the marker grid in the second new grid map, the resolution of the second new grid map may be adjusted to improve the accuracy of traversing the artificial markers and ensure that the artificial markers can be located more accurately.
[0067] For example, the resolution r can be set according to the size of the artificial markern , traverse the artificial markers in the key frame, obtain the occupation probability corresponding to the artificial marker, and generate the corresponding second new grid map. When the probability of the grid where the artificial marker is located being occupied is greater than p ooc When , the state of the artificial marker is determined to be occupied. The grid in the second new grid map that is occupied is used as the marker grid.
[0068] Step S14: updating the prior map using the updated reference data.
[0069] The updated reference data of the first new grid map may be spliced into the prior map.
[0070] Before the updated reference data of the first new raster map is spliced onto the prior map, the updated reference data can be preprocessed to remove redundant information. In one embodiment, after clustering the updated reference data, point clouds with a small number or a small length are removed to obtain preprocessed updated reference data. In another embodiment, before obtaining the updated reference data, the point cloud in the raster map can be preprocessed, and the updated reference data can be selected from the preprocessed point cloud. This is not a limitation.
[0071] In one embodiment, the intersection region in the prior map is updated using the first updated reference point cloud. In a specific embodiment, the point cloud corresponding to the intersection region in the prior map is deleted, and the first updated reference point cloud is spliced to the intersection region in the prior map.
[0072] In another embodiment, the second updated reference point cloud is added to the prior map. In a specific embodiment, the grid coordinates of the newly added area are mapped to the prior map coordinate system to obtain the mapping area of the newly added area in the prior map. The second updated reference point cloud is then spliced to the mapping area in the prior map.
[0073] The updated reference data of the second new grid map can be used to update the artificial markers in the prior map.
[0074] In one embodiment, the artificial marker information in the prior map is updated using the first marker position.
[0075] In one embodiment, the positions of each first marker are used to determine the representative positions of several detection markers. Each detection marker is used as a target marker. The position of the second marker closest to the target marker is found in the a priori map. The closest second marker position is pre-marked, and after traversing each detection marker, the markers not pre-marked in the a priori map are deleted.
[0076] In another specific embodiment, representative positions of several detection markers are determined using the positions of each first marker. Each detection marker is used as a target marker. The position of the second marker closest to the target marker is found in the a priori map. The distance between the representative position of the target marker and the position of the second marker closest to the target marker is obtained. In response to the distance satisfying a third update condition, the target marker is added to the a priori map.
[0077] In another specific embodiment, the positions of each first marker are used to determine the representative positions of several detection markers. Each detection marker is used as a target marker. The position of the second marker closest to the target marker is found in the a priori map. The closest second marker position is pre-marked, and after traversing each detection marker, the markers not pre-marked in the a priori map are deleted. The distance between the representative position of the target marker and its closest second marker position is obtained, and in response to the distance satisfying a third update condition, the target marker is added to the a priori map.
[0078] The third updating condition mentioned above may be that the distance is greater than a preset size parameter of the artificial marker.
[0079] In one embodiment, the positions of the first markers are clustered to obtain a number of clusters, wherein each cluster represents a detection marker. The central tendency characterization value of the first marker position corresponding to each cluster is used as the representative position of the detection marker corresponding to each cluster. For example, for all the first artificial markers corresponding to a cluster, the average position of all the first artificial markers can be selected as the representative position of the detection marker. For another example, for all the first artificial markers corresponding to a cluster, at least one of all the artificial markers can be selected as the representative position. Of course, for all the first artificial markers corresponding to a cluster, several first artificial markers can also be selected within a set distance threshold. And the average position of the selected several first artificial markers is used as the representative position, which is not limited here.
[0080] For example, all artificial markers are clustered separately, and the radius of the Euclidean cluster is the diameter or width of the artificial marker to prevent multiple artificial markers from being detected at the same actual position. The positions of all the first artificial markers in each cluster are averaged to obtain the representative position p at that location. i . Based on the positions of the artificial markers in the prior map, a kd-tree (k-dimensional tree) is constructed, and all the artificial markers in the second new grid map are traversed. For the i-th first marker, at the representative position p i Perform nearest neighbor search to find the second artificial marker position p closest to the prior map j , and mark the second artificial marker j of the prior map as visited, if the distance between the two satisfies ||p j-p i If ||2≤dist, the marker is not updated. If the distance exceeds dist, the first artificial marker i is added to the prior map. Where dist is the diameter or width of the artificial marker. Finally, all unvisited artificial markers in the prior map are deleted to complete the artificial marker update.
[0081] In one embodiment, the artificial marker includes a reflective plate and a reflective column.
[0082] See also Figure 4 , Figure 4 This is a flowchart of a specific embodiment of the map updating method provided by this application.
[0083] Step S41: Load the prior map, obtain multiple scan frames of the target environment captured by the lidar, determine several keyframes from the multiple scan frames, record several keyframes, and delete redundant keyframes. Step S42: Determine whether the map save policy has been triggered. If the map save policy has not been triggered, execute step S41. If the map save policy has been triggered, execute step S43: Iterate through each keyframe to generate a new grid map corresponding to the target environment. Step S44: Downsample the resolution of the new grid map and the prior map to the same resolution, and filter out grids with unknown status in the new grid map and the prior map. Determine a first updated reference point cloud in the intersection area of the new grid map and the prior map. Based on the new grid map obtained in step S43, execute step S45: Determine a second updated reference point cloud in the newly added area of the new grid map and the prior map. Based on the new grid map obtained in step S43, execute step S46: Determine the first marker position in the new grid map and the prior map. According to the first updated reference point cloud, the second updated reference point cloud and the first marker position obtained in steps S44, S45 and S46, step S47 is executed: a map change picture is obtained, and the first updated reference point cloud, the second updated reference point cloud and the first marker position are used to update the prior map.
[0084] See also Figure 5 , Figure 5The figure is a flow chart of an embodiment of a map updating device of the present application. The map updating device 500 includes an occupancy probability acquisition module 510, a new grid map generation module 520, an update reference data selection module 530, and an update module 540. The occupancy probability acquisition module 510 is configured to use a number of key frames of a laser radar to acquire the occupancy probability of each first grid. The key frames are selected from a plurality of scan frames acquired by the laser radar from the target environment. The occupancy probability represents the probability that the first grid is occupied. The first grid is at least one of the plurality of grids formed by dividing the target environment. The new grid map generation module 520 is configured to generate a new grid map corresponding to the target environment based on the occupancy probabilities of the first grids. The new grid map includes the plurality of grids formed by dividing the target environment, and the status of each grid represents whether the grid is occupied. The update reference data selection module 530 is configured to select update reference data from the local map corresponding to the target environment based on the grid status in the new grid map. The update module 540 is configured to update the prior map using the updated reference data.
[0085] In some embodiments, for each grid in the new grid map: if the grid has an occupancy probability and the occupancy probability is greater than a first probability threshold, the grid is in an occupied state. If the grid has the occupancy probability and the occupancy probability is less than a second probability threshold, the grid is in an occupied state. If the grid has no occupancy probability, or has an occupancy probability and the occupancy probability is between the first probability threshold and the second probability threshold, the grid is in an unknown state.
[0086] In some embodiments, the new grid map includes at least one of a first new grid map and a second new grid map, wherein the first new grid map is generated based on a first occupancy probability of each first grid, the first occupancy probability being calculated using point cloud information corresponding to a plurality of key frames, and the first occupancy probability representing a probability that the first grid is occupied by an obstacle. The second new grid map is generated based on a second occupancy probability of the first grid, the second occupancy probability being calculated using artificial marker information from a plurality of key frames, and the second occupancy probability representing a probability that the first grid is occupied by an artificial marker.
[0087] In some embodiments, the new grid map includes a first new grid map. The update reference data selection module 530 selects update reference data from the local map corresponding to the target environment based on the grid status in the new grid map, including: determining the intersection area between the first new grid map and the prior map. Comparing the status of each third grid in the intersection area of the first new grid map and the prior map, the map change rate of the intersection area is obtained, and the third grid is at least one grid in the intersection area. Based on the map change rate, it is determined that the intersection area meets the first update condition, and the point cloud corresponding to the intersection area is obtained from the local map as the first update reference point cloud. The update module 540 updates the prior map using the updated reference data, including: updating the intersection area in the prior map using the first update reference point cloud.
[0088] In some embodiments, the update reference data selection module 530 specifically compares the states of each third grid in the intersection area between the first new grid map and the prior map to obtain a map change rate in the intersection area, including comparing the states of each third grid in the intersection area between the first new grid map and the prior map to determine the number of third grids whose states have changed between the first new grid map and the prior map. The ratio of the number of third grids to the total number of third grids is used as the map change rate.
[0089] In some embodiments, the updating module 540 updates the intersection area in the prior map using the first updated reference point cloud, including: deleting the point cloud corresponding to the intersection area in the prior map, and splicing the first updated reference point cloud to the intersection area in the prior map.
[0090] In some embodiments, the third grid is a grid in the intersection area whose status in the first new grid map is not unknown.
[0091] In some embodiments, before the updating reference data selection module 530 determines the intersection area between the first new grid map and the priori map, the method further includes: downsampling the resolutions of the priori map and the first new grid map to the same resolution.
[0092] In some embodiments, the update reference data selection module 530 determines that the intersection area meets the first update condition based on the map change rate, including: sending a map change image to the robot platform, wherein the map change image includes each third grid in the intersection area and the map change rate, and there is a visual difference between the third grid whose status has changed and the third grid whose status has not changed in the map change image. An update instruction sent by an operator through the robot platform is received.
[0093] In some embodiments, the new grid map includes a first new grid map. The state of each grid in the first new grid map is used to indicate whether the grid is occupied by an obstacle. The first new grid map is generated based on a first occupancy probability for each first grid, which is obtained based on a point cloud corresponding to a keyframe and indicates the probability that the first grid is occupied by an obstacle. Based on the grid states in the new grid map, the update reference data selection module 530 selects update reference data from a local map corresponding to the target environment. This includes determining a newly added area in the first new grid map, excluding an intersection area. The intersection area is an area where the first new grid map intersects with the prior map. In response to the newly added area meeting a second update condition, a point cloud corresponding to the newly added area is obtained from the local map as a second update reference point cloud. When updating the prior map using the updated reference data, the update module 540 adds the second update reference point cloud to the prior map.
[0094] In some embodiments, the second update condition includes: a ratio between the number of third grids in an unknown state in the newly added area and the total number of grids in the newly added area is less than a first ratio.
[0095] In some embodiments, the second update condition includes: the area ratio of the newly added region in the new grid map is greater than a second ratio.
[0096] In some embodiments, the second update condition includes: the ratio between the number of grids in the third grid in the unknown state in the newly added area and the total number of grids in the newly added area is less than the first ratio, and the area proportion of the newly added area in the new grid map is greater than the second ratio.
[0097] In some embodiments, before the updating reference data selection module 530 determines the newly added area between the first new grid map and the priori map, the method further includes: downsampling the resolutions of the priori map and the first new grid map to the same resolution.
[0098] In some embodiments, the updating module 540, when adding the second updated reference point cloud to the prior map, includes: mapping the grid coordinates of the newly added area to the prior map coordinate system to obtain a mapping area of the newly added area in the prior map; and splicing the second updated reference point cloud to the mapping area in the prior map.
[0099] In some embodiments, the new grid map includes a second new grid map. The update reference data selection module 530 selects update reference data from the local map corresponding to the target environment based on the grid status in the new grid map, including: finding grids in the second new grid map that are occupied as marker grids. The positions corresponding to each marker grid in the local map are used as first marker positions. The update module 540 updates the prior map using the updated reference data, including: updating the artificial marker information in the prior map using the first marker positions.
[0100] In some embodiments, the updating module 540 updates the artificial marker information in the prior map using the first marker positions by: determining representative positions of a plurality of detection markers using each first marker position; treating each detection marker as a target marker; finding the second marker position closest to the target marker in the prior map; pre-marking the closest second marker position; and, after traversing each detection marker, deleting markers in the prior map that are not pre-marked.
[0101] In some embodiments, the updating module 540 updates the artificial marker information in the prior map using the first marker positions, including: determining representative positions of a plurality of detection markers using the first marker positions; treating each detection marker as a target marker; finding the position of the second marker closest to the target marker in the prior map; obtaining the distance between the representative position of the target marker and the position of the second marker closest to the target marker; and adding the target marker to the prior map in response to the distance satisfying a third update condition.
[0102] In some embodiments, the updating module 540 updates the artificial marker information in the prior map using the first marker positions, including: using each first marker position to determine a representative position of a plurality of detection markers. Each detection marker is used as a target marker. The second marker position closest to the target marker is searched in the prior map. The closest second marker position is pre-marked, and after traversing each detection marker, the markers that are not pre-marked in the prior map are deleted. The distance between the representative position of the target marker and its closest second marker position is obtained, and in response to the distance satisfying a third update condition, the target marker is added to the prior map.
[0103] In some embodiments, the third update condition is that the distance is greater than a preset size parameter of the artificial marker.
[0104] In some embodiments, the updating module 540 uses the first marker positions to determine representative positions of a plurality of detection markers, including clustering the first marker positions to obtain a plurality of clusters, each cluster representing one of the detection markers, and using the central tendency representation value of the first marker positions corresponding to each cluster as the representative position of the detection marker corresponding to each cluster.
[0105] In some embodiments, the laser radar is provided on a mobile robot. Before the new grid map generation module 520 generates a new grid map corresponding to the target environment based on the occupancy probability of each first grid, it also includes: using the laser radar to collect multiple scanning frames of the target environment to construct a local submap. For each scanning frame, the first pose information of the scanning frame is obtained by using the registration result between the point cloud of the scanning frame and the point cloud in the local submap. The initial pose information of the front-end odometer corresponding to the scanning frame is constructed using the first pose information and the second pose information of the scanning frame corresponding to the odometer of the mobile robot. The initial pose information is optimized using the registration result between the point cloud of the scanning frame and the point cloud in the prior map to obtain the optimized pose information corresponding to the scanning frame. The target data corresponding to the key frame is converted to the map coordinate system using the optimized pose information corresponding to the key frame, and the target data includes at least one of the point cloud and artificial marker information. The target data position of each key frame in the map coordinate system is converted to the grid map coordinate system to obtain the first mapping position of the target data corresponding to each key frame in the grid map coordinate system, wherein the first mapping position is used to calculate the occupancy probability.
[0106] In some embodiments, the laser radar is installed on the mobile robot, and the map updating method is executed when a map saving instruction is received from the user or the running time of the mobile robot in the target environment exceeds a preset time threshold.
[0107] See also Figure 6 , Figure 6 This is a schematic diagram of the framework of an embodiment of an electronic device of the present application. Electronic device 60 includes a memory 61 and a processor 62 coupled to each other. Processor 62 is configured to execute program instructions stored in memory 61 to implement the steps of any of the aforementioned map update method embodiments. In a specific implementation scenario, electronic device 60 may include, but is not limited to, a microcomputer and a server. Furthermore, electronic device 60 may also include mobile devices such as laptops and tablet computers, without limitation herein.
[0108] Specifically, the processor 62 is used to control itself and the memory 61 to implement the steps in any of the above-mentioned map updating method embodiments. The processor 62 can also be called a CPU (Central Processing Unit). The processor 62 may be an integrated circuit chip with signal processing capabilities. The processor 62 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 62 can be implemented by an integrated circuit chip.
[0109] See also Figure 7 , Figure 7 The computer-readable storage medium 70 stores program instructions 71 that can be executed by a processor, and the program instructions 71 are used to implement the steps of any of the above-mentioned map updating method embodiments.
[0110] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0111] The above description of the various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced with each other and will not be repeated herein for the sake of brevity.
[0112] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation methods described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0113] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0114] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
Claims
1. A map updating method, characterized in that: The method comprises: Using a plurality of key frames of the laser radar, obtaining an occupation probability of each first grid, wherein the plurality of key frames are selected from a plurality of scanning frames acquired by the laser radar of the target environment, the occupation probability can represent a probability that the first grid is occupied, and the first grid is at least one of a plurality of grids formed by dividing the target environment; Based on the occupancy probability of each of the first grids, generating a new grid map corresponding to the target environment, wherein the new grid map includes a plurality of grids formed by dividing the target environment, and the state of each of the grids represents whether the grid is occupied; Selecting updated reference data from a local map corresponding to the target environment based on a grid state in the new grid map; The updated reference data is used to update the prior map.
2. The method according to claim 1, characterized in that For each of the grids in the new grid map: When the grid has the occupation probability and the occupation probability is greater than a first probability threshold, the state of the grid is an occupied state; When the grid has the occupation probability and the occupation probability is less than a second probability threshold, the state of the grid is an occupied state; When the occupancy probability does not exist in the grid, or when the occupancy probability exists and is between the first probability threshold and the second probability threshold, the state of the grid is an unknown state.
3. The method according to claim 1, characterized in that The new grid map includes at least one of a first new grid map and a second new grid map, wherein: The first new grid map is generated based on a first occupancy probability of each of the first grids, the first occupancy probability is obtained by computing the point cloud corresponding to the plurality of key frames, and the first occupancy probability represents a probability that the first grid is occupied by an obstacle; The second new grid map is generated based on a second occupancy probability of the first grid, where the second occupancy probability is calculated using the artificial marker information of the plurality of key frames, and the second occupancy probability represents a probability that the first grid is occupied by an artificial marker.
4. The method according to claim 3, characterized in that The new grid map includes the first new grid map; The step of selecting update reference data from a local map corresponding to the target environment based on the grid state in the new grid map comprises: Determine an intersection area between the first new grid map and the priori map; Comparing the states of the first new grid map and the priori map in each third grid in the intersection area to obtain a map change rate of the intersection area, wherein the third grid is at least one grid in the intersection area; Determining that the intersection area satisfies a first update condition based on the map change rate, and acquiring a point cloud corresponding to the intersection area from the local map as a first update reference point cloud; The updating of the prior map using the updated reference data comprises: The intersection area in the priori map is updated using the first updated reference point cloud.
5. The method according to claim 4, characterized in that The comparing the states of the first new grid map and the priori map in each third grid in the intersection area to obtain the map change rate of the intersection area includes: Comparing the states of the first new grid map and the priori map in the intersection area with each third grid to determine the number of third grids whose states have changed between the first new grid map and the priori map; The ratio between the number of grids and the total number of grids of the third grid is used as the map change rate; And / or, the updating of the intersection area in the priori map by using the first update reference data comprises: The point cloud corresponding to the intersection area in the prior map is deleted, and the first updated reference point cloud is spliced to the intersection area in the prior map.
6. The method according to claim 4, characterized in that The third grid is a grid in the intersection area whose state in the first new grid map is not an unknown state; And / or, before determining the intersection area between the first new grid map and the priori map, the method further includes: Downsampling the resolutions of the prior map and the first new grid map to the same resolution; And / or, determining that the intersection area satisfies a first update condition based on the map change rate includes: Sending a map change picture to the robot platform, wherein the map change picture includes each of the third grids in the intersection area and the map change rate, and there is a visual difference between the third grid whose state has changed and the third grid whose state has not changed in the map change picture; An update instruction sent by an operator through the robot platform is received.
7. The method according to claim 3, characterized in that The new grid map includes the first new grid map; The step of selecting update reference data from a local map corresponding to the target environment based on the grid state in the new grid map comprises: Determine a newly added area in the first new grid map except for the intersection area, wherein the intersection area is an area where the first new grid map and the prior map intersect; In response to the newly added area satisfying the second update condition, acquiring a point cloud corresponding to the newly added area from the local map as a second update reference point cloud; The updating of the prior map using the updated reference data comprises: The second updated reference point cloud is added to the prior map.
8. The method according to claim 7, characterized in that The second update condition includes at least one of the following: the ratio between the number of grids of the third grid in the newly added area that is in an unknown state and the total number of grids in the newly added area is less than the first ratio, and the area proportion of the newly added area in the new grid map is greater than the second ratio; And / or, adding the second updated reference point cloud to the prior map comprises: Mapping the grid coordinates of the newly added area to the prior map coordinate system to obtain a mapping area of the newly added area in the prior map; The second updated reference point cloud is stitched to the mapping area in the prior map.
9. The method according to claim 3, characterized in that: The new grid map includes the second new grid map; The step of selecting update reference data from a local map corresponding to the target environment based on the grid state in the new grid map comprises: Find out the grids in the second new grid map that are in an occupied state as marker grids; Using the position corresponding to each marker grid in the local map as the first marker position; The updating of the prior map using the updated reference data comprises: The artificial marker information in the priori map is updated using the first marker position.
10. The method according to claim 9, characterized in that The updating of the artificial marker information in the priori map by using the first marker position includes: Determining representative positions of a plurality of detection markers using the positions of each of the first markers; using each of the detection markers as a target marker; Finding the position of a second marker closest to the target marker in the priori map; Preset the position of the nearest second marker, and after traversing each of the detection markers, delete the markers in the prior map that have not been preset marked; and / or, obtain the distance between the representative position of the target marker and its nearest second marker position, and in response to the distance satisfying the third update condition, add the target marker to the prior map.
11. The method according to claim 10, characterized in that The third updating condition is that the distance is greater than a preset size parameter of the artificial marker; And / or, using the positions of the first markers to determine representative positions of a plurality of detection markers may include: Clustering the positions of the first markers to obtain a plurality of clusters, wherein each cluster represents one of the detection markers; The central tendency characterization value of the first marker position corresponding to each of the clusters is respectively used as the representative position of the detection marker corresponding to each of the clusters.
12. The method according to claim 1, characterized in that The laser radar is arranged on the mobile robot; Before generating a new grid map corresponding to the target environment based on the occupancy probabilities of the first grids, the method further includes: Using the laser radar to collect multiple scan frames of the target environment, construct a local sub-map; For each scanning frame, using the registration result between the point cloud of the scanning frame and the point cloud in the local submap, obtain the first pose information of the scanning frame, using the first pose information and the second pose information of the odometer of the mobile robot corresponding to the scanning frame, construct the initial pose information of the front-end odometer corresponding to the scanning frame, using the registration result between the point cloud of the scanning frame and the point cloud in the priori map, optimize the initial pose information, and obtain the optimized pose information corresponding to the scanning frame; Using the optimized pose information corresponding to the key frame, converting the target data corresponding to the key frame into a map coordinate system, the target data including at least one of a point cloud and artificial marker information; The target data position of each key frame in the map coordinate system is converted to the grid map coordinate system to obtain a first mapping position of the target data corresponding to each key frame in the grid map coordinate system, wherein the first mapping position is used to calculate the occupancy probability.
13. The method according to claim 1, characterized in that The laser radar is arranged on the mobile robot, and the map updating method is executed when a map saving instruction is received from a user or when the running time of the mobile robot in the target environment exceeds a preset time threshold.
14. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores program instructions, and the processor is used to execute the program instructions to implement the map updating method according to any one of claims 1-13.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program instructions, and the program instructions can be executed to implement the map updating method according to any one of claims 1-13.
Citation Information
Cited By
Map updating method, electronic equipment and storage medium
CN121557995A
Map knowledge base construction method, map updating method and related devices
CN121636631A