Mapping positioning method and device and computer storage medium

Through the nearest neighbor and bump hull detection methods, combined with the reflection intensity information of laser points, the lidar mapping positioning algorithm is optimized, solving the problem of low matching accuracy in the existing technology, and improving the overlap between the local point cloud and the current frame point cloud. rate and matching accuracy, achieving more accurate robot map construction and positioning.

CN118587279APending Publication Date: 2024-09-03GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202310201327.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-02
Publication Date
2024-09-03

Smart Images

  • Figure CN118587279A
    Figure CN118587279A
Patent Text Reader

Abstract

The embodiment of the invention provides a mapping positioning method and device and a computer storage medium, and belongs to the technical field of map building and positioning. The method comprises the following steps: searching a plurality of target key frames closest to a current frame pose from a plurality of key frames, and storing key frame identifiers of the plurality of target key frames into a local map key frame identifier library; concave-convex position points are extracted from the key frame position point cloud, and key frame identifiers corresponding to the concave-convex position points are stored in a local map key frame identifier library; wherein the key frame position point cloud comprises position information of a plurality of key frames; and converting the feature point cloud corresponding to the key frame identifier stored in the local map key frame identifier library into a world coordinate system, and splicing to obtain a local map. According to the invention, the matching precision of the mapping positioning algorithm based on the laser radar can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of map construction and positioning technology, and in particular to a map construction and positioning method, device and computer storage medium. Background Art

[0002] LiDAR plays a very important role in smart home, unmanned driving, drone and other technologies. It can help robots obtain position information, accurately perceive the surrounding environment, and respond accordingly to environmental changes.

[0003] LiDAR emits a laser beam, which is reflected by an object. This process will generate a large number of data points to form a laser point cloud. Based on the multi-frame laser point cloud, the robot can be mapped and positioned.

[0004] However, the existing LiDAR-based mapping and positioning algorithms have low matching accuracy and are unable to accurately construct maps and locate. Summary of the invention

[0005] The purpose of this application is to provide a mapping and positioning method, device and computer storage medium to solve some or all of the problems existing in the prior art. The technical solution is as follows:

[0006] In a first aspect, a mapping and positioning method is provided, the method comprising:

[0007] Searching for multiple target key frames closest to the current frame pose from multiple key frames, and storing key frame identifiers of the multiple target key frames in a local map key frame identifier library;

[0008] Extracting concave and convex position points from the key frame position point cloud, and storing the key frame identifiers corresponding to the concave and convex position points into the local map key frame identifier library; wherein the key frame position point cloud includes the position information of the multiple key frames;

[0009] The feature point cloud corresponding to the key frame identifier stored in the local map key frame identifier library is converted to the world coordinate system and spliced ​​to obtain the local map.

[0010] Furthermore, the method further comprises:

[0011] The laser point clouds of each frame are preprocessed to extract the feature point clouds of each frame.

[0012] Furthermore, the preprocessing of the laser point cloud of each frame to extract the feature point cloud of each frame includes:

[0013] Filtering the laser radar point cloud of each frame by pass filtering and voxel filtering;

[0014] Line points and surface points are extracted from the filtered point cloud as feature point clouds of each frame.

[0015] Furthermore, before searching for a plurality of target key frames closest to the current frame pose from a plurality of key frames, the method further comprises:

[0016] If the distance between the current frame pose and the previous key frame pose reaches a preset threshold, the current frame is set as a new key frame.

[0017] Furthermore, the method further comprises:

[0018] Set the first frame of laser point cloud as the first keyframe.

[0019] Furthermore, the method further comprises:

[0020] The feature point cloud of the current frame is matched with the local map to obtain the current frame pose.

[0021] Furthermore, before converting the feature point cloud corresponding to the key frame identifier stored in the local map key frame identifier library to the world coordinate system, the method further includes:

[0022] The repeated key frame identifiers in the local map key frame identifier library are removed.

[0023] Furthermore, the method further comprises:

[0024] Calculating the intensity weight of each feature point in the current frame according to the reflection intensity value of each laser point in the current frame;

[0025] Calculating the total residual of the current frame according to the intensity weights of the feature points and the corresponding distance residuals;

[0026] The current frame pose is optimized according to the value of the total residual.

[0027] Furthermore, the calculating the intensity weight of each feature point of the current frame according to the reflection intensity value of each laser point in the current frame includes:

[0028] Acquire the feature point of the current frame, and search the local map for multiple laser points closest to the feature point;

[0029] Acquire a target reflection intensity value of the feature point according to the reflection intensity values ​​of the nearest multiple laser points;

[0030] An intensity weight of the feature point is calculated according to the initial reflection intensity value of the feature point and the target reflection intensity value.

[0031] Furthermore, the method also includes: converting the point clouds of all key frames into a world coordinate system through corresponding key frame poses, and splicing them to obtain a global map.

[0032] In a second aspect, a mapping and positioning device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method described in the first aspect.

[0033] In a third aspect, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the method described in the first aspect.

[0034] The beneficial effects brought by the technical solution provided by the embodiment of the present invention include:

[0035] First, this application is based on nearest neighbor and convex hull detection, which can increase the overlap rate between the local point cloud map and the current frame point cloud, and improve the matching accuracy of the mapping and positioning algorithm. Second, this application is based on intensity weighting, which not only considers the geometric characteristics of the point cloud, but also considers the reflection intensity information of the laser point, reduces the matching error, and thus improves the matching accuracy of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.

[0037] Figure 1 A schematic diagram of a flowchart of a mapping and positioning method provided by one embodiment of the present invention;

[0038] Figure 2 A schematic diagram of a flowchart of a mapping and positioning method provided by another embodiment of the present invention;

[0039] Figure 3 A schematic structural diagram of a mapping and positioning device provided in accordance with one embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0041] At present, the mapping and positioning algorithm based on LiDAR usually uses point-to-line and point-to-surface matching methods, which only consider the geometric characteristics of the point cloud and have low matching accuracy. In addition, the local map construction method usually intercepts the point cloud within a certain range near the current position of the robot. The local point cloud obtained by this method has a limited range, and the overlap rate between the local point cloud map and the current frame point cloud is low, which further reduces the matching accuracy of the mapping and positioning algorithm. Among them, the above-mentioned robot can be a physical robot or a data simulation, and this application does not limit this. For example, the robot can be a smart home device, a vehicle, a drone and other equipment.

[0042] In one embodiment, see Figure 1 The mapping and positioning method provided by the present invention may include steps S102-S106.

[0043] S102, searching for multiple target key frames closest to the current frame posture from multiple key frames, and storing key frame identifiers of the multiple target key frames in a local map key frame identifier library.

[0044] In practice, laser radar scanning can be used to obtain information about each sampling point on the surface of an object, and a laser point set containing a series of laser points can be obtained. This laser point set is a frame of laser point cloud. As the robot moves, laser point clouds of multiple frames can be obtained through laser scanning, and then key frames can be selected from these laser point clouds. Then, multiple target key frames closest to the current frame pose are searched from multiple key frames. Among them, the laser point information can include three-dimensional coordinates (XYZ), orientation, and laser reflection intensity (Intensity).

[0045] Among them, the pose includes the position and posture information of the robot. The position can represent the positioning of the robot relative to the world coordinate system, and the posture can represent the orientation of the robot relative to the world coordinate system. Correspondingly, the current frame pose can include the position and posture information of the robot in the current frame, that is, the positioning and orientation of the robot corresponding to the current frame relative to the world coordinate system.

[0046] In one embodiment, in order to reduce the number of point clouds and remove unnecessary laser points, the laser point clouds of each frame can be preprocessed to extract the feature point clouds of each frame. Figure 2 The specific data preprocessing method may include:

[0047] For a frame of LiDAR point cloud P_raw, first remove the point cloud within a radius of r1 around the robot body through the pass-through filter in the PCL library (Point Cloud Library), and then use voxel filtering to downsample the point cloud to reduce the number of points and obtain the downsampled point cloud P_filter. In this way, the point cloud data can be reduced while maintaining the shape characteristics of the point cloud. Then, feature extraction is performed on P_filter, and line points and surface points (i.e., the feature point cloud of the frame) are extracted based on the curvature calculation method in the open source laser mapping and positioning algorithm LOAM (LidarOdometry and Mapping in Real-time). Among them, the value of r1 can be arbitrarily set according to actual needs, and this application does not impose any restrictions on this. For example, the value of r1 is 40cm.

[0048] It is worth mentioning that the PCL library provides a large number of general point cloud-related algorithms and efficient data structures, which will not be described in detail in this application.

[0049] In one embodiment, a key frame can be selected from the acquired multi-frame laser point cloud according to certain preset conditions, see Figure 2 The process of selecting a key frame from a multi-frame laser point cloud (i.e., creating a key frame) may specifically include:

[0050] It is determined whether the distance dist between the pose T_now of the current frame and the pose T_last of the previous key frame reaches a certain threshold th_trans. If so, the current frame is set as a new key frame. The threshold th_trans can be preset according to actual needs, and this application does not limit it.

[0051] The distance dist is calculated as follows:

[0052] Assuming the position vector in T_now is (x0, y0, z0) and the position vector in T_last is (x1, y1, z1), then dist is:

[0053]

[0054] It is worth mentioning that the pose of the current frame is calculated by matching the feature point cloud of the current frame with the local map.

[0055] At the initial moment, the first frame of laser point cloud can be set as the first key frame. And the feature point cloud of the key frame can be stored in the local point cloud map. At subsequent moments, as the robot moves, multiple frames of laser point cloud will be obtained, and multiple target key frames can be searched and obtained from them.

[0056] In an embodiment, the process of searching for a target key frame includes: searching for k1 key frames closest to the current frame pose, and storing the corresponding key frame ID (key frame identifier) ​​in the current local map key frame ID library (local map key frame identifier library). The value of k1 can be preset according to actual needs, and this application does not limit this. For example, k1 can be any positive number, especially a positive integer greater than 1.

[0057] S104, extracting concave and convex position points from the key frame position point cloud, and storing key frame identifiers corresponding to the concave and convex position points into a local map key frame identifier library.

[0058] Among them, the key frame position point cloud includes the position information of multiple key frames; the concave and convex position points can include concave points and convex points, the concave points can represent the laser points in the concave area of ​​a frame of laser point cloud, and the convex points can represent the laser points in the convex area of ​​a frame of laser point cloud.

[0059] In implementation, the existing key frame positions (xyz) can be stored as points in the key frame position point cloud P_positions, and then the convex hull detection algorithm in the PCL library is used to extract the convex position points in the key frame position point cloud P_positions, and the key frame IDs corresponding to these position points are stored in the current local map key frame ID library.

[0060] For example, the convex hull detection algorithm can use the convex hull detection ConvexHull and the concave hull detection ConcaveHull provided by PCL. Of course, other algorithms can also be used to extract the concave and convex position points in the key frame position point cloud, and this application does not limit this.

[0061] In one embodiment, the key frame IDs stored in the current local map key frame ID library in step S102 and step S104 may overlap. In order to reduce the amount of data processing or prevent the same point cloud data from being superimposed, the repeated key frame IDs in the current local map key frame ID library may be removed, that is, the IDs in the current local map key frame ID library may be deduplicated.

[0062] S106, converting the feature point cloud corresponding to the key frame identifier stored in the local map key frame identifier library into a world coordinate system, and splicing them to obtain a local map.

[0063] In implementation, the key frame feature point cloud P_points with the corresponding ID in the key frame ID library of the current local map can be converted to the world coordinate system (i.e., the lidar coordinate system at the initial moment) through the corresponding key frame pose, and finally spliced ​​together to obtain the local point cloud map.

[0064] In one embodiment, assume that the pose of the key frame is (a 4×4 matrix). Among them, R is a 3×3 rotation matrix, which is the rotation of the lidar at the current moment relative to the world coordinate system (the lidar coordinate system of the robot's position at the initial moment). t is a 3×1 translation vector. Therefore, a 4×4 matrix can be used to uniformly describe the robot's position and posture.

[0065] Keyframe point cloud P_points (containing n points), point cloud P after conversion to the world coordinate system world The calculation method is as follows:

[0066]

[0067] The p in the formula k Indicates the kth laser point in P_points. k starts from i and goes to n.

[0068] It is worth mentioning that the intensity information returned by laser scanning on different objects may be different due to factors such as the material and color of the object itself. The semantic information of intensity information can provide the distinction of laser points.

[0069] In one embodiment, referring to step S212, the intensity information can be used to optimize the posture of the current frame to obtain the current accurate positioning of the robot. Specifically, the intensity weights of each feature point of the current frame can be calculated based on the reflection intensity values ​​of each laser point in the current frame; the total residual of the current frame can be calculated based on the intensity weights of each feature point and the corresponding distance residual; and the posture of the current frame can be optimized based on the value of the total residual.

[0070] If the intensity information of the feature point p_source in the current frame is very similar to the intensity information of the nearest laser point searched, it means that these laser points are likely to hit the same object. When the intensity information of a feature point and a nearest laser point is very different, it means that the two laser points belong to different objects, so the search error can be approximately characterized by the difference in intensity information. Among them, p_source includes two types of line points and surface points in the current frame.

[0071] Furthermore, the process of calculating the intensity weight of each feature point of the current frame may specifically include: obtaining the feature point of the current frame, and searching for multiple laser points closest to the feature point from the local map; obtaining the target reflection intensity value of the feature point based on the reflection intensity values ​​of the multiple nearest laser points; and calculating the intensity weight of the feature point based on the initial reflection intensity value and the target reflection intensity value of the feature point.

[0072] For example, for the feature point p_source of the current frame (assuming its intensity information value is I source), search for several nearest points in the local point cloud map, and then take the weighted average of the intensity information of these several nearest points as a new intensity value I target The nearest point can be a point within a certain radius or a fixed number of points, which is not limited in this application. For example, for the feature point p_source, the five nearest points are directly searched in the local point cloud map, and then the intensity information of these five laser points is weighted averaged to obtain a new intensity value I target .

[0073] The intensity weight is calculated as follows:

[0074]

[0075] The total residual is calculated as follows:

[0076]

[0077] Where m represents the number of line points in p_source, and n represents the number of surface points in p_source. line is the distance residual of the point-to-line search method, r plane is the distance residual of the point-to-plane search method. line and r plane The calculation of LOAM is referred to. There are two types of LOAM feature extraction: corner points and surface points. The corresponding residuals are also of two types, namely point-line residuals and point-surface residuals, which are not described in detail in this application.

[0078] It is worth mentioning that r line and r plane The calculation of involves the posture T, which is the current position and posture information of the robot in the world coordinate system and is the variable to be optimized.

[0079] Afterwards, the constructed total residual can be used to optimize the posture of the current frame. Among them, the optimization process can be performed using the third-party library Ceres (Google nonlinear optimization library), which is not described in detail in this application. The purpose of the optimization is to continuously iterate and adjust the posture T so that the total residual tends to be minimized. The final posture T is the posture of the current frame, which is also the position and posture of the robot in the world coordinate system at the current moment. In this way, the positioning of the robot is more accurate.

[0080] In one embodiment, referring to step S214, point clouds of all key frames may be converted to a world coordinate system through corresponding key frame poses, and then spliced ​​to obtain a global map.

[0081] It is worth mentioning that Figure 2 The processing of steps S206-S210 in Figure 1The steps S102-S106 in are similar and will not be described in detail in this application.

[0082] The beneficial effects brought about by the technical solutions provided by the above embodiments include:

[0083] First, this application is based on nearest neighbor and convex hull detection, which can increase the overlap rate between the local point cloud map and the current frame point cloud, and improve the matching accuracy of the mapping and positioning algorithm. Second, this application is based on intensity weighting, which not only considers the geometric characteristics of the point cloud, but also considers the reflection intensity information of the laser point, reduces the matching error, and improves the matching accuracy of the algorithm. In turn, it can accurately build a map and position the robot in real time.

[0084] Based on the same technical concept, the embodiment of the present invention also provides a mapping and positioning device. Figure 3 The mapping and positioning device provided in an embodiment of the present invention may include a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method described in any of the above embodiments.

[0085] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the software product of the mapping and positioning method can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including storing a number of instructions to enable a device to execute the methods described in each embodiment or some parts of the embodiments.

[0086] 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 mapping and positioning method, characterized in that: The method comprises: Searching for multiple target key frames closest to the current frame pose from multiple key frames, and storing key frame identifiers of the multiple target key frames in a local map key frame identifier library; Extracting concave and convex position points from the key frame position point cloud, and storing the key frame identifiers corresponding to the concave and convex position points into the local map key frame identifier library; wherein the key frame position point cloud includes the position information of the multiple key frames; The feature point cloud corresponding to the key frame identifier stored in the local map key frame identifier library is converted to the world coordinate system and spliced ​​to obtain the local map.

2. The mapping and positioning method according to claim 1, characterized in that: The method further comprises: The laser point clouds of each frame are preprocessed to extract the feature point clouds of each frame.

3. The mapping and positioning method according to claim 2, characterized in that: The preprocessing of the laser point cloud of each frame to extract the feature point cloud of each frame includes: Filtering the laser radar point cloud of each frame by pass filtering and voxel filtering; Line points and surface points are extracted from the filtered point cloud as feature point clouds of each frame.

4. The mapping and positioning method according to claim 1, characterized in that: Before searching for a plurality of target key frames closest to the current frame pose from a plurality of key frames, the method further includes: If the distance between the current frame pose and the previous key frame pose reaches a preset threshold, the current frame is set as a new key frame.

5. The mapping and positioning method according to claim 4, characterized in that: The method further comprises: Set the first frame of laser point cloud as the first keyframe.

6. The mapping and positioning method according to claim 1, characterized in that: The method further comprises: The feature point cloud of the current frame is matched with the local map to obtain the current frame pose.

7. The mapping and positioning method according to claim 1, characterized in that: Before converting the feature point cloud corresponding to the key frame identifier stored in the local map key frame identifier library to the world coordinate system, the method further includes: The repeated key frame identifiers in the local map key frame identifier library are removed.

8. The mapping and positioning method according to claim 1, wherein: The method further comprises: Calculating the intensity weight of each feature point in the current frame according to the reflection intensity value of each laser point in the current frame; Calculating the total residual of the current frame according to the intensity weights of the feature points and the corresponding distance residuals; The current frame pose is optimized according to the value of the total residual.

9. The mapping and positioning method according to claim 9, characterized in that: The step of calculating the intensity weight of each feature point in the current frame according to the reflection intensity value of each laser point in the current frame includes: Acquire the feature point of the current frame, and search the local map for multiple laser points closest to the feature point; Acquire a target reflection intensity value of the feature point according to the reflection intensity values ​​of the nearest multiple laser points; An intensity weight of the feature point is calculated according to the initial reflection intensity value of the feature point and the target reflection intensity value.

10. The mapping and positioning method according to claim 1, wherein: The method further comprises: The point clouds of all key frames are transformed into the world coordinate system through the corresponding key frame poses, and the global map is obtained by splicing.

11. A mapping and positioning device, characterized in that: The mapping and positioning device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method according to any one of claims 1 to 10.

12. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method according to any one of claims 1 to 10.

Citation Information

Cited By

  • AGV natural scene positioning method and system based on 3D laser radar

    CN120085317A

  • A 3D LiDAR-based AGV Natural Scene Localization Method and System

    CN120085317B

  • Texture map deduplication method and device and storage medium

    CN121498652A