A map construction method, device, robot and storage medium
By generating and reconstructing maps and optimizing keyframe poses, the problem of internal errors of sub-maps reflected on the final map in the prior art is solved, and the optimized display and error reduction of the map are achieved, and the accuracy of robot positioning and navigation is improved.
Patent Information
- Application Number
- CN202311747666.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-18
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2043-12-18
AI Technical Summary
In the existing two-dimensional laser mapping technology, the sub-graph only adjusts the position after the construction is completed, without updating the grid information, resulting in the internal error of the sub-graph being reflected on the final map, and the walls becoming thinner, disappearing or becoming thicker, affecting the positioning and navigation of the robot.
By collecting the pose information of keyframes, the pose of keyframes is optimized, the pose of keyframes is converted, the point cloud data is converted to generate global point cloud coordinates, and a raster map is generated based on these coordinates, thereby achieving optimized display of the map and reducing errors.
The optimized display of the map is realized, which reduces map display errors, avoids wall deformation, and improves the accuracy of robot positioning and navigation.
Smart Images

Figure CN117893699B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of map construction technology, and in particular to a map construction method, device, robot and storage medium. Background Art
[0002] In the existing two-dimensional laser mapping technology, in order to ensure real-time performance, the method of constructing sub-graphs with laser key frames is often used. When the number of key frames in a sub-graph reaches a threshold, the sub-graph is no longer updated, and the key frame constructs a new sub-graph. The above process is repeated alternately with the old and new sub-graphs. When performing optimization, the positions of all sub-graphs are adjusted, and all sub-graphs are stacked to form the entire grid map.
[0003] After the sub-graph is constructed, the optimization is performed to adjust its posture only. The grid information of the sub-graph itself will not be updated. This causes the errors within the sub-graph to be reflected in the final map, resulting in the wall becoming thinner, disappearing, or thicker, affecting the subsequent positioning and navigation of the robot. Summary of the invention
[0004] In view of this, the purpose of the present application is to at least provide a map construction method, device, robot and storage medium, which generates a reconstructed map by collecting posture information corresponding to key frames, realizes optimized display of the map, and reduces map display errors.
[0005] This application mainly includes the following aspects:
[0006] In a first aspect, an embodiment of the present application provides a map construction method, which is applied to a robot's collection of environmental information, including: displaying an initial map acquired by the robot; confirming key frames collected by the robot during movement; generating a reconstructed map based on the position information of the key frames; and displaying the reconstructed map.
[0007] In a possible implementation, the method further includes: optimizing the pose of the key frame according to an optimization rule to obtain optimized pose information; converting the point cloud data of the key frame to generate global point cloud coordinates according to the optimized pose information and the point cloud conversion formula; and generating a grid map according to the global point cloud coordinates, wherein the grid map is used as a reconstructed map.
[0008] In one possible implementation, the optimization rules include: triggering posture optimization of key frames based on a comparison result of a relative posture relationship between two key frames and constraint conditions; or determining the number of newly added key frames, where the newly added key frames include key frames collected within a time period from the last posture optimization execution to the current key frame; and determining that the number of newly added key frames reaches an optimization trigger threshold, triggering posture optimization of the point cloud data of the key frames.
[0009] In one possible implementation, the optimization trigger threshold is adjusted in the following manner: monitoring the cumulative task volume in a thread pool, in which task threads corresponding to the robot are stored; determining that the cumulative task volume reaches the task volume threshold, and raising the optimization trigger threshold according to an adjustment rule; determining that the cumulative task volume does not reach the task volume threshold, and configuring the optimization trigger threshold to an initial value.
[0010] In a possible implementation, a step of generating a reconstructed map based on the posture information of the key frame includes: determining a cumulative value of coordinate corrections based on each optimized posture information; determining that the cumulative value of coordinate corrections reaches a correction threshold, and generating a map reconstruction task instruction; and generating a reconstructed map based on the map reconstruction task instruction.
[0011] In a possible implementation, generating a map reconstruction step according to a map reconstruction task instruction includes: adding a map reconstruction task instruction to a task queue; and after determining that the map reconstruction task instruction meets a cooling time, executing the map reconstruction task instruction to generate a reconstructed map.
[0012] In a possible implementation, a reconstructed map is generated based on the posture information of the key frames, including: obtaining a set of key frames of the robot in the environment; determining the first key frame in the key frame set, traversing all the key frames in the key frame set in order, and determining the reconstructed key frame according to a map reconstruction rule; and generating a reconstructed map based on the posture information of the reconstructed key frame.
[0013] In one possible implementation, a map reconstruction rule includes: directly determining a first key frame as a reconstructed key frame, where the first key frame is an initial frame in a key frame set; for each second key frame, determining a posture difference between posture information of the second key frame and posture information of an adjacent reconstructed key frame, determining that the posture difference reaches a posture difference threshold, and determining the second key frame as a reconstructed key frame, where the second key frames are key frames that are located after the first key frame in the traversal order in the key frame set.
[0014] In a possible implementation, the method further includes: generating a real-time map according to the key frames collected in real time, and displaying the real-time map; and after generating the reconstructed map, replacing the real-time map with the reconstructed map for display.
[0015] In the second aspect, an embodiment of the present application also provides a map construction device, which is used for a robot to collect environmental information, including: a first display control module, used to display the initial map acquired by the robot; a key frame acquisition module, used to confirm the key frames collected by the robot during movement; a reconstruction module, used to generate a reconstructed map based on the posture information of the key frames; a second display control module, used to display the reconstructed map.
[0016] In a third aspect, an embodiment of the present application further provides a robot, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement a map construction method as provided in any of the above-mentioned embodiments.
[0017] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a map construction method as provided in any of the embodiments.
[0018] The present application provides a map construction method, which is applied to the robot's environmental information collection, including: displaying the initial map obtained by the robot; confirming the key frames collected by the robot during movement; generating a reconstructed map based on the posture information of the key frames; and displaying the reconstructed map. The present application generates a reconstructed map by collecting the posture information corresponding to the key frames, thereby achieving optimized display of the map.
[0019] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 A flowchart of a map construction method provided in an embodiment of the present application is shown;
[0022] Figure 2 A schematic diagram showing a real-time map display process provided by an embodiment of the present application is shown;
[0023] Figure 3 A schematic diagram of map reconstruction provided by an embodiment of the present application is shown;
[0024] Figure 4 A schematic structural diagram of a map construction device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art, under the guidance of the content of the present application, can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.
[0026] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0027] In the existing two-dimensional laser mapping technology, in order to ensure real-time performance, the method of constructing sub-graphs with laser key frames is often used. When the number of key frames in a sub-graph reaches a threshold, the sub-graph is no longer updated, and the key frame constructs a new sub-graph. The new and old sub-graphs repeat the above process alternately. When performing optimization, the postures of all sub-graphs are adjusted, and all sub-graphs are stacked to form the entire grid map. A sub-graph refers to a local map composed of a preset number of key frames (for example, 100 frames). Two adjacent sub-graphs are continuous, and there will be overlapping parts between adjacent sub-graphs.
[0028] After the sub-graph is constructed, the optimization is performed to adjust its posture only. The grid information of the sub-graph itself will not be updated. This causes the errors within the sub-graph to be reflected in the final map, resulting in the wall becoming thinner, disappearing, or thicker, affecting the subsequent positioning and navigation of the robot.
[0029] Based on this, the embodiments of the present application provide a map construction method, device, robot and storage medium, which generates a reconstructed map by collecting the posture information corresponding to the key frames, realizes the optimized display of the map, and reduces the map display error, as follows:
[0030] See also Figure 1 , Figure 1 FIG. 1 is a flowchart of a map construction method provided by an embodiment of the present application. Figure 1As shown, the method provided in the embodiment of the present application comprises the following steps:
[0031] S100: Displaying the initial map acquired by the robot.
[0032] S200: confirm the key frames collected by the robot during its movement.
[0033] S300: Generate a reconstructed map according to the position and posture information of the key frames.
[0034] S400: Display the reconstructed map.
[0035] In the sub-image stacking map construction scheme, the walls sometimes become thinner / disappear or thicker on the reconstructed map. The fundamental reason is that the errors within the sub-image have not been eliminated. After multiple sub-images are stacked, the sub-image boundaries are easily connected and misaligned / ghosted with other sub-images. To improve this problem, the present application will traverse all the collected key frames in the process of generating the reconstructed map. At this time, if a new key frame is obtained, the new key frame will also be included in the traversal process, and the reconstructed map will be generated using the posture information of the key frame. After the reconstructed map is generated, the reconstructed map will immediately replace the real-time map, so that key frames will not be missed, and the misalignment / ghosting problems caused by the sub-image boundary connection can be corrected, thereby achieving optimized display of the map and reducing map display errors.
[0036] In a preferred embodiment, the method further comprises:
[0037] A real-time map is generated based on the key frames collected in real time, and the real-time map is displayed. After the reconstructed map is generated, the reconstructed map is used to replace the real-time map for display.
[0038] In the specific implementation, as the map becomes larger, the number of key frames will increase, and the time consumed in traversing all key frames to build the map will gradually increase. However, in the map construction, the map is required to be updated and displayed in real time for deployment personnel to view. The display process of the real-time map actually refers to converting the real-time map into a compressed image and then passing it to the application service. The application service then decompresses the compressed image so that the real-time map can be displayed on the corresponding display screen of the robot.
[0039] In order to obtain a real-time map, the present application provides a real-time map display strategy. Specifically, after the map is initialized (i.e., the initial map is formed), it continues to scan the surrounding environment, and collects multiple laser node frames for each preset distance or preset angle. Each laser node frame includes point cloud information, and a key object is extracted from the multiple laser node frames as a key frame. In other words, a corresponding key frame will be generated every time the robot walks a preset distance or a preset angle.
[0040] See also Figure 2 , Figure 2FIG. 1 is a schematic diagram showing a real-time map display process provided by an embodiment of the present application. Figure 2 As shown, starting from the initial map, each time a key frame is determined, the key frame is inserted into the real-time map at that time for real-time display. In this way, the real-time map can be guaranteed to be always in an incremental update state. At the same time as the real-time map is incrementally updated, it is determined in real time whether to generate a reconstructed map. If a reconstructed map is generated, the reconstructed map will replace the real-time map for display. Then, after determining the new key frame, the real-time map will be inserted again, and the above process will be repeated. Optionally, as the map becomes larger, the number of key frames will increase, and the time consumed by traversing all key frames to build the map will gradually increase. However, in the map construction, the map is required to be updated and displayed in real time, which is convenient for the deployment personnel to view. Therefore, a real-time map display scheme is designed. After the map is initialized, as the robot continues to scan the surrounding environment while walking, the new key frame is incrementally inserted into the real-time map for real-time display. When the key frame performs posture optimization, if it is determined that the map needs to be reconstructed, the task of traversing the key frame to build the map is put into the task queue for execution. At this time, the external map is still incrementally updated. After the map is built, the map will replace the real-time map for display, and the new key frame will be inserted into the new real-time map. If the map reconstruction is triggered again later, the above process will be repeated. Optionally, the display of the map can be converted into a compressed image format such as png from the robot ros end to the robot App end, and the app decompresses the map and drags it on the robot's display screen for display. Optionally, the newly added keyframe must pass certain keyframe filtering rules before it can be inserted into the map; the insertion process is to convert the new keyframe point cloud into the map coordinate system to obtain the global point cloud coordinates, and generate the corresponding real-time grid map, which is displayed as a real-time map. This embodiment can ensure the update and display of the real-time map and ensure real-time viewing by deployment personnel.
[0041] In another preferred embodiment, generating a real-time map according to key frames includes:
[0042] Determine the global point cloud coordinates of the key frame point cloud collected in real time, generate a grid sub-map corresponding to the key frame according to the global point cloud coordinates, and determine the real-time map according to the initial map and the grid sub-map.
[0043] In one example, the keyframe point cloud includes multiple feature points and the coordinates of each feature point in the robot coordinate system. The keyframe pose is the robot pose, and the keyframe point cloud data is the coordinate data in the robot coordinate system. According to the keyframe pose and point cloud conversion formula, the keyframe point cloud data is converted to the global map coordinate system, and the global point cloud coordinates of the keyframe point cloud are determined. Then, according to the global point cloud coordinates and the preset grid map algorithm, the grid sub-image corresponding to the keyframe is determined, and the grid sub-image is connected and fused with the real-time map to determine the real-time map. This can ensure real-time update and display of the map.
[0044] In a preferred embodiment, during the process of forming the reconstructed map, the method of the present application further includes:
[0045] The pose of the key frame is optimized according to the optimization rules to obtain the optimized pose information. According to the optimized pose information and the point cloud conversion formula, the point cloud data of the key frame is converted to generate global point cloud coordinates. A grid map is generated according to the global point cloud coordinates, wherein the grid map is used as the reconstructed map.
[0046] Specifically, when generating a reconstructed map, the present application optimizes the pose of the collected key frames according to the optimization rules. The pose optimization is actually a correction of the corresponding coordinates and running direction of the robot in the map coordinate system. After the key frame pose is optimized, optimized pose information will be obtained. The optimized pose information includes but is not limited to the coordinates and running direction of the optimized robot in the map coordinate system. Then, according to the point cloud conversion formula, the point cloud data of the key frame is converted to the global coordinate system to generate the corresponding raster map. The generated raster map is determined as the reconstructed map, and the reconstructed map is the current optimal mapping result.
[0047] Specifically, the point cloud coordinate transformation formula is:
[0048]
[0049] In this formula, [x g ,y g ] indicates the global coordinates corresponding to the feature points in the key frame converted to the map coordinate system, [x t ,y t ,θ t ] represents the coordinates of the robot in the map coordinate system when performing point cloud conversion [x t ,y t ] and direction θ t ,[x l ,y l ] represents the coordinates of the feature points in the key frame in the robot coordinate system.
[0050] In this application, when generating the reconstructed map, the coordinates and direction of the optimized robot in the map coordinate system are taken as [x t ,y t ,θ t ] is substituted into the above point cloud coordinate conversion formula to determine the global point cloud coordinates corresponding to the optimized key frame.
[0051] In some specific implementations, the optimization rule includes: triggering posture optimization of the keyframes according to the comparison result of the relative posture relationship between two keyframes and the constraint condition. The constraint condition can be the relative posture relationship between the two keyframes, that is, the posture difference between the two keyframes. The constraint condition can include adjacent constraint items and loop constraint items. Specifically, the posture difference between adjacent keyframes is the adjacent constraint item. The robot rotates around the loop. Figure 1 When the robot circles back to the original place, there will be a posture difference after passing through this place twice. This posture difference is the loop constraint item. This posture difference is caused by the cumulative error, that is, the robot does not know that it has returned to the original place. It is necessary to identify the environmental features before the robot knows that it has returned to the same place.
[0052] In some specific implementations, the optimization rules may also include: determining the number of newly added key frames, the newly added key frames include the key frames collected in the time period from the last execution of posture optimization to the current key frame, determining that the number of newly added key frames reaches the optimization trigger threshold, and triggering posture optimization of the point cloud data of the key frames.
[0053] In the present application, the optimization process of the robot posture is triggered by the number of newly added key frames. For example, the optimization trigger threshold is 10, which means that once the number of newly added key frames reaches 10, the point cloud data of the key frames needs to be posture optimized. Each time the posture is optimized, the point cloud data of all the key frames collected must be optimized. By setting the optimization trigger threshold, the frequency of posture optimization for the robot can be controlled.
[0054] In the embodiment of the present application, the optimization trigger threshold is adjusted in the following manner:
[0055] Monitor the accumulated task volume in the thread pool, which stores task threads corresponding to the robot. Determine whether the accumulated task volume reaches the task volume threshold, increase the optimization trigger threshold according to the adjustment rule, determine whether the accumulated task volume does not reach the task volume threshold, and configure the optimization trigger threshold to the initial value.
[0056] In an example, it can be seen from the above that whenever the number of newly added key frames reaches the optimization trigger threshold, the optimization is performed. However, in large map scenes, multiple optimization executions will significantly increase the amount of calculation. Now, according to the cumulative amount of tasks in the thread pool, the optimization trigger threshold is dynamically adjusted. Specifically, when the cumulative amount of tasks corresponding to the robot reaches the task threshold, it means that the computing power is tight at this time, and the optimization frequency should be reduced and the optimization trigger threshold should be increased. When the cumulative amount of tasks of the robot does not reach the task threshold, it means that the computing power is sufficient at this time, and optimization can be performed, and the optimization trigger threshold is configured as the initial value.
[0057] By dynamically adjusting the optimization trigger threshold according to the accumulated task volume in the thread pool, the optimization frequency can be reduced to ensure the computing power of the robot.
[0058] In another preferred embodiment, step S300 further includes:
[0059] Determine the accumulated value of coordinate correction according to each optimized posture information, determine that the accumulated value of coordinate correction reaches the correction threshold, generate a map reconstruction task instruction, and generate a reconstructed map according to the map reconstruction task instruction.
[0060] In the process of generating the reconstructed map, if the map is rebuilt after each pose optimization, the amount of calculation will increase greatly. Therefore, in order to reduce the amount of calculation, the accumulated value of the coordinate correction obtained after each optimization is accumulated. When the correction threshold is reached, the map reconstruction task instruction is generated, and the reconstructed map is generated according to the map reconstruction task instruction.
[0061] Specifically, after each optimization is performed, the collected key frame poses will be adjusted, and the new key frame poses obtained during the optimization also need to update an offset as a whole. This offset is the difference between the new key frame poses before and after the optimization, that is, the coordinate correction amount corresponding to the optimization execution. The sum of the coordinate correction amounts corresponding to each optimization execution is determined as the cumulative value of the coordinate correction amount. According to the comparison result between the cumulative value of the coordinate correction amount and the correction threshold, it can be determined whether to generate the corresponding map reconstruction task instructions, that is, whether map reconstruction is needed.
[0062] In one example, if two optimizations are performed in total, the coordinate correction amount corresponding to the first optimization is 0.03m, and the optimization coordinate correction amount corresponding to the second optimization is 0.1m, and the correction threshold is 0.2m, the sum of the two optimization results does not reach the correction threshold, and map reconstruction is not performed.
[0063] In this application, by correcting the setting of the threshold, the map reconstruction threshold is increased and the number of map reconstruction times is reduced.
[0064] In the embodiment of the present application, the step of generating a reconstructed map according to the map reconstruction task instruction includes:
[0065] A map reconstruction task instruction is added to the task queue, and after determining that the map reconstruction task instruction meets the cooling time, the map reconstruction task instruction is executed to generate a reconstructed map.
[0066] Add a map reconstruction task instruction to the task queue. If a map reconstruction has just been executed within the preset cooling time, put this map reconstruction task instruction into the task queue again. The map reconstruction will not be actually executed until the cooling time is reached. This prevents repeated map reconstruction within a certain period of time, consuming unnecessary computing power. Set a cooling time after the map is rebuilt to prevent multiple executions of the map reconstruction within a short period of time.
[0067] See also Figure 3 , Figure 3 FIG. 1 shows a schematic diagram of a map reconstruction provided by an embodiment of the present application. Figure 3 As shown, including:
[0068] S500: Execute posture optimization.
[0069] S510: Determine whether the accumulated value of the coordinate correction amount reaches the correction threshold.
[0070] S511. If the accumulated value of the coordinate correction amount reaches the correction threshold, a map reconstruction task is generated under the map reconstruction task instruction and added to the task queue, and the map reconstruction flag flg is set to true to be executed.
[0071] S512: Determine whether there is a map reconstruction task in the task queue.
[0072] S513: If there is a map reconstruction task in the task queue, determine whether the map reconstruction flag is true.
[0073] S514: If there is no map reconstruction task in the task queue, execute other tasks.
[0074] S515: If the flag of the map reconstruction task is to be executed true, determine whether the cooling time is met.
[0075] S516: If the cooling time is satisfied, map reconstruction is performed to generate a reconstructed map.
[0076] S517. Use the reconstructed map to replace the real-time map, set the map reconstruction flag to completed false, and return to S512.
[0077] S518. If the cooling time is not met, a new map reconstruction task is added, and the new map reconstruction task is added to the task queue, and the process returns to S512.
[0078] If the flag of the map reconstruction task is completed (false), the process returns to execute S512.
[0079] In a possible implementation, step S300 includes:
[0080] Obtain the key frame set of the robot in the environment, determine the first key frame in the key frame set, traverse all key frames in the key frame set in order, determine the reconstructed key frame according to the map reconstruction rule, and generate a reconstructed map based on the posture information of the reconstructed key frame.
[0081] Preferably, the key frames used to generate the reconstructed map come from a key frame set, which includes all key frames generated by the front end. In actual execution, it is not necessary for all key frames to participate in map reconstruction. It is necessary to perform motion filtering on multiple key frames recorded in the key frame set through map reconstruction rules, extract some reconstructed key frames that participate in map reconstruction, and generate a reconstructed map through the posture information corresponding to the screened reconstructed key frames.
[0082] The beneficial effect of this embodiment can reduce the amount of calculation for reconstructing the map. The key frames used for map reconstruction come from all nodes generated by the front end, such as laser data. In actual execution, it is not necessary for all nodes to participate in map reconstruction. These nodes are once again subjected to motion filtering, and some key frames are extracted to participate in map projection, such as key frame pose graphs in the global coordinate system. Under the premise of ensuring that the map details and the changes before the frame extraction are not large and the positioning is guaranteed, as few key frames as possible are extracted. Optionally, multiple filtering parameters are set in the mapping program, such as a unit trajectory line at intervals as a filtering parameter, and the map reconstruction effect is checked accordingly to ensure that the edge lines of the walls in the map are continuous and uninterrupted, and the scattered obstacles can basically see the full outline to ensure positioning. Therefore, this solution can ensure the positioning effectiveness of map construction and reduce the amount of calculation for redundant key frames.
[0083] In a preferred embodiment, the map reconstruction rules include:
[0084] The first key frame is directly determined as the reconstructed key frame. The first key frame is the initial frame in the key frame set. For each second key frame, the posture difference between the posture information of the second key frame and the posture information of the adjacent reconstructed key frame is determined. When the posture difference reaches the posture difference threshold, the second key frame is determined as the reconstructed key frame. The second key frames are the key frames that are located after the first key frame in the traversal order in the key frame set.
[0085] Preferably, assuming that the key frame set includes key frames A, B, and C, all key frames in the key frame set are traversed in order, assuming that the first key frame in the key frame set is A, the first key frame A is directly determined as the reconstructed key frame, and for the second key frame B, the posture difference between the second key frame B and the reconstructed key frame A is determined, wherein the posture difference includes the distance difference and the angle difference, and the posture difference threshold includes the distance difference threshold and the angle difference threshold. When the distance difference between B and A is greater than the distance difference threshold or the angle difference between B and A is greater than the angle difference threshold, B is also determined as the reconstructed key frame, and then the next key frame C is compared with B for posture difference judgment. If the posture difference between B and A does not reach the posture difference threshold (that is, the distance difference does not reach the distance difference threshold, and the angle difference does not reach the angle difference threshold), then the next frame C is compared with A for posture difference. If the posture difference between C and A reaches the posture difference threshold, C is determined as the reconstructed key frame, and then the next frame D is compared with C, and so on, until the last key frame in the key frame set is judged.
[0086] Based on the same application concept, the embodiments of the present application also provide a map construction device corresponding to the map construction method provided in the above embodiments. Since the principle of solving the problem by the device in the embodiments of the present application is similar to the map construction method in the above embodiments of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0087] See also Figure 4 , Figure 4 FIG. 1 is a schematic diagram showing the structure of a map construction device provided in an embodiment of the present application. Figure 4 As shown, the device comprises:
[0088] The first display control module 600 is used to display the initial map acquired by the robot.
[0089] The key frame acquisition module 610 is used to confirm the key frames acquired during the movement of the robot.
[0090] The reconstruction module 620 is used to generate a reconstructed map according to the position and posture information of the key frames.
[0091] The second display control module 630 is used to display the reconstructed map.
[0092] Preferably, the reconstruction module 620 is also used to: optimize the pose of the key frame according to the optimization rules to obtain optimized pose information, convert the point cloud data of the key frame to generate global point cloud coordinates according to the optimized pose information and the point cloud conversion formula, and generate a grid map according to the global point cloud coordinates, wherein the grid map is used as the reconstructed map.
[0093] Preferably, the optimization rules include: triggering posture optimization of the key frames based on the comparison results of the relative posture relationship between two key frames and the constraints; or the optimization rules may also include determining the number of newly added key frames, the newly added key frames include the key frames collected in the time period from the last execution of posture optimization to the current key frame; determining that the number of newly added key frames reaches the optimization trigger threshold, triggering posture optimization of the point cloud data of the key frames.
[0094] Preferably, the reconstruction module 620 is also used to: monitor the cumulative task volume in the thread pool, which stores task threads corresponding to the robot; determine whether the cumulative task volume reaches the task volume threshold, and increase the optimization trigger threshold according to the adjustment rules; determine whether the cumulative task volume does not reach the task volume threshold, and configure the optimization trigger threshold to the initial value.
[0095] Preferably, the reconstruction module 620 is also used to: determine the cumulative value of the coordinate correction amount according to each optimized point cloud pose information, determine whether the cumulative value of the coordinate correction amount reaches the correction threshold, generate a map reconstruction task instruction, and generate a reconstructed map according to the map reconstruction task instruction.
[0096] Preferably, the reconstruction module 620 is further used to: add a map reconstruction task instruction to the task queue, and after determining that the map reconstruction task instruction meets the cooling time, execute the map reconstruction task instruction to generate a reconstructed map.
[0097] Preferably, the reconstruction module 620 is also used to: obtain a set of key frames of the robot in the environment; determine the first key frame in the key frame set, traverse all key frames in the key frame set in order, and determine the reconstructed key frame according to the map reconstruction rules; generate a reconstructed map according to the posture information of the reconstructed key frame.
[0098] Preferably, the map reconstruction rules include: directly determining the first key frame as the reconstructed key frame, the first key frame being the initial frame in the key frame set; for each second key frame, determining the posture difference between the posture information of the second key frame and the posture information of the most recently determined reconstructed key frame, determining that the posture difference reaches a posture difference threshold, and determining the second key frame as the reconstructed key frame, the second key frames being the key frames that are located after the first key frame in the traversal order in the key frame set.
[0099] Preferably, the device further comprises a real-time display module (not shown in the figure), which is used to: generate a real-time map according to the key frames, display the real-time map, and after generating the reconstructed map, replace the real-time map with the reconstructed map for display.
[0100] Preferably, the real-time display module is also used to: determine the global point cloud coordinates of the key frame point cloud, generate a grid sub-image corresponding to the key frame according to the global point cloud coordinates, and determine the real-time map according to the initial map and the grid sub-image.
[0101] An embodiment of the present application also provides a robot, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the one or more processors implement a map construction method provided in any of the above embodiments.
[0102] Based on the same application concept, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the map construction method provided in the above embodiment are executed.
[0103] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple 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 communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0104] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0105] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0106] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0107] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A map construction method, applied to robot collection of environmental information, It is characterized in that include: Displaying the initial map acquired by the robot; Confirming key frames collected by the robot during movement; Generate a real-time map based on the newly added key frames collected in real time, and display the real-time map, wherein the real-time map is converted into a compressed image and then transmitted to the application service, and is displayed in real time on a display screen corresponding to the robot; Performing posture optimization on the key frames according to the optimization rules to obtain optimized posture information, wherein the optimization rules include: determining the number of newly added key frames, the newly added key frames include key frames collected in the time period from the last execution of posture optimization to the current key frame, determining that the number of newly added key frames reaches the optimization trigger threshold, triggering posture optimization of the key frames; According to the optimized pose information and the point cloud conversion formula, the point cloud data of the key frame is converted to generate global point cloud coordinates; Generate a grid map according to the global point cloud coordinates, wherein the grid map serves as a reconstructed map; Determine a coordinate correction amount cumulative value according to each of the optimized posture information; Determining that the accumulated value of the coordinate correction amount reaches a correction threshold, and generating a map reconstruction task instruction; Add the map reconstruction task instruction to the task queue; After determining that the map reconstruction task instruction meets the cooling time, executing the map reconstruction task instruction to generate a reconstructed map; The reconstructed map is displayed.
2. The method according to claim 1, It is characterized in that Adjust the optimization trigger threshold by: Monitoring the accumulated task amount in a thread pool, wherein the thread pool stores task threads corresponding to the robot; Determining that the accumulated task volume reaches a task volume threshold, and increasing the optimization trigger threshold according to an adjustment rule; It is determined that the accumulated task amount does not reach the task amount threshold, and the optimization trigger threshold is configured as an initial value.
3. The method according to claim 1, It is characterized in that Generate a reconstructed map according to the position information of the key frame, including: Obtain a set of key frames of the robot in the environment; Determine a first key frame in the key frame set, traverse all key frames in the key frame set in order, and determine a reconstructed key frame according to a map reconstruction rule; A reconstructed map is generated according to the pose information of the reconstructed key frame.
4. The method according to claim 3, It is characterized in that The map reconstruction rules include: directly determining the first key frame as a reconstructed key frame, the first key frame being an initial frame in the key frame set; For each second key frame, determine the posture difference between the posture information of the second key frame and the posture information of the adjacent reconstructed key frame, determine that the posture difference reaches the posture difference threshold, and determine the second key frame as the reconstructed key frame. The second key frame is each key frame that is located after the first key frame in the traversal order in the key frame set.
5. The method according to claim 1, It is characterized in that Also includes: Generate a real-time map according to the key frames collected in real time, and display the real-time map; After the reconstructed map is generated, the reconstructed map is used to replace the real-time map for display.
6. The method according to claim 1, It is characterized in that Confirm the key frames collected by the robot during movement, including: During the movement of the robot, each time the robot moves a preset distance or a preset angle, a plurality of laser node frames are collected, each laser node frame including point cloud information; A key object is extracted from a plurality of laser node frames as a key frame.
7. A map building device, used for robot to collect environmental information, It is characterized in that include: A first display control module, used to display an initial map acquired by the robot; A key frame acquisition module, used to confirm the key frames acquired by the robot during movement; A real-time display module, used to generate a real-time map according to the newly added key frames collected in real time, and display the real-time map, wherein the real-time map is converted into a compressed image and then transmitted to the application service, and is displayed in real time on a display screen corresponding to the robot; A reconstruction module is used to optimize the posture of the key frame according to the optimization rules to obtain optimized posture information, wherein the optimization rules include: determining the number of newly added key frames, the newly added key frames include key frames collected in the time period from the last execution of posture optimization to the current key frame, determining that the number of newly added key frames reaches the optimization trigger threshold, triggering posture optimization of the key frame; according to the optimized posture information and the point cloud conversion formula, converting the point cloud data of the key frame to generate global point cloud coordinates; generating a grid map according to the global point cloud coordinates, wherein the grid map is used as a reconstructed map; The reconstruction module is also used to: determine the cumulative value of the coordinate correction amount according to each optimized point cloud pose information, determine that the cumulative value of the coordinate correction amount reaches the correction threshold, and generate a map reconstruction task instruction; The reconstruction module is further used to: add a map reconstruction task instruction to the task queue, and after determining that the map reconstruction task instruction meets the cooling time, execute the map reconstruction task instruction to generate a reconstructed map; The second display control module is used to display the reconstructed map.
8. A robot, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement a map construction method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, a map construction method as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Robot mapping method and device, sweeping robot and storage medium
CN114659515A