A 3D point cloud map automatic expansion method, device and medium

Through 3D laser SLAM and point cloud registration algorithm ICP, combined with KD tree search and GTSM library optimization, the automatic expansion of 3D point cloud maps is realized, which solves the problem of SLAM mapping failure and low efficiency when scene changes in large scenes, and improves Improve the efficiency and accuracy of map updates.

CN114638941BActive Publication Date: 2024-08-23GUANGZHOU GOSUNCN ROBOTICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210242200.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-11
Publication Date
2024-08-23
Estimated Expiration
2042-03-11

AI Technical Summary

Technical Problem

In large-scale patrol scenes, when SLAM technology fails to build a map at one time, reconstructing the 3D point cloud map consumes a lot of manpower and time, and when the scene is very large or the scene changes, the efficiency of manual mapping and puzzle is low.

Method used

3D laser SLAM is used to construct key frame point cloud maps of the scene to be expanded and the scene being expanded. KD tree search and point cloud registration algorithm ICP are used to realize 3D through pose constraint cost function between frames and GTSM library optimization. Automatic expansion of point cloud maps.

Benefits of technology

It reduces manual intervention, improves the efficiency and accuracy of 3D point cloud map expansion, reduces time and labor costs, and realizes automated map updates for large scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114638941B
    Figure CN114638941B
Patent Text Reader

Abstract

The present invention provides a method, device and medium for automatic expansion of 3D point cloud maps, which provide a key frame point cloud after expansion and a corresponding pose, search the key frame pose before the most recent expansion through the pose, construct pose constraints, and use the factor graph for overall optimization to achieve alignment of trajectory poses after expansion with those before expansion, and use the aligned trajectory poses to correct the expanded 3D point cloud map to complete the expansion of the 3D point cloud map. The present invention can divide a large scene into several small scenes, build a map for each divided scene independently, and automatically merge the small scenes, so as to realize infinite scene mapping.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of map technology, and in particular to a method, device and medium for automatically expanding a 3D point cloud map. Background Art

[0002] With the continuous development of unmanned and intelligent technologies, more and more patrol / inspection robots are being used to replace manual labor, realize all-weather automatic inspection and patrol work, and improve work efficiency. When patrolling, outdoor wheeled patrol robots generally use SLAM technology to complete the construction of 3D point cloud maps of patrol scenes in advance, and then perform positioning and navigation patrols based on the constructed maps. When the patrol scene is relatively large (such as several million square meters), this poses a challenge to the successful one-time mapping of SLAM technology. Once the mapping fails, rebuilding the map will consume a lot of manpower, energy and time costs.

[0003] When building 3D point cloud maps for extremely large scenes or adding point cloud maps of other scenes to the original 3D point cloud maps, most of the time, manual mapping is performed offline, or the point cloud maps of other scenes are manually assembled. This is bound to be labor-intensive and time-consuming, and the experience is not very good.

[0004] The background description provided herein is for the purpose of generally presenting the context of the present disclosure. Unless otherwise indicated herein, the materials described in this section are not prior art to the claims of this application and are not admitted to be prior art by inclusion in this section. Summary of the invention

[0005] In view of the above technical problems in the related art, the present invention proposes a 3D point cloud map automatic expansion method, which includes the following steps:

[0006] S1, use 3D laser SLAM to build a 3D point cloud map of the first scene to be expanded Scene_1, save the 3D laser point clouds of all key frames and the corresponding first pose pose_1_i;

[0007] S2, loading the 3D laser point clouds of all key frames corresponding to the second extended scene Scene_0 and the corresponding second pose pose_0_j;

[0008] S3, constructing a 2D search KD tree kd_tree using the horizontal position (x, y) of the second pose pose_0_j in all key frame poses in the second extended scene Scene_0;

[0009] S4, loop through all the first poses pose_1_i of the key frames in the first scene to be expanded Scene_1, find the key frame pair (i, j) whose horizontal position does not exceed the first preset distance from the second scene to be expanded Scene_0 through kd_tree, and record it as the first key frame pair array map(i, j);

[0010] S5, constructing a pose constraint cost function between frames for all key frames of the first scene to be expanded Scene_1;

[0011] S6, looping through map(i, j), using the point cloud registration algorithm ICP to transform the 3D laser point cloud source_pointcloud_i of the i-th key frame in the first scene to be extended Scene_1 and the 3D laser point cloud target_pointcloud_j of the j-th key frame in the second extended scene Scene_0, adding the pose constraint cost function to the i-th key frame in the first scene to be extended Scene_1 and obtaining the optimized pose of the first scene to be extended Scene_1 so that the pose of the first scene to be extended Scene_1 and the pose of the second extended scene Scene_0 are spatially consistent;

[0012] S7, stitching the 3D point cloud map through the optimized pose of the first scene to be expanded Scene_1 and the corresponding 3D laser point cloud frame, and completing the automatic expansion of the 3D point cloud map.

[0013] Specifically, the step S5 specifically includes: constructing a pose constraint cost function between frames for all key frames of the first scene to be expanded Scene_1:

[0014] err=δ(‖pose_1_k-pose_1_h-Δpose_kh‖^2)

[0015] pose_1_k is the kth key frame pose saved in the first scene to be expanded, Scene_1;

[0016] pose_1_h is the key frame pose of the hth frame saved in the first scene to be expanded, Scene_1;

[0017] pose_1_kh is the difference between the k-th key frame pose and the h-th key frame pose saved in the first scene to be expanded Scene_1;

[0018] δ is the measurement information matrix corresponding to the key frame pose.

[0019] Specifically, step S6 specifically includes:

[0020] S61, loading the 3D laser point cloud source_pointcloud_i of the i-th key frame in the first scene to be expanded Scene_1;

[0021] S62, loading the 3D laser point cloud target_pointcloud_j of the key frame in the j±20th range in the second extended scene Scene_0;

[0022] S63, using the point cloud registration algorithm ICP to register source_pointcloud_i to target_pointcloud_j, and obtain the transformed pose Δpose_ij between the two;

[0023] S64, adding the pose constraint cost function to the i-th key frame in the first scene to be expanded Scene_1;

[0024] S65, using the GTSM library to implement bundling optimization of the key frame pose constraints of the first scene to be expanded Scene_1, so that the pose of the first scene to be expanded Scene_1 is spatially consistent with the pose of the second scene to be expanded Scene_0.

[0025] Specifically, the first preset distance is 6m.

[0026] In a second aspect, another embodiment of the present embodiment discloses a 3D point cloud map automatic expansion device, which includes the following units:

[0027] A first scene to be expanded acquisition unit is used to construct a 3D point cloud map of the first scene to be expanded Scene_1 using 3D laser SLAM, and save the 3D laser point clouds of all key frames and the corresponding first pose pose_1_i;

[0028] The second extended scene loading unit is used to load the 3D laser point clouds of all key frames corresponding to the second extended scene Scene_0 and the corresponding second pose pose_0_j;

[0029] A KD tree construction unit, used for constructing a 2-dimensional search KD tree kd_tree by using the horizontal position (x, y) in the second pose pose_0_j of all the key frame poses in the second extended scene Scene_0;

[0030] A key frame pair array construction unit is used to loop through all the first poses pose_1_i of the key frames in the first scene to be expanded Scene_1, find the key frame pair (i, j) whose horizontal position does not exceed the first preset distance from the second scene to be expanded Scene_0 through kd_tree, and record it as the first key frame pair array map(i, j);

[0031] A pose constraint unit, used for constructing a pose constraint cost function between frames for all key frames of the first scene to be expanded Scene_1;

[0032] a pose spatial consistency unit, for looping through map(i, j), using the point cloud registration algorithm ICP to transform the poses of the 3D laser point cloud source_pointcloud_i of the i-th key frame in the first scene to be extended Scene_1 and the 3D laser point cloud target_pointcloud_j of the j-th key frame in the second scene to be extended Scene_0, adding the pose constraint cost function to the i-th key frame in the first scene to be extended Scene_1 and obtaining the pose of the first scene to be extended Scene_1 after optimization so that the pose of the first scene to be extended Scene_1 and the pose of the second scene to be extended Scene_0 are spatially consistent;

[0033] The stitching unit is used to stitch the 3D point cloud map through the optimized pose of the first scene to be expanded Scene_1 and the corresponding 3D laser point cloud frame, so as to complete the automatic expansion of the 3D point cloud map.

[0034] Specifically, the posture constraint unit specifically includes: constructing a posture constraint cost function between frames for all key frames of the first scene to be expanded Scene_1:

[0035] err=‖pose_1_k-pose_1_h-Δpose_kh‖_δ^2

[0036] pose_1_k is the kth key frame pose saved in the first scene to be expanded, Scene_1;

[0037] pose_1_h is the key frame pose of the hth frame saved in the first scene to be expanded, Scene_1;

[0038] pose_1_kh is the difference between the k-th key frame pose and the h-th key frame pose saved in the first scene to be expanded Scene_1;

[0039] δ is the measurement information matrix corresponding to the key frame pose.

[0040] Specifically, the posture space consistency unit specifically includes:

[0041] A first key frame acquisition unit is used to load the 3D laser point cloud source_pointcloud_i of the i-th key frame in the first scene to be expanded Scene_1;

[0042] The second key frame acquisition unit loads the 3D laser point cloud target_pointcloud_j of the key frame in the j±20th range of the second extended scene Scene_0;

[0043] The transformation pose acquisition unit is used to register source_pointcloud_i to target_pointcloud_j using the point cloud registration algorithm ICP, and obtain the transformation pose Δpose_ij between the two;

[0044] A posture constraint unit, used for adding the posture constraint cost function to the i-th key frame in the first scene to be expanded Scene_1;

[0045] The pose optimization unit is used to use the GTSM library to implement bundled optimization of the key frame pose constraints of the first scene to be expanded Scene_1, so that the pose of the first scene to be expanded Scene_1 is spatially consistent with the pose of the second scene to be expanded Scene_0.

[0046] Specifically, the first preset distance is 6m.

[0047] In a third aspect, an embodiment of the present invention provides a patrol robot, comprising a drive unit, a power supply, a processor, and a memory, wherein instructions are stored in the memory, and when the instructions are executed by the processor, they are used to implement the above-mentioned 3D point cloud map automatic expansion method.

[0048] The present invention provides an extended keyframe point cloud and a corresponding pose, searches for the keyframe pose before the most recent extension through pose, constructs pose constraints, and uses a factor graph for overall optimization to achieve alignment of the trajectory pose after and before extension, and uses the aligned trajectory pose to correct the extended 3D point cloud map to complete the 3D point cloud map expansion. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 It is a schematic diagram of a flow chart of a 3D point cloud map automatic expansion method provided by an embodiment of the present invention;

[0051] Figure 2 It is a schematic diagram of a 3D point cloud map automatic expansion device provided by an embodiment of the present invention;

[0052] Figure 3 is a schematic diagram of a posture space consistency unit provided in an embodiment of the present invention;

[0053] Figure 4 It is a schematic diagram of a 3D point cloud map automatic expansion device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0054] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.

[0055] Embodiment 1

[0056] refer to Figure 1 This embodiment provides a 3D point cloud map automatic expansion method, which includes the following steps:

[0057] S1, use 3D laser SLAM to build a 3D point cloud map of the first scene to be expanded Scene_1, save the 3D laser point clouds of all key frames and the corresponding first pose pose_1_i;

[0058] Specifically, the first scene to be expanded Scene_1 can be a completely new scene. For example, the robot is patrolling in a large scene. At this time, SLAM mapping of a small scene can be performed first to form a map of the second expanded scene Scene_0, and then another small scene, such as the first scene to be expanded Scene_1. In addition, the first scene to be expanded Scene_1 can also be a scene that has changed. For example, the road or building in the scene where the robot is located has changed, so that the map needs to be re-built.

[0059] This embodiment first uses SLAM to construct a 3D point cloud map for the first extended scene Scene_1, and obtains all key frames in the 3D point cloud map and the first position corresponding to the key frame.

[0060] S2, loading the 3D laser point clouds of all key frames corresponding to the second extended scene Scene_0 and the corresponding second pose pose_0_j;

[0061] Specifically, the second extended scene Scene_0 in this embodiment is a scene for which a map has been established.

[0062] S3, constructing a 2D search KD tree kd_tree using the horizontal position (x, y) of the second pose pose_0_j in all key frame poses in the second extended scene Scene_0;

[0063] S4, loop through all the first poses pose_1_i of the key frames in the first scene to be expanded Scene_1, find the key frame pair (i, j) whose horizontal position does not exceed the first preset distance from the second scene to be expanded Scene_0 through kd_tree, and record it as the first key frame pair array map(i, j);

[0064] The first preset distance is 6 meters.

[0065] Specifically, in this embodiment, there may be multiple key frames whose horizontal positions do not exceed the first preset distance in the second extended scene Scene_0 within the first preset distance range, and this embodiment selects a key frame of the second extended scene Scene_0 with the closest distance.

[0066] S5, constructing the pose constraint cost function between frames for all key frames of the first scene to be expanded Scene_1:

[0067] err=δ(‖pose_1_k-pose_1_h-Δpose_kh‖^2)

[0068] pose_1_k is the kth key frame pose saved in the first scene to be expanded, Scene_1;

[0069] pose_1_h is the key frame pose of the hth frame saved in the first scene to be expanded, Scene_1;

[0070] pose_1_kh is the difference between the k-th key frame pose and the h-th key frame pose saved in the first scene to be expanded Scene_1;

[0071] δ is the measurement information matrix corresponding to the key frame pose;

[0072] S6, looping through map(i, j), using the point cloud registration algorithm ICP to transform the 3D laser point cloud source_pointcloud_i of the i-th key frame in the first scene to be extended Scene_1 and the 3D laser point cloud target_pointcloud_j of the j-th key frame in the second extended scene Scene_0, adding the pose constraint cost function to the i-th key frame in the first scene to be extended Scene_1 and obtaining the optimized pose of the first scene to be extended Scene_1 so that the pose of the first scene to be extended Scene_1 and the pose of the second extended scene Scene_0 are spatially consistent;

[0073] Specifically, step S6 includes the following steps:

[0074] S61, loading the 3D laser point cloud source_pointcloud_i of the i-th key frame in the first scene to be expanded Scene_1;

[0075] S62, loading the 3D laser point cloud target_pointcloud_j of the key frame in the j±20th range in the second extended scene Scene_0;

[0076] Specifically, step S62 obtains the 3D laser point cloud target_pointcloud_j of the key frame in the second extended scene Scene_0 in the range [j-20, j+20].

[0077] S63, using the point cloud registration algorithm ICP to register source_pointcloud_i to target_pointcloud_j, and obtain the transformed pose Δpose_ij between the two;

[0078] S64, adding the pose constraint cost function to the i-th key frame in the first scene to be expanded Scene_1:

[0079] err=‖pose_1_i-pose_0_j-Δpose_ij‖_σ^2

[0080] σ——Error variance of point cloud registration;

[0081] S65, using the GTSM library to implement bundling optimization of the key frame pose constraints of the first scene to be expanded Scene_1, so that the pose of the first scene to be expanded Scene_1 is spatially consistent with the pose of the second scene to be expanded Scene_0;

[0082] S7, stitching the 3D point cloud map through the optimized pose of the first scene to be expanded Scene_1 and the corresponding 3D laser point cloud frame, and completing the automatic expansion of the 3D point cloud map.

[0083] This embodiment provides the key frame point cloud after expansion and the corresponding pose, searches for the key frame pose before the nearest expansion through pose, constructs pose constraints, and uses the factor graph for overall optimization to achieve alignment of the trajectory pose after expansion with that before expansion, and uses the aligned trajectory pose to correct the expanded 3D point cloud map to complete the 3D point cloud map expansion.

[0084] Embodiment 2

[0085] refer to Figure 2 This embodiment provides a 3D point cloud map automatic expansion device, which includes the following units:

[0086] A first scene to be expanded acquisition unit is used to construct a 3D point cloud map of the first scene to be expanded Scene_1 using 3D laser SLAM, and save the 3D laser point clouds of all key frames and the corresponding first pose pose_1_i;

[0087] Specifically, the first scene to be expanded Scene_1 can be a completely new scene. For example, the robot is patrolling in a large scene. At this time, SLAM mapping of a small scene can be performed first to form a map of the second expanded scene Scene_0, and then another small scene, such as the first scene to be expanded Scene_1. In addition, the first scene to be expanded Scene_1 can also be a scene that has changed. For example, the road or building in the scene where the robot is located has changed, so that the map needs to be re-built.

[0088] This embodiment first uses SLAM to construct a 3D point cloud map for the first extended scene Scene_1, and obtains all key frames in the 3D point cloud map and the first position corresponding to the key frame.

[0089] The second extended scene loading unit is used to load the 3D laser point clouds of all key frames corresponding to the second extended scene Scene_0 and the corresponding second pose pose_0_j;

[0090] Specifically, the second extended scene Scene_0 in this embodiment is a scene for which a map has been established.

[0091] A KD tree construction unit, used for constructing a 2-dimensional search KD tree kd_tree by using the horizontal position (x, y) in the second pose pose_0_j of all the key frame poses in the second extended scene Scene_0;

[0092] A key frame pair array construction unit is used to loop through all the first poses pose_1_i of the key frames in the first scene to be expanded Scene_1, find the key frame pair (i, j) whose horizontal position does not exceed the first preset distance from the second scene to be expanded Scene_0 through kd_tree, and record it as the first key frame pair array map(i, j);

[0093] The first preset distance is 6 meters.

[0094] Specifically, in this embodiment, there may be multiple key frames whose horizontal positions do not exceed the first preset distance in the second extended scene Scene_0 within the first preset distance range, and this embodiment selects a key frame of the second extended scene Scene_0 with the closest distance.

[0095] The pose constraint unit is used to construct the pose constraint cost function between frames for all key frames of the first scene to be expanded Scene_1:

[0096] err=δ(‖pose_1_k-pose_1_h-Δpose_kh‖^2)

[0097] pose_1_k is the kth key frame pose saved in the first scene to be expanded, Scene_1;

[0098] pose_1_h is the key frame pose of the hth frame saved in the first scene to be expanded, Scene_1;

[0099] pose_1_kh is the difference between the k-th key frame pose and the h-th key frame pose saved in the first scene to be expanded Scene_1;

[0100] δ is the measurement information matrix corresponding to the key frame pose;

[0101] a pose spatial consistency unit, for looping through map(i, j), using the point cloud registration algorithm ICP to transform the poses of the 3D laser point cloud source_pointcloud_i of the i-th key frame in the first scene to be extended Scene_1 and the 3D laser point cloud target_pointcloud_j of the j-th key frame in the second scene to be extended Scene_0, adding the pose constraint cost function to the i-th key frame in the first scene to be extended Scene_1 and obtaining the pose of the first scene to be extended Scene_1 after optimization so that the pose of the first scene to be extended Scene_1 and the pose of the second scene to be extended Scene_0 are spatially consistent;

[0102] refer to Figure 3 Specifically, the posture space consistency unit includes the following subunits:

[0103] A first key frame acquisition unit is used to load the 3D laser point cloud source_pointcloud_i of the i-th key frame in the first scene to be expanded Scene_1;

[0104] The second key frame acquisition unit loads the 3D laser point cloud target_pointcloud_j of the key frame in the j±20th range of the second extended scene Scene_0;

[0105] Specifically, the second key frame acquisition unit acquires the 3D laser point cloud target_pointcloud_j of the key frame in the second extended scene Scene_0 in the range [j-20, j+20].

[0106] The transformation pose acquisition unit is used to register source_pointcloud_i to target_pointcloud_j using the point cloud registration algorithm ICP, and obtain the transformation pose Δpose_ij between the two;

[0107] The pose constraint unit is used to add the pose constraint cost function to the i-th key frame in the first scene to be expanded Scene_1:

[0108] err=‖pose_1_i-pose_0_j-Δpose_ij‖_σ^2

[0109] σ——Error variance of point cloud registration;

[0110] A posture optimization unit, used for implementing bundle optimization of key frame posture constraints of the first scene to be expanded Scene_1 by using the GTSM library, so that the posture of the first scene to be expanded Scene_1 is spatially consistent with the posture of the second scene to be expanded Scene_0;

[0111] The stitching unit is used to stitch the 3D point cloud map through the optimized pose of the first scene to be expanded Scene_1 and the corresponding 3D laser point cloud frame, so as to complete the automatic expansion of the 3D point cloud map.

[0112] This embodiment provides the key frame point cloud after expansion and the corresponding pose, searches for the key frame pose before the nearest expansion through pose, constructs pose constraints, and uses the factor graph for overall optimization to achieve alignment of the trajectory pose after expansion with that before expansion, and uses the aligned trajectory pose to correct the expanded 3D point cloud map to complete the 3D point cloud map expansion.

[0113] Embodiment 3

[0114] refer to Figure 4 , Figure 4 : is a schematic diagram of the structure of a 3D point cloud map automatic expansion device of this embodiment. The 3D point cloud map automatic expansion device 20 of this embodiment includes a processor 21, a memory 22, and a computer program stored in the memory 22 and executable on the processor 21. When the processor 21 executes the computer program, the steps in the above method embodiment are implemented. Alternatively, when the processor 21 executes the computer program, the functions of each module / unit in the above device embodiments are implemented.

[0115] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 22 and executed by the processor 21 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the 3D point cloud map automatic expansion device 20. For example, the computer program may be divided into the modules in Embodiment 2. For the specific functions of each module, please refer to the working process of the device described in the above embodiment, which will not be repeated here.

[0116] The 3D point cloud map automatic expansion device 20 may include, but is not limited to, a processor 21 and a memory 22. Those skilled in the art will appreciate that the schematic diagram is merely an example of the 3D point cloud map automatic expansion device 20 and does not constitute a limitation on the 3D point cloud map automatic expansion device 20. The 3D point cloud map automatic expansion device 20 may include more or fewer components than shown in the figure, or may combine certain components, or different components. For example, the 3D point cloud map automatic expansion device 20 may also include input and output devices, network access devices, buses, and the like.

[0117] The processor 21 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 21 is the control center of the 3D point cloud map automatic expansion device 20, and uses various interfaces and lines to connect various parts of the entire 3D point cloud map automatic expansion device 20.

[0118] The memory 22 can be used to store the computer program and / or module. The processor 21 realizes various functions of the 3D point cloud map automatic expansion device 20 by running or executing the computer program and / or module stored in the memory 22 and calling the data stored in the memory 22. The memory 22 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory 22 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0119] Wherein, if the module / unit integrated in the 3D point cloud map automatic expansion device 20 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor 21. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media does not include electrical carrier signals and telecommunication signals.

[0120] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.

[0121] Embodiment 4

[0122] This embodiment discloses a patrol robot, which includes a drive unit, a power supply, a processor, and a memory. The memory stores instructions, and when the instructions are executed by the processor, they are used to implement the above-mentioned 3D point cloud map automatic expansion method.

[0123] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A 3D point cloud map automatic expansion method, comprising the following steps: S1, use 3D laser SLAM to build a 3D point cloud map for the first scene to be expanded Scene_1, save the 3D laser point clouds of all key frames and the corresponding first pose pose_1_i; S2, loading the 3D laser point clouds of all key frames corresponding to the second extended scene Scene_0 and the corresponding second pose pose_0_j; S3, constructing a 2-dimensional search KD tree kd_tree using the horizontal positions (x, y) in the second pose pose_0_j corresponding to all key frames in the second extended scene Scene_0; S4, loop through the first pose pose_1_i corresponding to all key frames in the first scene to be expanded Scene_1, find the key frame pair (i, j) whose horizontal position does not exceed the first preset distance from the second scene to be expanded Scene_0 through kd_tree, and record it as the first key frame pair array map (i, j); S5, constructing a pose constraint cost function between frames for all key frames of the first scene to be expanded Scene_1; S6, looping through map (i, j), using the point cloud registration algorithm ICP to transform the poses of the 3D laser point cloud source_pointcloud_i of the i-th key frame in the first scene to be extended Scene_1 and the 3D laser point cloud target_pointcloud_j of the j-th key frame in the second extended scene Scene_0, adding the pose constraint cost function to the i-th key frame in the first scene to be extended Scene_1 and obtaining the pose of the first scene to be extended Scene_1 after optimization so that the pose of the first scene to be extended Scene_1 and the pose of the second extended scene Scene_0 are spatially consistent; S7, stitching the 3D point cloud map through the optimized pose of the first scene to be expanded Scene_1 and the corresponding 3D laser point cloud frame, and completing the automatic expansion of the 3D point cloud map.

2. The method according to claim 1, wherein step S5 specifically include: Construct the pose constraint cost function between frames for all key frames of the first scene to be expanded Scene_1: ; pose_1_k is the kth key frame pose saved in the first scene to be expanded, Scene_1; pose_1_h is the key frame pose of the hth frame saved in the first scene to be expanded, Scene_1; Δpose_kh is the difference between the k-th key frame pose and the h-th key frame pose saved in the first scene to be expanded Scene_1; δ is the measurement information matrix corresponding to the key frame pose.

3. The method according to claim 2, wherein step S6 specifically include: S61, loading the 3D laser point cloud source_pointcloud_i of the i-th key frame in the first scene to be expanded Scene_1; S62, loading the 3D laser point cloud target_pointcloud_j of the key frame in the j±20th range in the second extended scene Scene_0; S63, align source_pointcloud_i to target_pointcloud_j and obtain the transformed pose between the two ; S64, adding the pose constraint cost function to the i-th key frame in the first scene to be expanded Scene_1; S65, using the GTSM library to implement bundling optimization of the key frame pose constraints of the first scene to be expanded Scene_1, so that the pose of the first scene to be expanded Scene_1 is spatially consistent with the pose of the second expanded scene Scene_0. The method according to claim 3 , wherein the first preset distance is 6 m.

5. According to the method of claim 3, the step S63: using the point cloud registration algorithm ICP to register source_pointcloud_i to target_pointcloud_j, and obtain the transformed pose between the two .

6. A 3D point cloud map automatic expansion device, comprising the following units: The first scene to be expanded acquisition unit is used to construct a 3D point cloud map for the first scene to be expanded Scene_1 using 3D laser SLAM, and save the 3D laser point clouds of all key frames and the corresponding first pose pose_1_i; The second extended scene loading unit is used to load the 3D laser point clouds of all key frames corresponding to the second extended scene Scene_0 and the corresponding second pose pose_0_j; A KD tree construction unit, used for constructing a 2-dimensional search KD tree kd_tree using the horizontal positions (x, y) in the second pose pose_0_j corresponding to all key frames in the second extended scene Scene_0; A key frame pair array construction unit is used to loop through the first pose pose_1_i corresponding to all key frames in the first scene to be expanded Scene_1, find the key frame pair (i, j) whose horizontal position does not exceed the first preset distance in the second scene to be expanded Scene_0 through kd_tree, and record it as the first key frame pair array map (i, j); A pose constraint unit, used for constructing a pose constraint cost function between frames for all key frames of the first scene to be expanded Scene_1; a pose spatial consistency unit, for looping through map (i, j), using the point cloud registration algorithm ICP to transform the poses of the 3D laser point cloud source_pointcloud_i of the i-th key frame in the first scene to be extended Scene_1 and the 3D laser point cloud target_pointcloud_j of the j-th key frame in the second scene to be extended Scene_0, adding the pose constraint cost function to the i-th key frame in the first scene to be extended Scene_1 and obtaining the pose of the first scene to be extended Scene_1 after optimization so that the pose of the first scene to be extended Scene_1 and the pose of the second scene to be extended Scene_0 are spatially consistent; The stitching unit is used to stitch the 3D point cloud map through the optimized pose of the first scene to be expanded Scene_1 and the corresponding 3D laser point cloud frame, so as to complete the automatic expansion of the 3D point cloud map.

7. The device according to claim 6, wherein the posture constraint unit is specifically include: Construct the pose constraint cost function between frames for all key frames of the first scene to be expanded Scene_1: ; pose_1_k is the kth key frame pose saved in the first scene to be expanded, Scene_1; pose_1_h is the key frame pose of the hth frame saved in the first scene to be expanded, Scene_1; Δpose_kh is the difference between the k-th key frame pose and the h-th key frame pose saved in the first scene to be expanded Scene_1; δ is the measurement information matrix corresponding to the key frame pose.

8. The device according to claim 7, wherein the posture space consistency unit is specifically include: A first key frame acquisition unit is used to load the 3D laser point cloud source_pointcloud_i of the i-th key frame in the first scene to be expanded Scene_1; The second key frame acquisition unit loads the 3D laser point cloud target_pointcloud_j of the key frame in the j±20th range of the second extended scene Scene_0; Transformation pose acquisition unit, aligns source_pointcloud_i to target_pointcloud_j, and obtains the transformation pose between the two ; A posture constraint unit, used for adding the posture constraint cost function to the i-th key frame in the first scene to be expanded Scene_1; The pose optimization unit is used to use the GTSM library to implement bundled optimization of the key frame pose constraints of the first scene to be expanded Scene_1, so that the pose of the first scene to be expanded Scene_1 is spatially consistent with the pose of the second expanded scene Scene_0.

9. The device according to claim 8, wherein the first preset distance is 6 m.

10. A patrol robot, comprising a drive unit, a power supply, a processor, and a memory, wherein the memory stores instructions, and when the instructions are executed by the processor, the 3D point cloud map automatic expansion method of any one of claims 1-5 is implemented.