A positioning method, device and storage medium based on multi-sensor fusion

Through the multi-sensor fusion method, image, IMU and laser data are combined to construct constraint equations, and loop detection and global optimization are used to solve the problems of mobile robot positioning accuracy and robustness, and achieve high-precision pose estimation in changing environments.

CN112304307BActive Publication Date: 2024-09-06ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010969817.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-15
Publication Date
2024-09-06
Estimated Expiration
2040-09-15

AI Technical Summary

Technical Problem

Existing mobile robot positioning methods have low accuracy under illumination changes and environmental changes, and traditional filtering algorithms cannot effectively correct cumulative errors and maintain robustness in laser-degraded environments.

Method used

Using a multi-sensor fusion method, combined with binocular camera image data, IMU observation data and laser point cloud data, the constraint equation is constructed through a priori constraint factors, unstructured visual constraint factors, IMU pre-integration constraint factors and laser matching constraint factors, using Loop detection and global pose optimization are used to obtain the pose of the robot.

Benefits of technology

It improves positioning accuracy and robustness, can maintain high-precision positioning in illumination changes and laser degradation environments, and reduces cumulative errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112304307B
    Figure CN112304307B
Patent Text Reader

Abstract

The present application discloses a positioning method, device and storage medium based on multi-sensor fusion, the method comprising: acquiring image data, IMU observation data and laser point cloud data; constructing constraint equations by combining prior constraint factors, unstructured visual constraint factors, IMU pre-integration constraint factors and laser matching constraint factors to obtain the robot's posture, wherein the prior constraint factors are error constraint factors corresponding to laser point cloud data or IMU observation data, the unstructured visual constraint factors are error constraint factors corresponding to image data, the IMU pre-integration constraint factors are error constraint factors corresponding to IMU observation data, and the laser matching constraint factors are error constraint factors corresponding to laser point cloud data; correcting the robot's posture by loopback detection to obtain a corrected posture; performing global posture optimization on the corrected posture to obtain globally consistent posture information. In the above manner, the present application can improve positioning accuracy and robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of robotics technology, and in particular to a positioning method, device and storage medium based on multi-sensor fusion. Background Art

[0002] When a mobile robot is performing a task, such as moving objects in a warehouse, if the warehouse environment changes, the mobile robot needs to accurately know its position in the current environment in the changing environment so that it can accurately perform the task; however, some of the current positioning solutions have the problem that the measurement accuracy of the binocular camera is seriously affected by lighting, cannot be directly coupled from the observation level, and cannot be used in an environment where the positioning scene changes; some solutions require the use of filtering algorithms for fusion. The filtering algorithm is equivalent to only one iteration in the process of solving the optimal value. The accuracy is not as good as the nonlinear optimization method, and the accumulated errors cannot be corrected. Summary of the invention

[0003] The present application provides a positioning method, device and storage medium based on multi-sensor fusion, which can improve positioning accuracy and robustness.

[0004] In order to solve the above technical problems, the technical solution adopted in this application is to provide a positioning method based on multi-sensor fusion, which includes: acquiring image data, IMU observation data and laser point cloud data; constructing a constraint equation by combining a priori constraint factors, unstructured visual constraint factors, IMU pre-integration constraint factors and laser matching constraint factors to obtain the robot's posture, wherein the priori constraint factors are error constraint factors corresponding to laser point cloud data or IMU observation data, the unstructured visual constraint factors are error constraint factors corresponding to image data, the IMU pre-integration constraint factors are error constraint factors corresponding to IMU observation data, and the laser matching constraint factors are error constraint factors corresponding to laser point cloud data; using loop detection to correct the robot's posture to obtain a corrected posture; performing global posture optimization on the corrected posture to obtain globally consistent posture information.

[0005] To solve the above technical problems, another technical solution adopted in the present application is to provide a positioning device based on multi-sensor fusion, which includes a memory and a processor connected to each other, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the above-mentioned positioning method based on multi-sensor fusion.

[0006] In order to solve the above technical problems, another technical solution adopted in the present application is to provide a computer-readable storage medium, which is used to store a computer program. When the computer program is executed by a processor, it is used to implement the above-mentioned positioning method based on multi-sensor fusion.

[0007] Through the above scheme, the beneficial effects of the present application are: the present application first obtains image data obtained by a binocular camera, IMU observation data obtained by an IMU, and laser point cloud data obtained by a lidar sensor, and then constructs a priori constraint factors, unstructured visual constraint factors, IMU pre-integration constraint factors, and laser matching constraint factors based on the acquired data, and constructs constraint equations by combining these constraint factors, and then uses the constraint equations to generate the robot's posture, and further corrects the generated posture through loop detection, and finally obtains globally consistent posture information through global posture graph optimization; compared with traditional visual inertial systems, the scheme of the present application integrates laser point cloud information, and can combine IMU pre-integration constraint factors, unstructured visual constraint factors, and laser matching constraint factors in a tightly coupled manner, which can improve the positioning accuracy of the system; compared with traditional 3D laser and inertial navigation systems, the addition of visual image information obtained by a binocular camera can improve the robustness of positioning in laser-degraded application environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0009] Figure 1 It is a flowchart of an embodiment of a positioning method based on multi-sensor fusion provided by the present application;

[0010] Figure 2 is a flow chart of another embodiment of a positioning method based on multi-sensor fusion provided by the present application;

[0011] Figure 3 yes Figure 2 A schematic diagram of the flow chart of step 202 in the embodiment shown;

[0012] Figure 4 yes Figure 2 A schematic diagram of performing outlier removal in the embodiment shown;

[0013] Figure 5 yes Figure 2 A schematic diagram of the flow chart of step 204 in the embodiment shown;

[0014] Figure 6 yes Figure 2 IMU pre-integration constraint factor diagram in the embodiment shown;

[0015] Figure 7 yes Figure 2 In the illustrated embodiment, there is no structured visual constraint factor graph;

[0016] Figure 8(a) is Figure 2 A priori constraint factor graph in the embodiment shown;

[0017] Figure 8(b) is the prior constraint factor graph generated after marginalizing the oldest laser frame;

[0018] Fig. 9 yes Figure 2 A factor graph of the joint prior constraints, IMU pre-integration constraints, unstructured vision constraints, and laser matching constraints in the illustrated embodiment;

[0019] Fig.10 yes Figure 2 The multi-sensor information fusion factor graph in the illustrated embodiment;

[0020] Fig.11 yes Figure 2 The factor graph corresponding to the global pose joint optimization in the embodiment shown;

[0021] Fig.12 It is a structural schematic diagram of an embodiment of a positioning device based on multi-sensor fusion provided by the present application;

[0022] Fig.13 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION

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

[0024] See also Figure 1 , Figure 1 : is a flow chart of an embodiment of a positioning method based on multi-sensor fusion provided by the present application, the method comprising:

[0025] Step 11: Obtain image data, IMU observation data, and laser point cloud data.

[0026] The image data is collected by using a binocular camera. The binocular camera includes a left camera and a right camera. The images of the left and right cameras can be synchronously collected to calculate the parallax between the images. Then, according to the baseline distance between the left and right cameras, the distance between the three-dimensional landmark point corresponding to the pixel point and the camera is calculated. The parallax is inversely proportional to the distance. The smaller the parallax, the greater the distance.

[0027] IMU observation data is data collected by an inertial measurement unit (IMU); specifically, the angular velocity and linear acceleration in the IMU coordinate system (robot body coordinate system) can be directly obtained by using the IMU. The change in posture between the previous and next moments can be estimated by integration, and then the posture of the robot at the current moment can be estimated by combining the posture at the previous moment.

[0028] Laser point cloud data is data obtained using 3D multi-line laser radar. 3D multi-line laser radar is a sensor for obtaining three-dimensional spatial information. It is generally divided into 16-line, 32-line and 64-line. It can provide laser point cloud data information of the surrounding environment, and its ranging accuracy is higher than that of binocular vision.

[0029] Step 12: Combine the prior constraint factor, unstructured vision constraint factor, IMU pre-integration constraint factor and laser matching constraint factor to construct the constraint equation to obtain the robot's position and posture.

[0030] The prior constraint factor is the error constraint factor corresponding to the laser point cloud data or the IMU observation data, the unstructured vision constraint factor is the error constraint factor corresponding to the image data, the IMU pre-integration constraint factor is the error constraint factor corresponding to the IMU observation data, and the laser matching constraint factor is the error constraint factor corresponding to the laser point cloud data.

[0031] After constructing the prior constraint factors, unstructured vision constraint factors, IMU pre-integration constraint factors and laser matching constraint factors, they can be combined together in a tight coupling manner to construct a constraint equation, and then the constraint equation is used to calculate the robot's posture, which includes position information and yaw angle.

[0032] Step 13: Use loop detection to correct the robot's posture and obtain the corrected posture.

[0033] During the positioning process, there may be cumulative errors in the four dimensions of the robot's position and yaw angle. In order to reduce the cumulative errors, loop detection can be used to correct the acquired posture and obtain the corrected posture.

[0034] Step 14: Perform global pose optimization on the corrected pose to obtain globally consistent pose information.

[0035] After loop closure detection, in order to obtain a globally consistent posture, the optimization method can be used to optimize the global posture graph of the loop closure detection output results, so as to obtain the final posture information of the robot and achieve real-time positioning.

[0036] This embodiment combines IMU, binocular camera and 3D lidar sensor to perform high-precision positioning of the mobile robot. The constraint equation can be constructed by combining prior constraint factors, unstructured visual constraint factors, IMU pre-integration constraint factors and laser matching constraint factors to obtain the robot's posture, and the generated posture is further corrected through loop detection. Finally, the global posture optimization is performed to obtain globally consistent posture information. Compared with the traditional visual inertial system, the solution of this embodiment integrates 3D laser point cloud information, and can combine multiple constraint factors together in a tightly coupled manner, thereby improving the positioning accuracy of the system. Compared with the traditional 3D laser and inertial navigation system, the visual information obtained by the binocular camera is added, which can improve the robustness of the algorithm in a laser-degraded environment.

[0037] See also Figure 2 , Figure 2 : is a flow chart of another embodiment of a positioning method based on multi-sensor fusion provided by the present application, the method comprising:

[0038] Step 201: Acquire image data, IMU observation data, and laser point cloud data.

[0039] The image data includes a plurality of image frames, each of which includes a left-eye image frame captured by a left-eye camera and a right-eye image frame captured by a right-eye camera.

[0040] Step 202: extract features from the left-eye image frame to generate left-eye feature points, and use the left-eye feature points to obtain right-eye feature points in the right-eye image frame at the same time; process the left-eye feature points and the corresponding right-eye feature points to eliminate external points in the left-eye image frame and the external points in the right-eye image frame.

[0041] You can use Figure 3 The steps shown are processed to obtain feature points in the image, specifically including:

[0042] Step 2021: Use the left eye feature points to perform stereo matching of the left and right eyes to obtain the right eye feature points, and use the right eye feature points as the initial value of optical flow tracking.

[0043] An image pyramid is constructed for the images collected by the left and right cameras for optical flow tracking, and then feature points are extracted from the left image frame to perform left and right stereo matching. That is, the pixel coordinates of the left camera and the intrinsic parameters of the left camera are first converted to the camera normalized coordinate system of the left camera, and the influence of distortion is removed. Then, the corresponding normalized coordinates of the right camera are calculated through the extrinsic parameters of the left and right cameras, and the pixel coordinates of the right camera are calculated based on the intrinsic parameters and distortion coefficient of the right camera, and the pixel coordinates are used as the initial value of the LKT (Lucas Kanade Tomasi) optical flow tracking of the right camera.

[0044] Step 2022: Perform optical flow tracking to obtain left eye tracking feature points and right eye tracking feature points, and process the left eye feature points in the left eye image frame and the right eye feature points in the right eye image frame to filter out the external points in the left eye image frame and the external points in the right eye image frame.

[0045] The initial value is used to perform LKT optical flow tracking to obtain the tracked feature points in the left eye image frame (i.e., left eye tracking feature points) and the tracked feature points in the right eye image frame (i.e., right eye tracking feature points), and then stereo matching is performed to eliminate the first outliers in the left eye image frame and the right eye image frame.

[0046] Step 2023: respectively obtain the normalized coordinates of the left eye tracking feature point and the right eye tracking feature point in the corresponding camera coordinate system to obtain the left eye coordinates and the right eye coordinates.

[0047] The normalized coordinates of the feature points that can be tracked on the left and right cameras in the corresponding camera coordinate system are obtained respectively, that is, the left eye coordinates and the right eye coordinates.

[0048] Step 2024: construct an essential matrix using the extrinsic parameters of the left camera and the right camera, and remove external points using epipolar geometry constraints to obtain remaining feature points.

[0049] The intrinsic matrix E can be constructed using the external parameters of the left and right cameras, and the epipolar geometry constraints can be used to remove external points, as shown below:

[0050] x0Ex1=0 (1)

[0051] Among them, E = t^R, t is the translation of the left camera relative to the right camera, and its corresponding inverse triangular symmetric matrix is ​​as follows:

[0052]

[0053] Among them, R is the rotation of the left camera relative to the right camera, x0 is the normalized coordinate under the left camera, and x1 is the normalized coordinate of the feature point extracted from the left camera under the right camera through LKT optical flow tracking.

[0054] It can be understood that outliers can also be eliminated based on whether x0Ex1 is greater than a certain threshold, that is, whether the product of the left eye coordinates, the essential matrix and the right eye coordinates corresponding to each feature point is greater than a preset value, and the preset value can be a value set according to experience; if the product of the left eye coordinates, the essential matrix and the right eye coordinates corresponding to the feature point is greater than the preset value, then the feature point is an outlier; specifically, if x0Ex1 is equal to 0, it means that x0 and x1 are completely matched without any error; if x0Ex1> the preset value, it means that the degree of match between x0 and x1 is low.

[0055] Step 2025: Divide the left-eye image frame and the right-eye image frame into a first preset number of grids, and divide the remaining feature points into corresponding grids.

[0056] The image frames captured by the left camera are divided into a certain number of grids, that is, the left image frames are split into multiple small blocks; then the feature points after removing the outliers are distributed in each grid, and the number of feature points in each grid can be limited according to the threshold of the feature points to ensure that the number of feature points in each grid is less than the second preset number; this can limit the number and distribution of feature points on each frame of the image, avoid the extracted feature points from being concentrated in one area, and improve the speed and accuracy of later feature matching. For example, the size of the left image frame is 600*800, and it can be split into 40 grids of uniform size, and feature extraction is performed on each grid to ensure that the feature points are evenly distributed in each grid, so that the feature points will not be concentrated together, and the inaccurate relative position relationship caused by the concentration of feature points can be prevented.

[0057] Step 203: Perform feature tracking on the previous and next two frames of IMU observation data to eliminate external points in the previous image frame.

[0058] After preliminary external point elimination through the above steps, when a new frame of image data comes, feature tracking of the previous and next two frames can be performed.

[0059] In a specific embodiment, the IMU observation data of the previous and next two frames can be used to obtain the relative posture of the previous image frame with respect to the current image frame, and then the pixel coordinates and relative posture in the previous image frame are used to predict the pixel coordinates of the current image frame. The pixel coordinates of the current image frame are used as the initial values ​​of the LKT optical flow tracking of the previous and next frames, and then optical flow tracking is performed to obtain the left eye tracking feature points and the right eye tracking feature points in the current image frame.

[0060] According to the tracking feature points, outliers are eliminated for the feature points on the left and right eye image frames of the previous frame. Specifically, stereo matching is performed on the left eye tracking feature points and the right eye tracking feature points. According to the results of the stereo matching, outliers are eliminated for the feature points on the left and right eye image frames of the previous frame for the second time to further screen out outliers in the previous image frame.

[0061] Then, the left eye image frame and the right eye image frame in the two frames are processed respectively to filter out the outliers in the previous image frame. Specifically, the third outlier elimination is performed by using the 2-point random sampling consensus algorithm (RANSAC) to ensure that the matched feature points are accurate enough. The schematic diagram of the three outlier eliminations can be shown as follows: Figure 4 As shown, the previous image frame is the image frame corresponding to the k-1 moment, and the current image frame is the image frame corresponding to the k moment.

[0062] The feature points that can be tracked after the above three times of external point elimination are distributed to each grid corresponding to the current image frame.

[0063] It can be understood that during the positioning process, when there are too few visual feature points and visual tracking fails, the camera pose at the current moment can be deduced based on the position at the previous laser acquisition moment or the position at the most recent image acquisition moment that can be tracked normally and the IMU observation data, and the feature points are re-extracted on the image to re-track the features and establish constraints. That is, when the number of feature points in the current image frame is less than the third preset number, feature extraction is performed on the current image frame to obtain new left-eye feature points, and the third preset number is less than the second preset number; stereo matching is performed on the new left-eye feature points to obtain new right-eye feature points; stereo matching is performed on the new left-eye feature points and the new right-eye feature points to filter out the outliers and obtain newly added left-eye feature points and newly added right-eye feature points; the newly added left-eye feature points are added to the grid corresponding to the left-eye image frame, and the newly added right-eye feature points are added to the grid corresponding to the right-eye image frame, until the number of feature points in each grid is no more than the second preset number, and the feature points in the current image frame can be used for the next feature tracking.

[0064] Step 204: performing a dedistortion process on the laser point cloud data, and extracting line feature points or surface feature points in the dedistorted laser point cloud data.

[0065] The frequency of 3D laser is low, generally 10Hz. When the laser moves, the collected laser point cloud data may be distorted, which is not suitable for direct point cloud matching for pose estimation. Therefore, the laser point cloud data can be dedistorted. Figure 5 The method shown specifically comprises the following steps:

[0066] Step 2041: Use the IMU observation data to predict the position and posture of the k-th frame of laser point cloud data at the end of acquisition.

[0067] Assume that the time when the k-th frame of laser point cloud data is just collected is t k-1 The time when the scan ends is t k , using IMU observation data to predict t k The position at the moment is recorded as T k .

[0068] Step 2042: Calculate the pose corresponding to the laser point cloud data at the current moment by using the pose of the laser point cloud data at the end of acquisition, the start time of acquisition of the k-th frame of laser point cloud data, the end time of acquisition of the k-th frame of laser point cloud data, and the current moment.

[0069] Assume that the time (i.e. the current time) corresponding to the laser point cloud data during the scanning process of a frame of laser data is t, and its corresponding posture should be T t , use this pose to project the frame point cloud data to time k, as shown below:

[0070]

[0071] The above formula can be used to achieve dedistortion processing of laser point cloud data.

[0072] Step 2043: Calculate the curvature between each laser point in the dedistorted laser point cloud data and the laser point at a preset distance from the laser point, and use the laser point with a curvature less than the preset curvature as a surface feature point.

[0073] After removing motion distortion from the laser point cloud data, the curvature can be calculated using the laser point cloud data and the laser point cloud data within a certain range from the laser point cloud data. Points with curvature less than a certain threshold (i.e., the preset curvature) are selected as surface feature points. The curvature calculation formula is as follows:

[0074]

[0075] Among them, c is the curvature, S is the laser point cloud data set used to calculate the curvature, L is the laser coordinate system, X is the laser point cloud data, k is the serial number of the laser point cloud data, and i and j are the serial numbers of the point cloud in the kth laser point cloud data.

[0076] Step 205: construct a local map using line feature points or surface feature points, and match the laser point cloud data of the current frame with the local map to estimate the position and posture of the laser point cloud data at the time of acquisition.

[0077] When estimating the robot's posture, after obtaining the line features or surface features corresponding to the laser point cloud data, the acquired feature points can be used to construct a local map based on the sliding window, and then the current frame laser point cloud data can be matched with the established local map to estimate the posture of the laser point cloud data at the time of acquisition, so as to improve the accuracy of laser matching and reduce the overall calculation time.

[0078] Step 206: Use the median integral method to process the IMU observation data and the posture at the previous moment before the current moment to estimate the posture at the current moment, and use the posture at the current moment as the initial value of the posture.

[0079] The median integral method is used to estimate the current posture according to the IMU observation data and the posture at the previous moment, and use it as the initial value, and then construct the constraint factor of the corresponding posture, that is, execute step 207.

[0080] Step 207: Construct a constraint equation by combining the prior constraint factor, the unstructured vision constraint factor, the IMU pre-integration constraint factor, and the laser matching constraint factor; obtain the robot's posture using the initial posture value and the constraint equation.

[0081] The establishment process of each constraint factor is as follows:

[0082] a) IMU pre-integration constraint factor

[0083] The kinematic model of the IMU is as follows:

[0084]

[0085] Among them, p wbt is the position of the robot relative to the world coordinate system at time t, v wbt is the speed of the robot relative to the world coordinate system at time t, q wbt is the angle of the robot relative to the world coordinate system at time t, which can be expressed by quaternion; a wbt is the acceleration of the robot relative to the world coordinate system at time t; wbt is the angular velocity of the robot relative to the world coordinate system at time t expressed in the robot coordinate system; is the multiplication between quaternions.

[0086] The observation model of IMU is as follows:

[0087]

[0088] in, is the angular velocity observation value of the IMU in the robot coordinate system, is the acceleration observed by IMU in the robot coordinate system, b g and n g are the gyroscope bias and observation noise of IMU, and b a and n a are the accelerometer bias and observation noise of the IMU, g w is the acceleration due to gravity, which is a negative value.

[0089] According to the motion model, observation model and the state at the previous moment k-1, the integral formulas of displacement, velocity, rotation and offset at moment k can be obtained as follows:

[0090]

[0091] Among them, p w bk is the displacement of the robot relative to the world coordinate system at time k, v w bk is the velocity of the robot relative to the world coordinate system at time k, qw bk is the rotation of the robot relative to the world coordinate system at time k, which can be expressed by quaternion; b a bk With b g bk is the zero bias of the accelerometer and gyroscope at time k, α bk bk+1 is the displacement pre-integrated quantity calculated by IMU at time k and time k+1, β bk bk+1 is the velocity pre-integrated quantity calculated by IMU at time k and time k+1, q bk bk+1 It is the estimated angle component calculated by the IMU at time k and time k+1.

[0092] From formulas (2)-(4), the pre-integration constraint factor of IMU can be obtained as follows:

[0093]

[0094] Among them, r p 、r q 、r v 、r ba and r bg Corresponding to the residuals of displacement, velocity, rotation, accelerometer bias and gyroscope bias, α bk bk+1 , β bk bk+1 and q bk bk+1 It is directly obtained through IMU observations, and the variables to be calculated are: p w bk 、v w bk ,q w bk 、p w bk+1 、v w bk+1 ,q w bk+1 、b a bk+1 、b a bk 、b g bk+1 and b g bk , Δt is the time difference between time k and time k+1.

[0095] The factor graph corresponding to the IMU pre-integration constraint is as follows Figure 6As shown, the translation and rotation correspond to circle 61 in the factor diagram, the velocity, accelerometer and gyroscope zero bias correspond to circle 62 in the IMU factor diagram, circle 61 represents the robot posture corresponding to the camera moment or the laser moment, circle 62 represents the robot velocity, gyroscope and accelerometer zero bias corresponding to the camera moment or the robot moment, and box 63 is the IMU pre-integration constraint factor.

[0096] b) Unstructured visual constraint factor:

[0097] In the visual front end, feature points can be tracked and new feature points can be added to the current frame. In the joint optimization, if the 3D landmark points corresponding to the camera are also used as optimization variables, it will be very time-consuming. This embodiment uses an unstructured visual constraint factor; if the tracked feature point cannot be observed in the current frame, and the number of observed common view frames is greater than 3, and the viewing angle difference between the first and last frames in which the feature point is observed is large enough, the 3D coordinates of the feature point can be restored using the relative posture relationship of the common view frames. The specific steps for restoring the 3D coordinates are:

[0098] 1) According to the relative pose of the first and last frames of the common view frame and the pixel coordinates of the feature points on the track, triangulate and restore the initial 3D coordinates of the feature points in the first frame. The following formula can be used for calculation:

[0099]

[0100]

[0101] Among them, u and v are the pixel coordinates on the pixel plane in the camera, x, y and z are the coordinates in the first frame camera coordinate system, z1 and z2 correspond to the 3D points in the image frame c1 and the corresponding image frame c2 respectively, R c2c1 and t c2c1 are the rotation and translation of image frame c1 relative to image frame c2 respectively.

[0102] 2) According to the relative posture relationship of the first frame in the common view frame with respect to other frames in the common view frame, the reprojection error of the 3D point in the coordinate system of the first frame to other frames is used to optimize the 3D point. The perspective projection equation is as follows:

[0103]

[0104] Among them, α and β are the normalized coordinates of the 3D landmark point in the first frame image coordinate system, ρ is the inverse depth value of the landmark point in the first frame image coordinate system, and R cic1 and t cic1 are the rotation and translation of the first frame image relative to other frames in the common view frame.

[0105] The reprojection error is shown below:

[0106]

[0107] Where r is the reprojection error, h(0), h(1) and h(2) are the reprojection coordinates on other common view frames obtained by formula (8), z(0) and z(1) are the pixel coordinates of the feature point tracked on the common view frame. Formula (11) is optimized and solved using the LM (Levenberg-Marquardt) method to obtain the accurate 3D coordinates of the feature point.

[0108] The set of common view frames where feature point p is observed is denoted as {S} p , the 3D coordinates corresponding to the feature point p are X p , then the reprojection error of the camera at time k is:

[0109]

[0110] Among them, z is the observed value of feature point p in the current image, h is the perspective projection equation, T k is the camera pose.

[0111] By approximately expanding the above equation and superimposing the residuals of the common view frames, the visual constraint factor can be obtained as follows:

[0112] ||r c || Σc =||H x ·δT k +H p ·δx p +n p || (13)

[0113] Among them, H x is the Jacobian matrix of the error term with respect to the camera pose, H p is the Jacobian matrix of the error term with respect to the 3D point position, n p is the observation error of the feature point.

[0114] In order to improve the computational efficiency, the 3D point coordinates are not optimized in the optimized state variables. p Projection is performed on the left null space, denoted by H p The left null space matrix is ​​V f , then the corresponding unstructured feature constraint equation is:

[0115] ||r c || Σc =||V f H x ·δT k +V f np || (14)

[0116] The above formula converts the constraints between the camera and the 3D point coordinates into the constraints between cameras. The factor graph corresponding to the above operation is as follows: Figure 7 As shown, box 71 is the unstructured visual constraint factor, circle 62 represents the camera pose, that is, the optimization variable to be determined, and box 63 represents the IMU pre-integration constraint factor.

[0117] c) Prior Constraint Factor

[0118] In order to reduce the amount of calculation and improve the operation efficiency, this embodiment adopts a method based on sliding window optimization, and optimizes the position, speed and zero bias corresponding to a fixed number of laser data and camera data in the sliding window each time. When new laser data or camera data is added to the sliding window, the oldest laser in the sliding window is removed, and the IMU pre-integration constraint associated with the oldest laser data frame is transferred to other laser data frames or camera frames in the sliding window that have constraint information with the laser frame; if the oldest frame removed is a camera frame, the IMU pre-integration constraint associated with the oldest camera frame is transferred to the laser frame and camera frame associated with it, and the visual constraint associated with it is also marginalized to other common view frames in the sliding window as the prior information for the next joint optimization.

[0119] When the oldest laser data frame is marginalized, the coordinate system of the local map can be reprojected to the laser coordinate system of the first frame in the sliding window, and the laser point cloud associated with the oldest laser data frame in the local map can be deleted to reduce the occupation of the point cloud memory space.

[0120] The factor graph before removing the oldest laser frame is shown in Figure 8(a), and the factor graph corresponding to the prior constraint generated by marginalizing the oldest laser frame is shown in Figure 8(b). Circle 81 is the robot's position at the laser moment, box 82 is the laser matching constraint factor, and box 83 is the prior constraint factor.

[0121] d) Laser matching constraint factor

[0122] The surface features of the laser point cloud data after distortion removal can be extracted; assuming that the subscript of the laser data frame in the current sliding window is {p, p+1, ..., j}, the surface features in the m frame data (for example, m=20) that have been jointly optimized outside the sliding window and the {p, p+1, ..., j-1} frame data that have been jointly optimized in the sliding window are used to construct a local map ML, and the surface feature points are saved in a 3D-KDTree (k-dimensional Tree) to facilitate the nearest neighbor search of the feature points in the later stage. Here, all features are converted to the Lp coordinate, and the conversion formula is as follows:

[0123]

[0124] Where Lp is the laser coordinate system with subscript p, F Lp The first frame.

[0125] For the feature point F in the laser frame within the sliding window Li , i belongs to {p, p+1, …, j-1, j}, in the local map ML, find the K nearest non-collinear feature points, use these K feature points to fit a plane, and record the normal vector and intercept of the plane as [n, d]. Then for F Li The residual equation constructed by the feature point is shown in formula (16), which can calculate the relative error of all frames in the sliding window to the first frame F Lp The relative pose of , so that the relative constraint residual equation between two adjacent frames can be obtained as shown in formula (17):

[0126]

[0127]

[0128] Combining the above four constraint factors, the constraint equation can be established as follows:

[0129]

[0130] Among them, r p and Σ p It is the residual and corresponding covariance of the prior information obtained after edge operation of the laser frame or camera frame in the sliding window. The corresponding factor graph is as follows Fig. 9 As shown, by performing nonlinear optimization on formula (18), the pose of multi-sensor information fusion based on sliding window optimization can be obtained.

[0131] Step 208: construct a visual word bag library, and use the visual word bag library to process the current frame and the key frame to obtain a loop frame corresponding to the current frame.

[0132] For the camera data of the key frame, based on the feature points extracted and descriptors calculated during the positioning process, new feature points are further extracted and the corresponding descriptors are calculated. The feature points and descriptors of the key frame are saved in the key frame database without the need to save the original image data, thereby reducing memory usage.

[0133] During the positioning process, the current frame and the camera frame in the key frame database are used to find the corresponding loop frame through the DBOW2 (Bags of binary words for fast place recognition in image sequence) method.

[0134] Step 209: establishing data association between feature points in the current frame and feature points in the loop-closure frame; and removing outliers from feature points in the current frame and feature points in the loop-closure frame using epipolar geometry constraints.

[0135] Data association is established through feature points on the current frame and the loop frame, and then outliers are removed through epipolar geometry constraints.

[0136] Step 210: Use the current frame and the closed-loop frame to construct a visual loop constraint factor, and jointly optimize the prior constraint factor, unstructured visual constraint factor, IMU pre-integration constraint factor and visual loop constraint factor in the sliding window to obtain a corrected pose.

[0137] The visual loop constraint factor is constructed using the current frame and the closed-loop frame. By jointly optimizing the prior constraint factor, IMU pre-integration constraint factor, unstructured feature visual constraint factor and visual loop constraint factor in the sliding window, the jointly optimized robot posture is obtained, which makes the positioning accuracy higher and the trajectory smoother.

[0138] After the above joint optimization, the laser point cloud data closest to the moment of the current image frame and the moment of the corresponding closed-loop frame are found respectively; the pose of the latest laser point cloud data is predicted by using the pose of the current image frame and the IM observation data between the current image frame and the latest laser point cloud data; then the two frames of the latest laser point cloud data are matched by the implicit moving least squares (IMLS-ICP) method to obtain the relative pose of the current frame and the closed-loop frame.

[0139] Further, the IMLS-ICP matching process is as follows:

[0140] A) For the point cloud in the reference frame laser point cloud data, the curvature and normal vector of each point cloud are calculated respectively, and the laser point cloud data with better structure is selected. Specifically, the smaller the curvature and the better the consistency of the normal vector, the better the structure.

[0141] B) Find the set P in the reference frame that is closest to the point cloud x of the current frame k , for the point cloud set P k Any point p in i , and its corresponding normal vector is denoted by n i , for the point cloud x of the current frame, its height from the hidden surface in the reference frame is I PK (x), I PK The calculation formula for (x) is as follows:

[0142]

[0143] Among them, the weight Wi The calculation formula for (x) is as follows:

[0144]

[0145] Among them, h is the specified threshold, which represents the maximum distance between the point of the current frame and the surface of the reference frame.

[0146] C) Let P k Center point x i The normal vector of the nearest point is n i , then point x i Projection y on the surface i for:

[0147]

[0148] D) By matching point x i and projection y i , solve the relative pose between the current frame and the reference frame:

[0149] ∑((Rx i +ty i )·n i ) 2 (twenty two)

[0150] Among them, R is the rotation matrix and t is the translation vector.

[0151] Through the above matching, a more accurate relative pose of the current frame and the closed-loop frame can be obtained, and the corresponding factor graph is as follows: Fig.10 As shown, block 101 is a closed-loop detection constraint.

[0152] The loop detection scheme adopted in this embodiment, based on finding the loop frame of the current frame based on traditional DBOW2 and calculating the current frame relative to the loop frame, improves the relative pose estimation of the current frame and the loop frame through matching of laser point cloud data and IMU observation data, and adds the relative pose of the laser moment closest to the current frame and the loop frame to the closed-loop detection joint optimization equation, thereby improving the accuracy of closed-loop detection, further reducing the cumulative error of the system, and improving the positioning accuracy and smoothness of the system.

[0153] Step 211: Perform global pose optimization on the corrected pose to obtain globally consistent pose information.

[0154] a) For the camera frame in the sliding window, a relative constraint relationship can be established between the camera key frame and its adjacent four historical camera key frames and two adjacent historical laser frames; for the laser frame, a relative constraint relationship can be established between the laser frame and its adjacent four historical camera key frames and two adjacent historical laser frames. The corresponding relative observation information is as follows:

[0155]

[0156] All the variables on the right side of the equal sign in the above formula are known, and they are the poses obtained through sliding window joint optimization; the values ​​on the left side of the equal sign are used as observation values ​​in the subsequent global pose graph optimization; when the camera key frame or laser frame comes out from the inner edge of the sliding window, its associated sequence edges and corresponding nodes are added to the global pose graph (GPG, Global Pose Graph).

[0157] b) When a frame of laser data or a camera key frame is marginalized, if the laser frame or camera frame has a corresponding closed-loop frame, relative pose constraint information is added between the laser frame or camera key frame and the corresponding closed-loop frame and added to the GPG as a closed-loop edge. The relative constraint relationship is expressed as shown in formula (23).

[0158] The residual equation between two nodes with relative constraints in GPG is as follows:

[0159]

[0160] In the above formula, the quantity to be determined is ψ j and ψ i , is the translation of the robot's posture at time j, is the translation of the robot posture at time i, ψ j and ψ i are the yaw angles of the robot posture corresponding to time j and time i respectively.

[0161] The cost function composed of all the sequence edges and loop detection edges in the pose graph is shown in formula (25). In order to reduce the impact of false loop closures, a kernel function is added to the closed loop residual term as follows:

[0162]

[0163] Among them, S represents the set of all adjacent frame sequence edges, lo represents the set of all loop edges, and r ij is the relative constraint residual term corresponding to the two-frame pose, corresponding to formula (24), and the factor graph corresponding to the optimization of the entire global pose graph is as follows Fig.11 shown.

[0164] This embodiment integrates IMU, binocular camera and 3D laser data to estimate the posture of the mobile robot. First, the posture of the robot at the time of image acquisition or 3D laser data acquisition is estimated based on the IMU observation data. At the same time, in the process of collecting 3D laser data, the IMU observation data is used to perform motion distortion removal to obtain dedistorted laser data. Then, for the 3D laser data, line features or surface features are extracted to construct a local map, and the current frame and the local map are matched to estimate the posture at the time of 3D laser acquisition. In the process of binocular camera data acquisition, feature points on the left camera are extracted, LKT feature points of the front and rear image frames and LKT feature points of the left and right cameras are tracked, and external points are eliminated through the left and right epipolar geometry constraints and the 2-point RANSAC method of the front and rear frames, the tracked feature points are triangulated, and the constraints of the camera and the 3D points are converted into unstructured visual constraints between common-view cameras, so that the landmark points associated with the camera frames do not need to be To participate in the joint optimization, the number of optimization variables is greatly reduced, and the optimization efficiency is improved; then, based on the sliding window method, the prior constraint factor, unstructured visual constraint factor, IMU pre-integration constraint factor and laser matching constraint factor are combined to construct a joint optimization equation, and the constraints of IMU, camera and 3D lidar are linked together in a tight coupling manner, so that the solved robot's pose accuracy is more accurate, which can improve the positioning accuracy of the algorithm; then loop detection is performed, and candidate frames are first detected and eliminated by the visual DBOW2 method, and the relative pose between loop frames is preliminarily calculated, and then the corresponding loop detection accuracy is further improved by matching the laser point cloud data of the corresponding frames, eliminating the accumulated error of the system, and further improving the positioning accuracy and trajectory smoothness of the algorithm; finally, adjacent sequence edges and loop edge constraints are added between all nodes, added to the global pose graph, and the oldest closed-loop edge is fixed, and the global pose joint optimization is performed to obtain a globally consistent pose.

[0165] See also Fig.12 , Fig.12 It is a structural diagram of an embodiment of a positioning device based on multi-sensor fusion provided in the present application. The positioning device based on multi-sensor fusion 120 includes a memory 121 and a processor 122 connected to each other. The memory 121 is used to store a computer program. When the computer program is executed by the processor 122, it is used to implement the positioning method based on multi-sensor fusion in the above embodiment.

[0166] Compared with the traditional visual inertial system, the device provided in this embodiment integrates 3D laser information, and combines the IMU pre-integration constraint factor, the unstructured visual constraint factor and the laser matching constraint factor in a tightly coupled manner to improve the positioning accuracy of the system; compared with the traditional 3D laser and inertial navigation system, the addition of visual information can improve the robustness of the algorithm in a laser-degraded environment; and in the positioning process, by counting the number of feature points in the current camera frame or the current laser frame, the residual of the camera constraint and the laser matching constraint is adaptively modified, thereby changing the effect of the camera constraint or the laser matching constraint on the positioning The impact of the results; in addition, in the loop detection link, on the basis of finding the closed-loop frame based on the bag-of-words model and solving the relative pose between the current frame and the closed-loop frame, the calculation accuracy of the relative pose of the current camera frame and the closed-loop frame is improved through the IMLS-ICP matching algorithm of the 3D laser and the IMU information between the corresponding laser frame and the camera frame; at the same time, for the camera frames that can find the closed-loop frame, the nearest laser frames are found for IMLS-ICP matching, and the relative constraint relationship of the corresponding laser frame is obtained and added to the closed-loop detection constraint, thereby further reducing the cumulative error and improving the positioning accuracy and trajectory smoothness of the algorithm.

[0167] See also Fig.13 , Fig.13 It is a structural diagram of an embodiment of a computer-readable storage medium provided in the present application. The computer-readable storage medium 130 is used to store a computer program 131. When the computer program 131 is executed by a processor, it is used to implement the positioning method based on multi-sensor fusion in the above embodiment.

[0168] The computer-readable storage medium 130 may be a server, a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media that can store program codes.

[0169] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only illustrative, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0170] 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 present embodiment.

[0171] 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0172] The above are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A positioning method based on multi-sensor fusion, characterized in that: include: Acquire image data, IMU observation data and laser point cloud data; A constraint equation is constructed by combining a priori constraint factors, unstructured vision constraint factors, IMU pre-integration constraint factors and laser matching constraint factors to obtain the position and posture of the robot, wherein the priori constraint factors are error constraint factors corresponding to the laser point cloud data or the IMU observation data, the unstructured vision constraint factors are error constraint factors corresponding to the image data, the IMU pre-integration constraint factors are error constraint factors corresponding to the IMU observation data, and the laser matching constraint factors are error constraint factors corresponding to the laser point cloud data; Correcting the posture of the robot by using loop closure detection to obtain a corrected posture; Performing global posture optimization on the corrected posture to obtain globally consistent posture information; The step of obtaining the laser matching constraint factor includes: The relative poses of all laser point cloud data frames in the sliding window relative to the first laser point cloud data frame in the sliding window are calculated to obtain a relative constraint residual equation between two adjacent laser point cloud data frames; and the relative constraint residual equation is used as the laser matching constraint factor.

2. The positioning method based on multi-sensor fusion according to claim 1, characterized in that: The image data includes a plurality of image frames, wherein the image frames include a left-eye image frame acquired by a left-eye camera and a right-eye image frame acquired by a right-eye camera, and the method further includes: Extracting features from the left-eye image frame to generate left-eye feature points; Using the left eye feature points, obtaining the right eye feature points in the right eye image frame at the same time; Processing the left eye feature points and the corresponding right eye feature points to remove the external points in the left eye image frame and the external points in the right eye image frame; Feature tracking is performed on the previous and next frames of IMU observation data to remove external points in the previous image frame.

3. The positioning method based on multi-sensor fusion according to claim 2, characterized in that: The step of using the left eye feature points to obtain the right eye feature points in the right eye image frame at the same time comprises: Using the left eye feature point to perform left and right eye stereo matching to obtain the right eye feature point, and using the right eye feature point as an initial value for optical flow tracking; Perform optical flow tracking to obtain left eye tracking feature points and right eye tracking feature points; Processing the left-eye feature points in the left-eye image frame and the right-eye feature points in the right-eye image frame to filter out the external points in the left-eye image frame and the external points in the right-eye image frame; Respectively obtain the normalized coordinates of the left eye tracking feature point and the right eye tracking feature point in the corresponding camera coordinate system to obtain the left eye coordinate and the right eye coordinate; An essential matrix is ​​constructed using the extrinsic parameters of the left camera and the right camera, and external points are eliminated using epipolar geometry constraints to obtain remaining feature points; The left-eye image frame and the right-eye image frame are divided into a first preset number of grids, and the remaining feature points are divided into corresponding grids, wherein the number of feature points in each of the grids is less than a second preset number.

4. The positioning method based on multi-sensor fusion according to claim 3 is characterized in that: The step of removing external points by using epipolar geometric constraints comprises: Determine whether the product of the left eye coordinate, the essential matrix and the right eye coordinate corresponding to each feature point is greater than a preset value; If so, the feature point is the external point.

5. The positioning method based on multi-sensor fusion according to claim 2, characterized in that: The step of performing feature tracking on the previous and next frames of IMU observation data to remove external points in the previous image frame includes: Using the two frames of IMU observation data, the relative posture of the previous image frame relative to the current image frame is obtained; Predicting pixel coordinates of the current image frame using pixel coordinates in the previous image frame and the relative posture; Using the pixel coordinates of the current image frame as the initial values ​​of optical flow tracking of the previous and next frames, performing optical flow tracking, and obtaining left eye tracking feature points and right eye tracking feature points in the current image frame; Performing stereo matching on the left eye tracking feature points and the right eye tracking feature points to filter out external points in the previous image frame; The left eye image frame and the right eye image frame in the two preceding and succeeding image frames are processed respectively to filter out the external points in the preceding image frame.

6. The positioning method based on multi-sensor fusion according to claim 5, characterized in that: The method further comprises: When the number of feature points in the current image frame is less than a third preset number, extracting features from the current image frame to obtain new left-eye feature points; Performing stereo matching on the new left eye feature points to obtain new right eye feature points; Performing stereo matching on the new left eye feature points and the new right eye feature points to filter out the outliers and obtain newly added left eye feature points and newly added right eye feature points; The newly added left-eye feature points are added to the grid corresponding to the left-eye image frame, and the newly added right-eye feature points are added to the grid corresponding to the right-eye image frame.

7. The positioning method based on multi-sensor fusion according to claim 1, characterized in that: The method further comprises: Performing a de-distortion processing on the laser point cloud data to extract line feature points or surface feature points in the de-distorted laser point cloud data; Constructing a local map using the line feature points or the surface feature points; The laser point cloud data of the current frame is matched with the local map to estimate the position and posture of the laser point cloud data at the time of acquisition.

8. The positioning method based on multi-sensor fusion according to claim 7, characterized in that: The step of performing a de-distortion process on the laser point cloud data comprises: Using the IMU observation data, predict the position and posture of the k-th frame of the laser point cloud data at the end of acquisition; The pose corresponding to the laser point cloud data at the current moment is calculated using the pose of the laser point cloud data at the end of acquisition, the start time of acquisition of the k-th frame of the laser point cloud data, the end time of acquisition of the k-th frame of the laser point cloud data, and the current moment.

9. The positioning method based on multi-sensor fusion according to claim 7, characterized in that: The step of extracting line feature points or surface feature points from the dedistorted laser point cloud data comprises: Calculating the curvature between each laser point in the dedistorted laser point cloud data and a laser point at a preset distance from the laser point; The laser points whose curvature is smaller than the preset curvature are taken as surface feature points.

10. The positioning method based on multi-sensor fusion according to claim 1, characterized in that: The method further comprises: The IMU observation data and the posture at the previous moment are processed by using the median integral method to estimate the posture at the current moment, and the posture at the current moment is used as the initial posture value; The posture of the robot is obtained by using the initial posture value and the constraint equation.

11. The positioning method based on multi-sensor fusion according to claim 1, characterized in that: The step of correcting the posture of the robot by using loop closure detection to obtain a corrected posture comprises: Constructing a visual word bag library, and using the visual word bag library to process the current frame and the key frame to obtain a loop frame corresponding to the current frame; Establishing data association by using feature points in the current frame and feature points in the loop frame; Using epipolar geometry constraints to remove outliers from feature points in the current frame and feature points in the loopback frame; The visual loop constraint factor is constructed using the current frame and the loop frame, and the prior constraint factor, the unstructured visual constraint factor, the IMU pre-integration constraint factor and the visual loop constraint factor in the sliding window are jointly optimized to obtain the corrected pose.

12. The positioning method based on multi-sensor fusion according to claim 11, characterized in that: The method further comprises: Find the laser point cloud data closest to the time of the current image frame and the time of the corresponding loop frame respectively; Predicting the pose of the most recent laser point cloud data by using the pose of the current image frame and IMU observation data between the current image frame and the most recent laser point cloud data; The laser point cloud data of the two most recent frames are matched to obtain the relative pose of the current frame and the loop frame.

13. A positioning device based on multi-sensor fusion, characterized in that: It comprises a memory and a processor connected to each other, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the positioning method based on multi-sensor fusion according to any one of claims 1 to 12.

14. A computer-readable storage medium for storing a computer program, characterized in that: When the computer program is executed by a processor, it is used to implement the positioning method based on multi-sensor fusion according to any one of claims 1 to 12.