Map generation method and apparatus, robot, and storage medium
By detecting closed-loop conditions in the robot to acquire point cloud data and perform pose correction, a local map is generated and updated. This solves the problem of excessive resource consumption in large-scene map construction, improves map construction efficiency and accuracy, and avoids downtime.
Patent Information
- Application Number
- PCT/CN2025/090153
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-30
- Filing Date
- 2025-04-21
- Publication Date
- 2025-12-04
AI Technical Summary
When dealing with extremely large scenes, the robot needs to maintain a large number of filter states at the same time, which leads to a large consumption of computing resources, making it prone to crashes and resulting in high resource overhead for map building.
When the local map statistics in the memory meet the closed-loop detection conditions, the current point cloud data is acquired and stored in memory. Based on the position and pose information, pose correction is performed, an updated local map is generated and replaced with the historical local map in the memory, and a target global map is generated.
It reduces the consumption of memory and storage resources, improves the efficiency and accuracy of map building, avoids robot downtime, and ensures accurate positioning.
Smart Images

Figure CN2025090153_04122025_PF_FP_ABST
Abstract
Description
Map generation methods, devices, robots, and storage media
[0001] Cross-reference to related applications
[0002] This application claims priority to Chinese Patent Application No. 2024106954888, filed on May 30, 2024, entitled “Map Generation Method, Apparatus, Robot and Storage Medium”, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of robot control technology, and in particular to a map generation method, apparatus, robot, and storage medium. Background Technology
[0004] With the development of technology, the robotics industry is becoming increasingly mature, and the application range of robots is expanding. For example, food delivery robots and cleaning robots can be used in the service industry. During robot movement, the robot needs a map for positioning; therefore, an accurate map is fundamental to robot movement.
[0005] Traditional map building typically uses filter methods, such as recursive Bayesian filters, to process laser data and then build maps in real time using the processed data. However, when dealing with extremely large scenes, the robot needs to maintain a large number of filter states simultaneously, which consumes a lot of computing resources, easily leads to downtime, and results in high resource overhead for map building. Summary of the Invention
[0006] According to various embodiments of this application, a map generation method, apparatus, robot, computer-readable storage medium, and computer program product are provided.
[0007] A map generation method, executed by a robot, the robot including a memory and a main memory, the memory storing local map statistics, the method comprising:
[0008] When the local map statistics in the memory meet the closed-loop detection conditions, the current point cloud data is stored in memory.
[0009] In memory, based on the location information contained in the current point cloud data and the location distance between the location information corresponding to each local map identifier, the target local map identifier is determined from each local map identifier, and the target local map corresponding to the target local map identifier is extracted from the storage and put into memory;
[0010] In memory, based on the pose error between the pose information contained in the current point cloud data and the pose information corresponding to the target local map identifier, pose correction is performed on the initial point cloud data corresponding to each local map identifier in the memory to obtain the target point cloud data corresponding to each local map identifier. The target point cloud data is then extracted from the memory into memory.
[0011] In memory, each updated local map is generated based on the point cloud data of each target. Each updated local map replaces the historical local map corresponding to each local map identifier in the memory. A global target map is then generated based on each updated local map.
[0012] This application also provides a map generation apparatus, the apparatus comprising:
[0013] The condition detection module is used to acquire the current point cloud data and store it in memory when the local map statistics in the memory meet the closed-loop detection conditions.
[0014] The map determination module is used to determine the target local map identifier from the local map identifiers in memory based on the positional distance between the positional information contained in the current point cloud data and the positional information corresponding to each local map identifier, and to extract the target local map corresponding to the target local map identifier from the memory into the memory.
[0015] The pose correction module is used to perform pose correction on the initial point cloud data corresponding to each local map identifier in the memory based on the pose error between the pose information contained in the current point cloud data and the pose information corresponding to the target local map identifier, so as to obtain the target point cloud data corresponding to each local map identifier, and extract each target point cloud data from the memory into the memory.
[0016] The map generation module is used to generate updated local maps in memory based on the point cloud data of each target, replace the historical local maps corresponding to the local map identifiers in the memory with the updated local maps, and generate a target global map based on the updated local maps.
[0017] This application also provides a robot, including a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of a map generation method.
[0018] This application also provides a computer-readable storage medium storing computer-readable instructions thereon, which, when executed by a processor, implement the steps of a map generation method.
[0019] This application also provides a computer program product including computer-readable instructions that, when executed by a processor, implement the steps of a map generation method.
[0020] Details of one or more embodiments of this application are set forth in the following drawings and description. Other features and advantages of this application will become apparent from the specification, drawings, and claims. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained from these drawings without creative effort.
[0022] Figure 1 is an application environment diagram of the map generation method in one embodiment of this application;
[0023] Figure 2 is a flowchart illustrating a map generation method in one embodiment of this application;
[0024] Figure 3 is a flowchart illustrating the map generation steps in one embodiment of this application;
[0025] Figure 4 is a flowchart illustrating a map generation method in one embodiment of this application;
[0026] Figure 5 is a flowchart illustrating the map generation method in a specific embodiment of this application;
[0027] Figure 6 is a structural block diagram of a map generation device in one embodiment of this application;
[0028] Figure 7 is an internal structural diagram of a computer device according to an embodiment of this application. Detailed Implementation
[0029] To facilitate understanding of this application, a more complete description will be provided below with reference to the accompanying drawings. Preferred embodiments of this application are shown in the drawings. However, this application can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the disclosure of this application.
[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the invention pertains. The terminology used herein in the specification of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0031] The map generation method provided in this application embodiment can be applied to the application environment shown in Figure 1, including a robot 102 and a server 104. The robot 102 and the server 104 can be connected via Bluetooth, USB (Universal Serial Bus), or network communication, and this application does not impose any limitations on this connection. In one embodiment, the robot 102 can receive task instructions sent by the server 104, such as a map generation instruction sent by the server 104 to the robot 102. The robot 102 responds to the map generation instruction by moving within a target area and generating a map corresponding to the target area. Of course, the robot 102 can also receive task instructions sent by a terminal, such as a mobile phone, computer, or smart wearable device. The robot 102 can also receive touch instructions or voice instructions through signal receiving devices such as a touchscreen or microphone installed on the robot 102, and no specific limitations are imposed on this connection.
[0032] In one embodiment, when the robot 102 detects that the local map statistics in the memory meet the closed-loop detection condition, it acquires the current point cloud data and stores it in memory. In memory, based on the positional distance between the positional information contained in the current point cloud data and the positional information corresponding to each local map identifier, it determines the target local map identifier from each local map identifier and extracts the target local map corresponding to the target local map identifier from the memory and stores it in memory. In memory, based on the pose error between the pose information contained in the current point cloud data and the pose information corresponding to the target local map identifier, it performs pose correction on the initial point cloud data corresponding to each local map identifier in the memory to obtain the target point cloud data corresponding to each local map identifier, and extracts each target point cloud data from the memory and stores it in memory. In memory, based on each target point cloud data, it generates each updated local map, replaces the historical local maps corresponding to each local map identifier in the memory with each updated local map, and generates a target global map based on each updated local map.
[0033] In one embodiment, as shown in Figure 2, a map generation method is provided. Taking the application of this method to the robot in Figure 1 as an example, the robot includes a memory and a main memory, and the memory stores a local map. The method includes the following steps:
[0034] Step 202: When the local map statistics in the memory meet the closed-loop detection conditions, the current point cloud data is stored in memory.
[0035] The term "memory" refers to a storage device within the robot used to store temporarily unused data. "Local map statistics" refers to the statistical information of the local map already stored in the memory. "Loop closure detection conditions" are the conditions used to determine whether to perform loop closure detection. Loop closure detection is the function of the robot to identify previously visited historical scenes and make the map overlap to close loops. "Current point cloud data" refers to the point cloud data corresponding to the local scene currently collected by the robot. Point cloud data is a set of sampling points representing spatial distribution under the same spatial reference frame, with each sampling point carrying its own spatial coordinates. The size of the local scene is determined by the acquisition range of the robot's point cloud acquisition device. "Memory" refers to the computing space within the robot that has both computation and storage functions.
[0036] Specifically, the robot moves within a current area, which refers to the robot's current movable area, such as its work area or information collection area. During the robot's movement, point cloud data is collected using an installed point cloud acquisition device, such as a lidar device or an optical camera. The point cloud data is then used to generate a corresponding local map, which is stored in a memory. The memory then performs statistical analysis on the stored local map to obtain local map statistical information.
[0037] When the robot detects that the local map statistics in its memory meet the closure detection condition at the current moment, it performs loop closure detection. Alternatively, a timer can be set for the memory. When the timer reaches the target time point, it triggers the memory to send statistical values from the local map statistics to the robot. The robot then checks the received statistical values, for example, by using the detected values to check the statistical values. When the statistical values meet the closure detection condition, the robot performs loop closure detection. Then, the robot receives the current point cloud data collected by the point cloud acquisition device and stores it in its memory. The current point cloud data can be the current frame point cloud data collected by the point cloud acquisition device.
[0038] Step 204: In memory, based on the location distance between the location information contained in the current point cloud data and the location information corresponding to each local map identifier, determine the target local map identifier from each local map identifier, and extract the target local map corresponding to the target local map identifier from the storage into memory.
[0039] Among these, "local map identifier" refers to the identifier of the generated local map. "Target local map identifier" refers to the local map selected for processing based on its location distance. "Location information" in the current point cloud data refers to the robot's position coordinates in the world coordinate system when acquiring the current point cloud data. "Location information" corresponding to the local map identifier refers to the location information of the specific point cloud data used to generate the local map. This specific point cloud data can be the first frame of point cloud data used when generating the local map.
[0040] Specifically, the robot collects historical point cloud data within a historical time period, uses this data to generate various historical local maps and corresponding local map identifiers in memory, and uses the location information of the specific point cloud data corresponding to each local map identifier as the location information for that local map identifier. Then, after completing the historical local maps, the robot associates and stores each historical local map, its corresponding local map identifier, and location information in the memory.
[0041] When the robot performs closed-loop detection, it retrieves the position information corresponding to each local map marker from memory and extracts the position information contained in the current point cloud data. The robot calculates the positional distance between the positional information of the current point cloud data and the positional information of each local map marker, and uses the local map marker that meets the positional distance condition as the target local map marker. Based on the target local map marker, the robot retrieves the target local map from memory and stores it in memory.
[0042] In one embodiment, the robot retrieves a target local map from storage and stores it in memory. Using in-memory computing resources, the robot scans and matches the current point cloud data with the target local map. In-memory computing resources refer to the computing power provided by memory. When the matching degree meets preset matching conditions, it is determined that the scene content represented by the current point cloud data is similar to the scene content represented by the target local map. This indicates that the robot has identified the current area as a previously visited area, and the loop closure detection ends. The robot then establishes a constraint relationship between the current point cloud data and the target local map, indicating that the current point cloud data and the target local map data form a closed loop. The robot then performs pose optimization on the point cloud data.
[0043] Step 206: In memory, based on the pose error between the pose information contained in the current point cloud data and the pose information corresponding to the target local map, pose correction is performed on the initial point cloud data corresponding to each local map identifier in the memory to obtain the target point cloud data corresponding to each local map identifier. The target point cloud data is then extracted from the memory into the memory.
[0044] The initial pose information in the current point cloud data refers to the robot's position coordinates and orientation in the robot coordinate system when the robot collects the current point cloud data, and it is the current, unoptimized pose information. The initial pose information corresponding to the local map identifier refers to the initial pose information of the specific point cloud data used to generate the local map. The pose information corresponding to the target local map refers to the initial pose information corresponding to the target local map identifier. The robot coordinate system refers to the coordinate system with the robot's initial position as the origin. The initial point cloud data refers to the set of initial point cloud data used to construct various historical local maps, and it is the current, unoptimized point cloud data.
[0045] Specifically, the robot is also equipped with motion sensors to collect motion sensing data, such as odometry data and inertial measurement data. After acquiring the current point cloud data, the robot preprocesses it, which may involve downsampling the point cloud data, for example, by using voxel filtering or adaptive voxel filtering. Then, the robot uses the preprocessed point cloud data and motion sensing data to estimate its current pose information, thus obtaining the pose information corresponding to the current point cloud data.
[0046] After identifying the target local map identifier, the robot retrieves the target local map corresponding to the identifier from memory and stores it in main memory. The robot then uses the memory's computing resources to calculate the pose error based on the pose information of the current point cloud data and the corresponding target local map. The pose error refers to the offset between poses. Next, the robot retrieves the pose error corresponding to each local map identifier from memory. For example, within a historical time period, it calculates the pose error between specific point cloud data corresponding to a historical local map and specific point cloud data corresponding to a previous historical local map.
[0047] The robot calculates the target pose error, such as the minimum pose error, based on the pose error corresponding to the current point cloud data and the pose error corresponding to each local map marker. The robot uses the target pose error to correct the pose information corresponding to the current point cloud data, and also corrects the pose information of the initial point cloud data corresponding to each local map marker in the memory based on the target pose error, thus obtaining the target point cloud data corresponding to each local map marker.
[0048] Step 208: In memory, generate each updated local map based on each target point cloud data, replace the historical local map corresponding to each local map identifier in memory with each updated local map, and generate the target global map based on each updated local map.
[0049] Specifically, after optimizing the pose of the point cloud data, the robot performs global map generation. The robot retrieves the pose-corrected point cloud data of each target from memory into memory, and uses the memory's computing resources to generate updated local maps for each target point cloud. Then, according to the local map identifiers in memory, the updated local maps replace the corresponding historical local maps in memory, until all historical local maps corresponding to each local map identifier have been replaced. Finally, the robot deletes all updated local maps from memory.
[0050] In response to the global map generation command, the robot retrieves various updated local maps from memory. It selects a starting updated local map from these maps, and then, based on the pose information of each updated local map, determines the adjacent stitched local map. This stitched local map is then stitched together with the starting updated local map to obtain a stitched map. This stitched map is used as the starting updated local map, and the process returns to the step of determining the adjacent stitched local map based on the pose information of each updated local map. This process continues until all updated local maps are stitched together to obtain the target global map.
[0051] In one embodiment, for ease of management, the memory may include a map information memory and a map management memory. The map information memory stores various historical local maps and their corresponding pose information. A table records the storage addresses and the number of local maps in the map information memory, allowing the robot to obtain local map statistics. After determining the target local map identifier from the various local map identifiers, the robot retrieves the target local map corresponding to the target local map identifier from the map information memory and stores it in memory. The map management memory stores target point cloud data, updated local maps, and the target global map. Based on the pose error between the pose information contained in the current point cloud data and the pose information corresponding to the target local map, the robot optimizes the pose of the point cloud data in the map management memory to obtain the target point cloud data. The robot then uses the target point cloud data to generate an updated local map, stores the updated local map in the map management memory, and retrieves the updated local map from the map management memory to generate the target global map.
[0052] In the aforementioned map generation method, when the local statistical information in the memory meets the closed-loop detection condition, the current point cloud data is acquired and stored in memory. The positional distance is calculated using the positional information of the current point cloud data and the positional information of each local map marker. After determining the target local map marker based on the positional distance, the target local map corresponding to the target local map marker is retrieved from memory and stored in memory. This achieves on-demand reading of data from memory during memory computation, avoiding the storage of currently unnecessary historical local maps and thus conserving memory resources. Then, memory resources are used to calculate the pose error between the current point cloud data and the target local map. This pose error is used to correct the pose of the initial point cloud data corresponding to each local map marker in memory, ensuring the pose accuracy of the target point cloud data corresponding to each local map marker. Finally, the updated local map is regenerated using the pose-corrected target point cloud data, and this updated local map replaces the historical local maps corresponding to each local map marker in memory, deleting redundant historical local maps and thus saving memory resources.
[0053] Furthermore, the updated local map has a more accurate map pose than the historical local map. By using the updated local map to generate the target global map, the accuracy of the target global map is improved.
[0054] In one embodiment, before acquiring the current point cloud data and storing it in memory when the local map statistics in the memory meet the loop closure detection condition in step 202, the map generation method further includes:
[0055] Historical point cloud data is acquired and stored in memory, and historical local maps are generated based on the historical point cloud data;
[0056] The historical local map is downsampled to obtain at least two corresponding local maps; the resolution of the corresponding local maps is lower than that of the historical local map.
[0057] Historical point cloud data, historical local maps, and associated local maps are stored in memory, and then deleted from memory.
[0058] Among them, the attached local map refers to a local map with a resolution lower than that of the historical local map.
[0059] Specifically, during the robot's movement within a historical time period, the point cloud acquisition device continuously collects multiple frames of historical point cloud data at a set acquisition frequency. The robot then utilizes its memory's computing resources to generate a historical local map based on these consecutive frames of historical point cloud data. Specifically, when the robot receives the first frame of point cloud data from the point cloud acquisition device, it generates an initial historical local map based on this first frame. Then, the robot receives subsequent frames of historical point cloud data from the point cloud acquisition device and interpolates this data into the initial historical local map. This process continues until a preset number of frames of historical point cloud data have been interpolated into the initial historical local map, resulting in the final historical local map.
[0060] The historical local map is a raster map, where each raster has a value representing an obstacle. For example, a raster with a value of 100 is an obstacle raster, and a raster with a value of 0 is an obstacle-free raster. The robot performs downsampling processing on the generated historical local map in memory, for example, by setting sliding windows of different sizes to perform convolution calculations on the raster values in the historical local map, obtaining various subordinate local maps corresponding to the historical local map. The resolution of the subordinate local maps is lower than that of the historical local map.
[0061] The robot then associates and stores the historical point cloud data, historical local map, and auxiliary local map into the memory, and deletes the historical point cloud data, historical local map, and auxiliary local map from the memory.
[0062] In this embodiment, when the closed-loop detection is not performed, whenever the historical local map and its corresponding subordinate local map are generated, the temporarily unnecessary historical local map and subordinate local map are stored in the memory, and the historical local map and subordinate local map in the memory are deleted. This realizes the on-demand release of memory resources, which can avoid the current unnecessary historical local map and subordinate local map occupying memory resources, causing the machine to crash during subsequent large-scale operations. This ensures the reasonable allocation of memory resources and improves the efficiency of map construction.
[0063] In one embodiment, the map generation method further includes:
[0064] Retrieve at least two subordinate local maps corresponding to the target local map identifier from memory into memory;
[0065] In memory, the current point cloud data is matched with at least two subordinate local maps to obtain the matching degree corresponding to at least two subordinate local maps.
[0066] When the matching degree meets the matching condition, the process proceeds to the step of performing pose correction on the initial point cloud data corresponding to each local map identifier in the memory based on the pose error between the pose information contained in the current point cloud data and the pose information corresponding to the target local map identifier.
[0067] Specifically, the robot determines the target local map identifier from among the various local map identifiers based on the position distance. This indicates that the target local map identifier may be a candidate local map that has a constraint relationship with the current point cloud data. The robot also needs to match the current point cloud data with the target local map to determine whether the target local map is in a closed loop with the current point cloud data.
[0068] The robot retrieves the target local map corresponding to the target local map identifier and at least two corresponding auxiliary local maps from the memory. The robot determines the matching order of each auxiliary local map based on its resolution, generally from low to high resolution. The robot matches the current point cloud data with each auxiliary local map according to the matching order, for example, by projecting the current point cloud data onto each auxiliary local map, and calculates the degree of overlap between the current point cloud data and each auxiliary local map to obtain the matching degree. When the matching degree of each auxiliary local map increases sequentially according to the matching order, it indicates that the matching degree of each auxiliary local map meets the matching condition, thus determining that the current point cloud data and the target local map have a constraint relationship. Then, the robot performs pose correction on the initial point cloud data corresponding to each local map identifier in the memory based on the pose error between the pose information contained in the current point cloud data and the pose information corresponding to the target local map identifier.
[0069] In this embodiment, since the resolution of the target local map is higher than that of the subordinate local map, the subordinate local map is first matched with the current point cloud data to determine whether the target local map and the current point cloud data are in a closed loop. Then, the pose error between the target local map and the current point cloud data is calculated. This avoids the unnecessary memory overhead caused by directly matching the current point cloud data with the high-resolution target local map, thereby saving memory resources.
[0070] In one embodiment, based on the pose error between the pose information contained in the current point cloud data and the pose information corresponding to the target local map identifier, pose correction is performed on the initial point cloud data corresponding to each local map identifier in the memory to obtain the target point cloud data corresponding to each local map identifier, including:
[0071] Based on the pose information contained in the current point cloud data and the pose information corresponding to the target local map marker, the current relative pose is obtained;
[0072] Retrieve the historical relative poses corresponding to the local map markers of each closed loop from the memory;
[0073] Error optimization is performed based on the current relative pose and historical relative pose to obtain the error optimization value corresponding to each local map marker. Based on the error optimization value, pose correction is performed on the initial point cloud data corresponding to each local map marker to obtain the target point cloud data corresponding to each local map marker.
[0074] The target point cloud data corresponding to each local map identifier is stored in the memory, and the target point cloud data corresponding to each local map identifier is deleted from the memory.
[0075] Here, closed-loop local map identifiers refer to the identifiers corresponding to historical local maps with constraints. Historical relative pose refers to the pose error between historical local maps and point cloud data with constraints. Error optimization value refers to the target value for adjusting the pose error.
[0076] Specifically, the robot utilizes memory's computing resources to calculate the pose difference between the current point cloud data's pose information and the target local map's pose information, thus obtaining the current relative pose. This can be achieved by projecting the current point cloud data onto the target local map, rotating the current point cloud data sequentially according to rotation angles, and calculating the degree of overlap between the current point cloud data and the target local map. The pose with the highest degree of overlap is determined as the current relative pose between the current point cloud data and the target local map. Then, the robot retrieves the historical relative poses corresponding to each constraint relationship from memory, i.e., the pose error between the historical local map and its closed-loop historical point cloud data within the constraint relationship.
[0077] The robot invokes a preset pose optimization algorithm to optimize the error of the current relative pose and each historical relative pose. The preset pose algorithm is, for example, an optimizer. The robot calculates the minimum pose error based on the current relative pose and each historical relative pose using the preset optimization algorithm, and uses the minimum pose error to correct the pose information of the current point cloud data and the pose information of the historical point cloud data corresponding to each historical local map in the memory, to obtain the target point cloud data corresponding to each local map identifier.
[0078] The robot stores the target point cloud data corresponding to each local map marker in the memory, and deletes the target point cloud data corresponding to each local map marker from the memory.
[0079] In this embodiment, by optimizing the error based on the current relative pose and the historical relative pose corresponding to each closed-loop local map marker, and using the optimized error value to correct the pose of each initial point cloud data, the pose error accumulated by the robot's long-term motion is corrected, thus ensuring the accuracy of robot positioning.
[0080] In one embodiment, as shown in Figure 3, in memory, updated local maps are generated based on the target point cloud data, and the updated local maps replace the historical local maps corresponding to the respective local map identifiers in memory, including:
[0081] Step 302: Determine the current local map identifier from each local map identifier, and retrieve the current target point cloud data corresponding to the current local map identifier from the memory and store it in memory;
[0082] Step 304: In memory, determine the starting point cloud data from the current target point cloud data, and generate the initial local map corresponding to the current local map identifier based on the starting point cloud data;
[0083] Step 306: Based on the remaining point cloud data in the current target point cloud data, perform interpolation processing on the initial local map to obtain the updated local map corresponding to the current local map identifier;
[0084] Step 308: Replace the historical local map corresponding to the current local map identifier in the memory with the updated local map corresponding to the current local map identifier, and delete the updated local map corresponding to the current local map identifier in the memory.
[0085] Step 310: Determine the current local map identifier from the remaining local map identifiers, and return to the step of retrieving the current target point cloud data corresponding to the current local map identifier from the memory and storing it in memory, until the target point cloud data corresponding to each local map identifier in the memory are all used in the calculation to obtain each updated local map.
[0086] Updating the local map refers to generating a local map using the pose-corrected point cloud data. The current local map identifier is the identifier of the local map to be generated. The current target point cloud data refers to the point cloud data used to generate the current local map. The initial local map refers to the initial local map to be populated with the point cloud data.
[0087] Specifically, the robot iterates through the attribute information corresponding to each local map in the memory. The attribute information includes, for example, the generation time and number. It determines the current local map identifier from the various local map identifiers. This can be done randomly or by selecting the earliest generated local map identifier according to time order. Then, the robot retrieves the current target point cloud data corresponding to the current local map identifier from the memory and stores it in the memory. The current target point cloud data includes point cloud data from multiple frames.
[0088] The robot utilizes memory's computing resources and uses the first frame of point cloud data from the current target point cloud data as the starting point cloud data. This starting point cloud data can be determined by a number or the acquisition time. The robot generates an initial local map corresponding to the current local map identifier based on the starting point cloud data. Then, the robot performs interpolation processing on the remaining multiple frames of point cloud data in the current target point cloud data, according to time sequence or number, to obtain an updated local map corresponding to the current local map identifier. This updated local map replaces the historical local map corresponding to the current local map identifier in memory, and the updated local map and its corresponding current target point cloud data are deleted from memory. For example, the robot retrieves the current local map identifier A from memory and obtains the corresponding target point cloud data, which includes frames 1-10 of point cloud data. The robot generates an initial local map based on the first frame of point cloud data, and then interpolates the point cloud data of subsequent frames 2-10 into the initial local map according to their numbers to obtain the updated local map corresponding to the current local map identifier A.
[0089] The robot accesses the memory again, determines the current local map identifier from the remaining local map identifiers in the memory, and returns to the step of retrieving the current target point cloud data corresponding to the current local map identifier from the memory and storing it in memory. This process continues until the target point cloud data corresponding to each local map identifier in the memory are all used in the calculation to obtain each updated local map.
[0090] In one specific embodiment, after generating an initial local map, the robot scans and matches the point cloud data of the next frame with the initial local map, calculates the relative pose between the point cloud data of the next frame and the initial local map, adjusts the point cloud data of the next frame with the relative pose, and interpolates the point cloud data of the next frame into the initial local map. This process is repeated for the point cloud data of subsequent frames until the remaining point cloud data in the current target point cloud data is interpolated into the initial local map to obtain an updated local map.
[0091] In one specific embodiment, the robot statistically analyzes the resource consumption information corresponding to the updated local map. Based on the resource consumption information and current memory computing resources, it determines the current map generation quantity. Then, it identifies the local map identifiers corresponding to the current map generation quantity in memory, uses each local map identifier as the current local map identifier, and stores the current target point cloud data corresponding to the current local map identifier in memory. Next, it proceeds to the step of determining the starting point cloud data from the current target point cloud data, obtaining the updated local map corresponding to the current map generation quantity, and storing it in memory. The updated local map corresponding to the current map generation quantity is then deleted from memory. The robot then statistically analyzes the resource consumption information corresponding to the remaining updated local maps and proceeds to the step of determining the current map generation quantity based on the resource consumption information and current memory computing resources, until the updated local maps corresponding to each local map identifier in memory are obtained.
[0092] In this embodiment, by storing all target point cloud data in memory, when an updated local map needs to be generated, the current target point cloud data corresponding to the current local map identifier is retrieved from memory and stored in memory for the generation of the updated local map. This avoids storing all target point cloud data in memory when memory resources are limited, thus avoiding the consumption of memory resources. It achieves on-demand reading of the current target point cloud data during in-memory computation. Then, after the updated local map is generated and stored in memory, it is deleted from memory to prepare for the generation of the next updated local map. This achieves on-demand release of memory resources, ensuring reasonable allocation of memory resources and saving memory resources.
[0093] In one embodiment, as shown in Figure 4, generating a target global map based on each updated local map includes:
[0094] Step 402: In response to the global map generation command, retrieve the updated local map of the target number from memory and load it into memory;
[0095] Step 404: In memory, stitch the updated local map for the target number to obtain a stitched local map, store the stitched local map in the memory, and delete the stitched local map from memory.
[0096] Step 406: Extract the target number of updated local maps from the remaining updated local maps in the memory into the memory, and return to the step of stitching the target number of updated local maps in the memory until all updated local maps in the memory participate in the update and obtain each stitched local map.
[0097] Step 408: Retrieve each stitched local map from the memory into the memory, and merge the stitched local maps in the memory to obtain the target global map.
[0098] Specifically, the robot associates and stores each updated map with its corresponding target point cloud data in memory, then releases the computing resources in memory. The updated local maps carry numbers. When the robot responds to a global map generation command, it detects that the number of updated local maps in memory exceeds the number of stitches required. It then retrieves the target number of consecutively numbered updated local maps from memory into memory. The robot then stitches these updated local maps together in memory according to their numbers to obtain a stitched local map. Finally, the robot stores the stitched local map in memory and releases the stitched local map from memory.
[0099] The robot extracts the target number of updated local maps from the remaining updated local maps in the memory and puts them into memory. Then, it returns to the memory and performs the step of stitching the target number of updated local maps together until all the updated local maps in the memory have participated in the update and the stitched local maps are obtained.
[0100] Then, if the robot detects that the number of stitched local maps in the memory is less than or equal to the number of stitches, it will retrieve each stitched local map from the memory and put it into memory. In memory, the stitched local maps will be merged to obtain the target global map.
[0101] For example, if the memory stores four updated local maps A, B, C, and D, exceeding the stitching limit of 2, the robot will extract updated local maps A and B into memory and stitch them together to obtain a stitched local map 'a'. Then, it will store stitched local map 'a' back into memory and release it from memory. The robot will then extract updated local maps C and D into memory and stitch them together to obtain a stitched local map 'b'. It will then store stitched local map 'b' back into memory and release it from memory. If the robot detects that the number of stitched local maps equals the stitching limit, it will extract stitched maps 'a' and 'b' into memory and merge them to obtain the target global map.
[0102] In this embodiment, by reading and updating local maps in batches, stitching them together, storing the stitched local maps in the memory, and deleting the stitched local maps from the memory, the utilization rate of memory resources can be improved when memory resources are limited.
[0103] In one embodiment, when the local map statistics in the memory meet the loop closure detection condition, the current point cloud data is stored in memory, including:
[0104] When the number of local maps based on local map statistics in memory meets the quantity condition, the system enters the closed-loop detection state and acquires the current point cloud data and stores it in memory.
[0105] Specifically, each time the robot generates a new local map, it stores the new local map in memory. Then, it counts the number of local maps in memory to obtain local map statistics. When the robot detects that the number of local maps in the local map statistics in memory meets the quantity condition, it enters the closed-loop detection state and begins to perform closure detection work, returning to the step of acquiring the current point cloud data and storing it in memory, until the target global map is generated based on each updated local map.
[0106] In one embodiment, the robot can also acquire the robot's movement distance, such as odometer data. When the robot's movement distance reaches the distance condition, it enters the closed-loop detection state and begins to perform the closure detection work.
[0107] In this embodiment, the robot is determined to perform closed-loop detection based on the number of local maps. The logic is simple, avoids the cumulative error of the robot's long-term movement from affecting the robot's positioning, and ensures the accuracy of the robot's positioning.
[0108] In one specific embodiment, as shown in Figure 5, a schematic diagram of a map generation process is provided. The figure includes a sensor data module, a preprocessing module, a front-end module, a back-end module, a map management module, and a memory. The front-end module is used for local mapping and includes sub-modules such as scan matching, motion filters, and local maps. The back-end module is used for global optimization and includes sub-modules such as loop closure detection, constraint calculation, and pose optimization. The memory, such as a disk, may include a map information memory and a map management memory corresponding to the map management module. The map information memory stores map information, including historical local maps and corresponding pose information. The map management memory stores pose-optimized point cloud data, local maps, and the global map.
[0109] The sensor data module is used to receive sensor data, including point cloud data collected by point cloud acquisition devices (such as lidar devices), odometer data collected by motion sensors, and inertial measurement data.
[0110] The preprocessing module is used to preprocess sensor data, including downsampling point cloud data, such as using voxel filtering and adaptive voxel filtering to process the point cloud data.
[0111] The front-end module is used to generate corresponding local maps based on preprocessed point cloud data through sub-modules such as scan matching, motion filters, and local maps.
[0112] The backend module is used to optimize the pose of point cloud data through sub-modules such as loop closure detection, constraint calculation, and pose optimization.
[0113] The map management module is used to generate a global map based on a local map.
[0114] The steps for generating a global map are as follows:
[0115] The robot receives current point cloud data collected by a point cloud acquisition device and stores it in memory. In memory, the current point cloud data is then input sequentially to a voxel filter and an adaptive voxel filter for downsampling and other preprocessing to obtain preprocessed current point cloud data. This preprocessed data is then used to generate an initial local map. The robot also receives odometry and inertial measurement data from motion sensors. This odometry and inertial measurement data, along with the pose obtained from the previous scan, are input to a pose fusion unit. The pose fusion unit fuses the odometry and inertial measurement data, along with the pose obtained from the previous scan, and outputs the initial pose for the current scan.
[0116] The robot inputs the initial pose of the current scan matching output by the pose fusion unit, along with the preprocessed current point cloud data, into the front-end module for scan matching. The module outputs the optimal pose of the scan matching, representing the optimal pose that should exist at the current moment relative to a previous time period. Then, the optimal pose output by the scan matching is input into the motion filter. The motion filter calculates the change in pose between the current and previous input poses. If the change in pose exceeds a distance, angle, or time threshold, the preprocessed current point cloud data is inserted into the initial local map to obtain the local map.
[0117] Then, a multi-resolution local map, or auxiliary local map, is generated based on the local map. The robot stores the completed local map and multi-resolution local map in the map information storage, and then releases them from memory. The map information storage contains a map record table, including a header, which records the storage addresses of each local map, multi-resolution local map, and local map information in the map information storage. Local map information includes, for example, the pose information corresponding to the local map. The storage addresses of the local map and its corresponding local map information, as well as the storage address of the corresponding multi-resolution local map, can be found based on the header of the map record table. This allows for subsequent retrieval of the required data from the map information storage based on the storage addresses recorded in the map record table, and for updating the map record table based on newly stored local maps and their information.
[0118] The robot inputs a local map into the backend module for loop closure detection, using local maps and point cloud data to detect loops. When the local map statistics in the map information storage meet the loop closure detection conditions, constraint calculation is performed. This involves retrieving historical local maps from the map information storage, calculating the positional distance between the current point cloud data and each historical local map, and using historical local maps with distances less than a threshold as target local maps. The constraint relationship between the target local map and the current point cloud data is then calculated and stored in the map information storage. The loop closure detection process ends when the positional distance between the current point cloud data and each historical local map is greater than the positional distance threshold. Finally, the robot optimizes the pose of each point cloud data in the map information storage based on the constraint relationship between the current point cloud data and the target local map.
[0119] Then, the robot runs the map management module to generate a global map from the local map processed by the backend module. This involves acquiring point cloud data, iterating through the point cloud data, and interpolating the point cloud data to generate updated local maps. During the generation of each updated local map, the robot stores each completed updated local map and its corresponding point cloud data in the map management memory, and releases the updated local map and its corresponding point cloud data from memory. Once all updated local maps are generated, they are read from the map management memory, merged, and the final target global map is obtained and stored in the map management memory. The robot can also use the updated local maps in the map management memory to replace the corresponding local maps in the map information memory, ensuring that the map in the map information memory is updated in real time.
[0120] In this embodiment, when the local map statistics in the memory meet the closed-loop detection condition, the current point cloud data is acquired and stored in memory. The positional distance is calculated using the positional information of the current point cloud data and the positional information of each local map identifier. After determining the target local map identifier based on the positional distance, the target local map corresponding to the target local map identifier is retrieved from the memory and stored in memory. This achieves on-demand reading of memory data during memory computation, avoiding the storage of currently unnecessary historical local maps and thus saving memory resources. Then, the memory resources are used to calculate the pose error between the current point cloud data and the target local map. The pose error is used to correct the pose of the initial point cloud data corresponding to each local map identifier in the memory, ensuring the pose accuracy of the target point cloud data corresponding to each local map identifier. Finally, the corresponding updated local map is regenerated using the pose-corrected target point cloud data, and the updated local map replaces the historical local maps corresponding to each local map identifier in the memory. Redundant historical local maps are deleted, thereby saving memory resources.
[0121] Furthermore, the updated local map has a more accurate map pose than the historical local map. By using the updated local map to generate the target global map, the accuracy of the target global map is improved.
[0122] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0123] Based on the same inventive concept, this application also provides a map generation apparatus for implementing the map generation method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more map generation apparatus embodiments provided below can be found in the limitations of the map generation method described above, and will not be repeated here.
[0124] In an exemplary embodiment, as shown in FIG6, a map generation device 600 is provided, including: a condition detection module 602, a map determination module 604, a pose correction module 606, and a map generation module 608, wherein:
[0125] The condition detection module 602 is used to acquire the current point cloud data and store it in memory when the local map statistics in the memory meet the closed-loop detection conditions;
[0126] The map determination module 604 is used to determine the target local map identifier from the local map identifiers in memory based on the positional distance between the positional information contained in the current point cloud data and the positional information corresponding to each local map identifier, and to extract the target local map corresponding to the target local map identifier from the memory into the memory.
[0127] The pose correction module 606 is used to perform pose correction on the initial point cloud data corresponding to each local map identifier in the memory based on the pose error between the pose information contained in the current point cloud data and the pose information corresponding to the target local map identifier, to obtain the target point cloud data corresponding to each local map identifier, and to extract each target point cloud data from the memory into the memory.
[0128] The map generation module 608 is used to generate updated local maps in memory based on the point cloud data of each target, replace the historical local maps corresponding to the local map identifiers in the memory with the updated local maps, and generate a target global map based on the updated local maps.
[0129] In one embodiment, the map generation apparatus 600 is further configured to acquire historical point cloud data and store it in memory, generate a historical local map based on the historical point cloud data, perform downsampling processing on the historical local map to obtain at least two subordinate local maps corresponding to the historical local map, wherein the resolution of the subordinate local maps is lower than that of the historical local map, associate and store the historical point cloud data, the historical local map, and the subordinate local maps in a memory, and delete the historical point cloud data, the historical local map, and the subordinate local maps from the memory.
[0130] In one embodiment, the historical local map is a raster map, and each raster in the raster map includes a corresponding raster value; the map generation device 600 is further configured to perform convolution calculations on the raster values in the historical local map according to each preset-sized sliding window, to obtain at least two subordinate local maps corresponding to the historical local map.
[0131] In one embodiment, the map generation apparatus 600 is further configured to retrieve at least two subordinate local maps corresponding to the target local map identifier from the memory and store them in the memory; in the memory, perform map scene matching between the current point cloud data and the at least two subordinate local maps respectively to obtain the matching degree corresponding to the at least two subordinate local maps; when the matching degree meets the matching condition, proceed to the step of performing pose correction on the initial point cloud data corresponding to each local map identifier in the memory based on the pose error between the pose information contained in the current point cloud data and the pose information corresponding to the target local map identifier.
[0132] In one embodiment, the map generation device 600 is further configured to determine the matching order of each subordinate local map according to the resolution of each subordinate local map; project the current point cloud data into each subordinate local map according to the matching order; and calculate the degree of overlap of the current point cloud data in each subordinate local map to obtain the matching degree of each subordinate local map.
[0133] In one embodiment, the map generation apparatus 600 is further configured to determine that the matching degree of each subordinate local map satisfies the matching condition when the matching degree of each subordinate local map increases sequentially according to the matching order.
[0134] In one embodiment, the map generation device 600 is further configured to collect historical point cloud data; generate each historical local map and the local map identifier corresponding to each historical local map in memory based on the historical point cloud data; and use the location information of the specific point cloud data corresponding to each local map identifier as the location information corresponding to each local map identifier, and associate and store each historical local map, the local map identifier corresponding to each historical local map and the location information in the memory.
[0135] In one embodiment, the pose correction module 606 is further configured to: extract the target local map corresponding to the target local map identifier from the memory and store it in the memory; call the computing resources of the memory to calculate the pose error based on the pose information of the current point cloud data and the pose information corresponding to the target local map, thereby obtaining the pose error corresponding to the current point cloud data; calculate the target pose error based on the pose error corresponding to the current point cloud data and the pose errors corresponding to each local map identifier; the pose error corresponding to the local map identifier is the pose error between specific point cloud data in the historical local map corresponding to the local map identifier and specific point cloud data in the previous historical local map; perform pose correction on the pose information corresponding to the current point cloud data based on the target pose error; and perform pose correction on the pose information of the initial point cloud data corresponding to each local map identifier in the memory based on the target pose error, thereby obtaining the target point cloud data corresponding to each local map identifier.
[0136] In one embodiment, the pose correction module 606 is further configured to: obtain the current relative pose based on the pose information contained in the current point cloud data and the pose information corresponding to the target local map identifier; retrieve the historical relative poses corresponding to each closed-loop local map identifier from the memory; perform error optimization based on the current relative pose and the historical relative pose to obtain the error optimization value corresponding to each local map identifier; perform pose correction on the initial point cloud data corresponding to each local map identifier based on the error optimization value to obtain the target point cloud data corresponding to each local map identifier; store the target point cloud data corresponding to each local map identifier in the memory; and delete the target point cloud data corresponding to each local map identifier from the memory.
[0137] In one embodiment, the pose correction module 606 is further configured to project the current point cloud data onto the target local map, and rotate the current point cloud data sequentially according to the rotation angle; and calculate the degree of overlap between the current point cloud data and the target local map at each rotation, and determine the pose corresponding to the current point cloud data when the degree of overlap is the highest as the current relative pose between the current point cloud data and the target local map.
[0138] In one embodiment, the map generation module 608 is further configured to: determine a current local map identifier from the various local map identifiers; retrieve the current target point cloud data corresponding to the current local map identifier from the memory and store it in the memory; determine starting point cloud data from the current target point cloud data in the memory; generate an initial local map corresponding to the current local map identifier based on the starting point cloud data; perform interpolation processing on the initial local map based on the remaining point cloud data in the current target point cloud data to obtain an updated local map corresponding to the current local map identifier; replace the historical local map corresponding to the current local map identifier in the memory with the updated local map corresponding to the current local map identifier; delete the updated local map corresponding to the current local map identifier in the memory; determine the current local map identifier from the remaining local map identifiers, and return to the step of retrieving the current target point cloud data corresponding to the current local map identifier from the memory and storing it in the memory, until all target point cloud data corresponding to each local map identifier in the memory are used in the calculation to obtain each updated local map.
[0139] In one embodiment, the map generation module 608 is further configured to: scan and match the point cloud data of the next frame with the initial local map from the remaining point cloud data in the current target point cloud data; calculate the relative pose between the point cloud data of the next frame and the initial local map; adjust the point cloud data of the next frame based on the relative pose; interpolate the point cloud data of the next frame into the initial local map; and return to the step of scanning and matching the point cloud data of the next frame with the initial local map based on the remaining point cloud data in the current target point cloud data, until the remaining point cloud data in the current target point cloud data is interpolated into the initial local map to obtain the updated local map corresponding to the current local map identifier.
[0140] In one embodiment, the map generation module 608 is further configured to, in response to a global map generation instruction, extract a target number of updated local maps from memory into memory; in memory, stitch the target number of updated local maps together to obtain stitched local maps, store the stitched local maps in memory, and delete the stitched local maps from memory; extract the target number of updated local maps from the remaining updated local maps in memory into memory, and return to the step of stitching the target number of updated local maps in memory until all updated local maps in memory have participated in the update, resulting in various stitched local maps; retrieve each stitched local map from memory into memory, and merge the various stitched local maps in memory to obtain the target global map.
[0141] In one embodiment, the condition detection module 602 is further configured to enter a closed-loop detection state and acquire the current point cloud data and store it in memory when the number of local maps based on the local map statistics in the memory meets the quantity condition.
[0142] In one embodiment, the condition detection module 602 is further configured to acquire the robot's movement distance, and when the movement distance reaches a preset distance condition, enter a closed-loop detection state to acquire the current point cloud data and store it in the memory.
[0143] Each module in the aforementioned map generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0144] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram is shown in Figure 7. The computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is connected to the system bus via the I / O interfaces. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer-readable instructions, and a database. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium. The database of the computer device is used to store data. The I / O interfaces of the computer device are used for exchanging information between the processor and external devices. The communication interface of the computer device is used for communicating with external terminals via a network connection. When the computer-readable instructions are executed by the processor, a map generation method is implemented.
[0145] Those skilled in the art will understand that the structure shown in Figure 7 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or may combine certain components, or may have different component arrangements.
[0146] In one embodiment, a robot is also provided, including a memory and a processor. The memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps in the above-described method embodiments. The robot can be various autonomous mobile machines and devices such as cleaning robots, delivery robots, guiding robots, disinfection robots, logistics robots, inspection robots, security robots, and industrial robots.
[0147] In one embodiment, a computer-readable storage medium is provided that stores computer-readable instructions that, when executed by a processor, implement the steps in the above method embodiments.
[0148] In one embodiment, a computer program product is provided, including computer-readable instructions that, when executed by a processor, implement the steps in the above method embodiments.
[0149] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0150] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a non-volatile computer-readable storage medium. When executed, these computer-readable instructions can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. 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), magnetic 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 take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0151] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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, they should be considered to be within the scope of this specification.
[0152] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for generating a map, performed by a robot, the robot comprising a memory and an internal memory, the memory storing local map statistics; the method comprising: storing current point cloud data in the internal memory when the local map statistics in the memory satisfy a loop closure detection condition; in the internal memory, determining a target local map identifier from the local map identifiers based on a position distance between position information contained in the current point cloud data and position information respectively corresponding to the local map identifiers, and extracting a target local map corresponding to the target local map identifier from the memory to the internal memory; in the internal memory, performing pose correction on initial point cloud data respectively corresponding to the local map identifiers in the memory based on a pose error between pose information contained in the current point cloud data and pose information corresponding to the target local map, to obtain target point cloud data respectively corresponding to the local map identifiers, and extracting each target point cloud data from the memory to the internal memory; and in the internal memory, generating each updated local map based on the target point cloud data respectively, replacing historical local maps respectively corresponding to the local map identifiers in the memory with the updated local maps, and generating a target global map based on the updated local maps.
2. The method of claim 1, wherein, Before storing current point cloud data in the internal memory when the local map statistics in the memory satisfy a loop closure detection condition, the method further comprises: storing historical point cloud data in the internal memory, and generating a historical local map based on the historical point cloud data; performing down-sampling processing on the historical local map to obtain at least two affiliated local maps corresponding to the historical local map; the resolution of the affiliated local maps is lower than the resolution of the historical local map; and storing the historical point cloud data, the historical local map, and the affiliated local maps in the memory in association, and deleting the historical point cloud data, the historical local map, and the affiliated local maps in the internal memory.
3. The method of claim 2, wherein, The historical local map is a grid map, each grid in the grid map comprises a corresponding grid value; the down-sampling processing on the historical local map to obtain at least two affiliated local maps corresponding to the historical local map comprises: performing convolution calculation on the grid values in the historical local map respectively according to each preset size of a sliding window to obtain at least two affiliated local maps corresponding to the historical local map.
4. The method of claim 2, wherein, The method further comprises: extracting at least two affiliated local maps corresponding to the target local map identifier from the memory to the internal memory; in the internal memory, performing map scene matching between the current point cloud data and the at least two affiliated local maps respectively to obtain matching degrees corresponding to the at least two affiliated local maps; and When the matching degree meets the matching condition, entering the step of correcting the pose of the initial point cloud data corresponding to each local map identifier in the memory based on the pose error between the pose information contained in the current point cloud data and the pose information corresponding to the target local map identifier.
5. The method of claim 4, wherein, The matching of the current point cloud data with the at least two affiliated local maps in the memory to obtain the matching degrees of the at least two affiliated local maps comprises: According to the resolution of each affiliated local map, determining the matching order corresponding to each affiliated local map; According to the matching order, projecting the current point cloud data into each affiliated local map to obtain the matching degree corresponding to each affiliated local map.
6. The method of claim 5, wherein, The method further comprises: When it is detected that the matching degrees corresponding to each affiliated local map increase one by one according to the matching order, it is determined that the matching degrees corresponding to each affiliated local map meet the matching condition.
7. The method of claim 1, wherein, The method further comprises: Collecting historical point cloud data; In the memory, generating each historical local map and the local map identifier corresponding to each historical local map based on the historical point cloud data; and Storing the position information of the specific point cloud data corresponding to each local map identifier as the position information corresponding to each local map identifier, and storing the each historical local map, the local map identifier and the position information corresponding to each historical local map in the memory.
8. The method of claim 1, wherein, The pose correction of the initial point cloud data corresponding to each local map identifier in the memory based on the pose error between the pose information contained in the current point cloud data and the pose information corresponding to the target local map identifier to obtain the target point cloud data corresponding to each local map identifier comprises: Extracting the target local map corresponding to the target local map identifier from the memory to the memory; Calling the computing resource of the memory to calculate the pose error between the pose information of the current point cloud data and the pose information corresponding to the target local map to obtain the pose error corresponding to the current point cloud data; According to the pose error corresponding to the current point cloud data and the pose error corresponding to each local map identifier, calculating the target pose error; the pose error corresponding to the local map identifier is the pose error between the specific point cloud data in the local map identifier and the specific point cloud data in the previous historical local map; Based on the target pose error, correcting the pose information of the current point cloud data; and According to the target pose error, correcting the pose information of the initial point cloud data corresponding to each local map identifier in the memory to obtain the target point cloud data corresponding to each local map identifier.
9. The method of claim 1, wherein, The pose error between the pose information contained in the current point cloud data and the corresponding pose information of the target local map is obtained based on the pose information contained in the current point cloud data and the corresponding pose information of the target local map, and the initial point cloud data corresponding to each local map identifier in the memory is subjected to pose correction to obtain target point cloud data corresponding to each local map identifier, comprising: A current relative pose is obtained based on the pose information contained in the current point cloud data and the corresponding pose information of the target local map; A historical relative pose corresponding to each closed-loop local map identifier is obtained from the memory; Error optimization values corresponding to each local map identifier are obtained based on the current relative pose and the historical relative pose, and the initial point cloud data corresponding to each local map identifier is subjected to pose correction based on the error optimization values to obtain target point cloud data corresponding to each local map identifier; and The target point cloud data corresponding to each local map identifier is stored in the memory, and the target point cloud data corresponding to each local map identifier is deleted in the memory.
10. The method of claim 9, wherein, The current relative pose is obtained based on the pose information contained in the current point cloud data and the corresponding pose information of the target local map, comprising: The current point cloud data is projected into the target local map, and the current point cloud data is rotated successively according to a rotation angle; and The degree of coincidence between the current point cloud data and the target local map is calculated at each rotation, and the pose corresponding to the current point cloud data when the degree of coincidence is the highest is determined as the current relative pose between the current point cloud data and the target local map.
11. The method of claim 1, wherein, In the memory, each updated local map is generated based on each target point cloud data, and the historical local map corresponding to each local map identifier in the memory is replaced by the updated local map corresponding to each local map identifier, comprising: A current local map identifier is determined from each local map identifier, and the current target point cloud data corresponding to the current local map identifier is obtained from the memory and stored in the memory; In the memory, a starting point cloud data is determined from the current target point cloud data, and an initial local map corresponding to the current local map identifier is generated based on the starting point cloud data; The initial local map is subjected to interpolation processing based on the remaining point cloud data in the current target point cloud data to obtain an updated local map corresponding to the current local map identifier; The updated local map corresponding to the current local map identifier is used to replace the historical local map corresponding to the current local map identifier in the memory, and the updated local map corresponding to the current local map identifier is deleted in the memory; and The current local map identifier is determined from the remaining local map identifiers, and the step of obtaining the current target point cloud data corresponding to the current local map identifier from the memory and storing it in the memory is executed until each target point cloud data corresponding to each local map identifier in the memory participates in the calculation to obtain each updated local map.
12. The method of claim 11, wherein, The initial local map is interpolated based on the remaining point cloud data in the current target point cloud data to obtain an updated local map corresponding to the current local map identifier, including: The next frame of point cloud data is scanned and matched with the initial local map from the remaining point cloud data in the current target point cloud data, and the relative pose between the next frame of point cloud data and the initial local map is calculated; and The next frame of point cloud data is adjusted based on the relative pose, the adjusted next frame of point cloud data is interpolated into the initial local map, and the step of scanning and matching the next frame of point cloud data with the initial local map from the remaining point cloud data in the current target point cloud data is executed until the remaining point cloud data in the current target point cloud data is interpolated into the initial local map to obtain an updated local map corresponding to the current local map identifier.
13. The method of claim 1, wherein, The target global map is generated based on the respective updated local maps, including: In response to a global map generation instruction, the target number of updated local maps are extracted from the storage to the memory; In the memory, the target number of updated local maps are stitched to obtain a stitched local map, the stitched local map is stored in the storage, and the stitched local map is deleted in the memory; The target number of updated local maps are extracted from the remaining updated local maps in the storage to the memory, and the step of stitching the target number of updated local maps in the memory is executed until each updated local map in the storage participates in updating to obtain each stitched local map; and The respective stitched local maps are obtained from the storage to the memory, and the respective stitched local maps are merged in the memory to obtain a target global map.
14. The method of claim 1, wherein, When the local map statistical information in the storage meets the closed loop detection condition, the current point cloud data is obtained and stored in the memory, including: When the number of local maps based on the local map statistical information in the storage meets the number condition, the closed loop detection state is entered, and the current point cloud data is obtained and stored in the memory.
15. The method of claim 1, wherein, When the local map statistical information in the storage meets the closed loop detection condition, the current point cloud data is obtained and stored in the memory, including: The moving distance of the robot is obtained, and when the moving distance meets the preset distance condition, the closed loop detection state is entered, and the current point cloud data is obtained and stored in the memory.
16. A robot map generation apparatus characterized by comprising: The device includes: A condition detection module for obtaining and storing the current point cloud data in the memory when the local map statistical information in the storage meets the closed loop detection condition; A map determination module for determining a target local map identifier from the respective local map identifiers in the memory based on the position distance between the position information contained in the current point cloud data and the respective position information corresponding to each local map identifier, and extracting the target local map corresponding to the target local map identifier from the storage to the memory; a pose correction module, configured to perform pose correction on initial point cloud data corresponding to each of the local map identifiers in the memory based on a pose error between pose information contained in the current point cloud data and corresponding pose information of the target local map identifier, to obtain target point cloud data corresponding to each of the local map identifiers, and extract each of the target point cloud data from the memory to the memory; a map generation module, configured to generate an updated local map based on each of the target point cloud data in the memory, replace a historical local map corresponding to each of the local map identifiers in the memory with the updated local map, and generate a target global map based on the updated local maps.
17. The apparatus of claim 16, wherein, The device is further configured to: store historical point cloud data in the memory, and generate a historical local map based on the historical point cloud data; perform down-sampling processing on the historical local map to obtain at least two affiliated local maps corresponding to the historical local map, the resolution of the affiliated local maps being lower than that of the historical local map; and store the historical point cloud data, the historical local map and the affiliated local maps in the memory, and delete the historical point cloud data, the historical local map and the affiliated local maps in the memory.
18. The apparatus of claim 17, wherein, The device is further configured to: obtain at least two affiliated local maps corresponding to the target local map identifier from the memory to the memory; perform map scene matching between the current point cloud data and the at least two affiliated local maps in the memory to obtain matching degrees corresponding to the at least two affiliated local maps; and when the matching degrees satisfy a matching condition, perform pose correction on initial point cloud data corresponding to each of the local map identifiers in the memory based on a pose error between pose information contained in the current point cloud data and corresponding pose information of the target local map identifier. 19.A robot comprising a memory and a processor, the memory storing computer readable instructions, and the processor implementing steps of the method of any one of claims 1 to 15 when executing the computer readable instructions. 20.A computer readable storage medium storing computer readable instructions, the computer readable instructions implementing steps of the method of any one of claims 1 to 15 when executed by a processor.
Citation Information
Patent Citations
Map construction method, equipment and medium
CN114924287A
Real-time positioning and mapping method and device and terminal equipment
CN115406452A
Extended mapping method and device, computer equipment and storage medium
CN116481517A
Map generation method and device, robot and storage medium
CN118550979A
Three-dimensional laser mapping method and system
WO2021109167A1