LIO-SAM is a framework for tightly-coupled lidar inertial odometry via smoothing and mapping, that
achieves highly accurate, real-time mobile robot trajectory estimation and map-building.
LIO-SAM formulates lidar-inertial
odometry atop a factor graph, allowing a multitude of relative
and absolute measurements, including loop closures, to be
incorporated from different sources as factors into the system.
The estimated motion from inertial measurement unit (IMU)
pre-integration de-skews point clouds and produces an initial
guess for lidar odometry optimization. The obtained lidar
odometry solution is used to estimate the bias of the IMU.
To ensure high performance in real-time, it marginalize old
lidar scans for pose optimization, rather than matching lidar
scans to a global map. Scan-matching at a local scale instead of
a global scale significantly improves the real-time performance
of the system, as does the selective introduction of keyframes,
and an efficient sliding window approach that registers a new
keyframe to a fixed-size set of prior “sub-keyframes.”
Here are some reference links of code and paper:
code link.
paper link.
ubuntu 20.04 、ros-noetic、cmake、gcc、g++、eigen、pcl1.10、gtsam、code、bag .
During the installation of third-party libraries,
there may be many version mismatch issues.
Below are just examples of installation.Please make sure to match the versions,
otherwise compilation will have significant problems.
If there are any issues during the appeal process, please search online to resolve them.
sudo apt-get update
sudo apt-get install git gcc g++ vim make cmake
download Eigen3
cd eigen3
mkdir build && cd build
cmake ..
make
sudo make install
wget -O ~/Downloads/gtsam.zip https://github.com/borglab/gtsam/archive/4.0.3-alpha2.zip
cd ~/Downloads/ && unzip gtsam.zip -d ~/Downloads/
cd ~/Downloads/gtsam-4.0.3-alpha2/
mkdir build && cd build
cmake ..
make
sudo make install
All the necessary components for the algorithm have been installed here, and it is important to ensure the corresponding version relationships, otherwise there will be trouble later.
Clone the repository and catkin_make:
cd ~/catkin_ws/src
git clone https://github.com/TixiaoShan/LIO-SAM.git
cd ../
catkin_make
source ~/catkin_ws/devel/setup.bash
Run the algorithm and play the dataset, in addition to recording the trajectory topic generated by the algorithm. The process of running the algorithm is shown on the screen in Figure 2.
roslaunch lio_sam run.launch
rosbag play night_liosam_traj.bag
rosbag record -o night_liosam_traj.bag /lio_sam/mapping/odometry
First of all, we need to convert the recorded trajectory bag into TUM or txt format for later evaluation using evo. You can use the commands provided with evo to convert to TUM format, or use Python script to convert to txt format.
evo_traj bag night_liosam_traj.bag /lio_sam/mapping/odometry --save_as_tum
python bagtotum.py night_liosam_traj.bag /lio_sam/mapping/odometry liosam_night_tum.txt
And then we use evo_traj evaluates the trajectory and ground truth generated by the algorithm.
evo_traj tum lio_sam_mapping_odometry.tum --ref=gt.txt -va -p
Afterwards, we use evo_ape to evaluate the absolute error between the trajectory generated by the algorithm and the ground truth.
evo_ape tum lio_sam_mapping_odometry.tum gt.txt -a -p
evo_ape tum liosam _night_tum.txt gt.txt -a -p
The results generated by the evaluation trajectory are shown below as Fig3 Trajectory of LIO-SAM and GT. Fig4 APE of LIO-SAM and GT. Fig5 XYZ of LIO-SAM and GT. Fig6 RPY of LIO-SAM and GT.
Fig3. Trajectory of LIO-SAM and GT
Fig4. APE of LIO-SAM and GT
Fig5. XYZ of LIO-SAM and GT
Fig6. RPY of LIO-SAM and GT
We use APE to evaluate the accuracy of the algorithm, calculate the Translation mean, rmse, and Rotation mean, rmse using the evo tool, and divide them by the total distance of gt, using percentage as the final evaluation indicator.The units are m/% and °/%, respectively. We will validate and evaluate all sequences from all platforms using this algorithm and summarize them in the following table:
Platform | Sequence | GT distance | Translation | Rotation | ||||
---|---|---|---|---|---|---|---|---|
mean | rmse | MPE | mean | rmse | MRE | |||
Driving | Urban day | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Urban night | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Urban Tunnel day | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Urban Tunnel night | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Urban Harsh day | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Urban Harsh night | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Urban Highway day | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Urban Highway night | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Platform | Sequence | GT distance | Translation | Rotation | ||||
---|---|---|---|---|---|---|---|---|
mean | rmse | MPE | mean | rmse | MRE | |||
UGV | Street day | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Street night | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Parkway day | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Parkway night | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Elevator | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR 01 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR 02 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR 03 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Platform | Sequence | GT distance | Translation | Rotation | ||||
---|---|---|---|---|---|---|---|---|
mean | rmse | MPE | mean | rmse | MRE | |||
drone | Garden day | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Garden night | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Landfill day | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Landfill night | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Field translation | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Field rotation | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR 01 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR 02 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR 03 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR 04 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR 05 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Platform | Sequence | GT distance | Translation | Rotation | ||||
---|---|---|---|---|---|---|---|---|
mean | rmse | MPE | mean | rmse | MRE | |||
Handheld | Garden day | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Garden night | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Building day | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Building night | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Elevator | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Escalator | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR 01 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR 02 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR 03 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR translation 01 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR translation 02 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR rotation 01 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR rotation 02 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
MCR flip series | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Platform | Sequence | GT distance | Translation | Rotation | ||||
---|---|---|---|---|---|---|---|---|
mean | rmse | MPE | mean | rmse | MRE | |||
Quadruped | hku canteen day | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
hku canteen night | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
hku garden day | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
hku garden night | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
hku forest day | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
hku mountain day | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
hku mainbuilding day | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
hku mainbuilding night | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
hku MCR 01 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
hku MCR 02 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |