SLAM——LIO-SAM
Lio-sam: https://github.com/TixiaoShan/LIO-SAM
Lio-sam has a similar code structure with A-LOAM (more similar to LeGO-LOAM, but without ground points). However, they are very different. A-LOAM doesn’t have a pose graph optimization in back-end. It uses current scan to matching the global map, which can lead to drift over a long distance scanning. LIO-SAM uses a lidar-IMU odometry, and it adopts a factor graph for multi-sensor fusion and global optimization. If you want to fuse other sensors it would be much easier. Also, it supports loop closure detection.
From the demo (https://www.youtube.com/watch?v=A0H8CoORZJU), we could see that LIO-SAM is really robust to arbitrary rotation and has high localization accuracy. At any time, the robot state can be formulated as:
is the rotation matrix, is the position, is the speed and is the IMU bias.
There are 4 types of factors in LIO-SAM: (a) IMU preintegration factors, (b) lidar odometry factors,(c) GPS factors, and (d) loop closure factors.
We denote the world frame as and the robot body frame as . is the transformation from world
IMU Preintegration
IMU will provide angular velocity and acceleration:
where (angular velocity) and (acceleration) are the raw IMU measurements in at time and are bias and white noise respectively. is the rotation matrix from to . is the constant gravity vector in . And based on those measurements we could infer the motion of robot. The velocity, position and rotation of the robot at time can be computed as follows:
where . The IMU preintegrated measurements between time and can be computed as following (Apparently, is not ):
See https://arxiv.org/pdf/1512.02363.pdf for detailed derivation.
Lidar Odometry
The lidar odometry in LIO-SAM is similar to Lego-LOAM or A-LOAM. The difference is LIO-SAM adopt keyframe strategy. When a new keyframe is registered, it will associate with a new robot state node in the factor graph. The lidar frames between two keyframes will be discarded (Note that the position and rotation change thresholds for adding a new keyframe in LIO-LOAM are and $10\degree$ respectively). The generation of a lidar odometry factor is described in the following step:
- Sub-keyframes for voxel map. Organize most recent keframes as a sub-keyframes and combines their scans as a voxel map , which includes edge feature voxel map and plane feature voxel map . Note that will be down-sampled to remove duplicated features.
- Scan-matching. A new keyframe will be matched to . The initial transformation is estimated through IMU. The matching process is similar to A-LOAM’s lidar mapping module.
GPS
System will still suffer from drift during long-distance navigation tasks. GPS is useful for correcting this long-distance-error. In LIO-SAM, a GPS factor is only added when the estimated position covariance is larger that the received GPS position covariance.
Loop Closure
LIO-SAM use a naive but effective method for loop closure detection based on the Euclidean distance. When a new node is registered, we search for the near nodes from the factor graph. For example, is selected, and we match with the subkeframe voxel map . If the matching succeed, a relative transformation will be added into fact graph as a loop closure factor. In LIO-SAM, and the search radius is .