------------------- Update Date: 2022-11-20 -------------------
This version has removed the feature extraction module, making it easier to adapt to different lidars;
Support 'robosense' lidar and Mulran datasets, make the following changes in "*.yaml":
Support 6-axis IMU, make the following changes in "*.yaml":
Support low frequency IMU(50HZ、100HZ), make the following changes in "*.yaml":
------------------- Update Date: 2022-12-13 -------------------
------------------- Update Date: 2022-12-24 -------------------
Modified gps factor, no longer depending on the 'robot_localization' package, and make it easier to adapt to different gnss device(RTK/GPS).
The gps factor is modified to make it easier to adapt to gnss devices with different frequencies(10HZ~500HZ).
------------------- Update Date: 2023-02-11 -------------------
Add scancontext loop closure detection;
Support M2DGR dataset.
------------------- Update Date: 2024-04-29 -------------------
Blog:LIO-SAM:配置环境、安装测试、适配自己采集数据集
Video:基于LIO-SAM框架SLAM算法开发系列视频
sudo add-apt-repository ppa:borglab/gtsam-release-4.0
sudo apt install libgtsam-dev libgtsam-unstable-dev
sudo apt install libgeographic-dev
mkdir -p ~/liorf/src && cd ~/liorf/src
git clone https://github.com/YJZLuckyBoy/liorf.git
cd ..
catkin_make
Run the launch file
source devel/setup.bash
roslaunch liorf run_kitti.launch
Play existing bag files
rosbag play kitti_2011_09_30_drive_0018_synced.bag
Make sure your gnss topic type is 'sensor_msgs::NavSatFix';
Modify 'gpsTopic' paramter in '*.yaml' with yourself gnss topic;
gpsTopic: "gps/fix" # GPS topic
If you want to use liorf with integrated gps factor in kitti dataset, you can use the modified python script in "config/doc/kitti2bag" to obtain high-frequency gps data(Rate: 100HZ, Topic: '/gps/fix/correct'). About how to use "kitti2bag.py", please refer to doc/kitti2bag.
For more details, please check the demo video: 基于LIO-SAM框架SLAM算法开发(六):建图之快速适配多雷达及GNSS设备
lio-sam dataset
M2DGR dataset
kitti-05 dataset
ubran_hongkong dataset
MulRan dataset
Multiple Lidar
r3live dataset
MulRan
Kitti 01
Kitti 05
Thanks for LIO-SAM, FAST_LIO2, UrbanNavDataset, M2DGR and MulRanDataset.
A real-time lidar-inertial odometry package. We strongly recommend the users read this document thoroughly and test the package with the provided dataset first. A video of the demonstration of the method can be found on YouTube.
Prepare lidar data (must read)
Prepare IMU data (must read)
We design a system that maintains two graphs and runs up to 10x faster than real-time.
This is the original ROS1 implementation of LIO-SAM. For a ROS2 implementation see branch ros2
.
sudo apt-get install -y ros-kinetic-navigation
sudo apt-get install -y ros-kinetic-robot-localization
sudo apt-get install -y ros-kinetic-robot-state-publisher
sudo add-apt-repository ppa:borglab/gtsam-release-4.0
sudo apt install libgtsam-dev libgtsam-unstable-dev
Use the following commands to download and compile the package.
cd ~/catkin_ws/src
git clone https://github.com/TixiaoShan/LIO-SAM.git
cd ..
catkin_make
Build image (based on ROS1 Kinetic):
docker build -t liosam-kinetic-xenial .
Once you have the image, start a container as follows:
docker run --init -it -d \
-v /etc/localtime:/etc/localtime:ro \
-v /etc/timezone:/etc/timezone:ro \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$DISPLAY \
liosam-kinetic-xenial \
bash
The user needs to prepare the point cloud data in the correct format for cloud deskewing, which is mainly done in "imageProjection.cpp". The two requirements are:
IMU requirement. Like the original LOAM implementation, LIO-SAM only works with a 9-axis IMU, which gives roll, pitch, and yaw estimation. The roll and pitch estimation is mainly used to initialize the system at the correct attitude. The yaw estimation initializes the system at the right heading when using GPS data. Theoretically, an initialization procedure like VINS-Mono will enable LIO-SAM to work with a 6-axis IMU. The performance of the system largely depends on the quality of the IMU measurements. The higher the IMU data rate, the better the system accuracy. We use Microstrain 3DM-GX5-25, which outputs data at 500Hz. We recommend using an IMU that gives at least a 200Hz output rate. Note that the internal IMU of Ouster lidar is an 6-axis IMU.
IMU alignment. LIO-SAM transforms IMU raw data from the IMU frame to the Lidar frame, which follows the ROS REP-105 convention (x - forward, y - left, z - upward). To make the system function properly, the correct extrinsic transformation needs to be provided in "params.yaml" file. The reason why there are two extrinsics is that my IMU (Microstrain 3DM-GX5-25) acceleration and attitude have different cooridinates. Depend on your IMU manufacturer, the two extrinsics for your IMU may or may not be the same. Using our setup as an example:
q_wb
usually means the rotation of points in the IMU coordinate system to the world coordinate system (e.g. ENU). However, the algorithm requires q_wl
, the rotation from lidar to world. So we need a rotation from lidar to IMU q_bl
, where q_wl = q_wb * q_bl
. For convenience, the user only needs to provide q_lb
as "extrinsicRPY" in "params.yaml" (same as the "extrinsicRot" if acceleration and attitude have the same coordinate).IMU debug. It's strongly recommended that the user uncomment the debug lines in "imuHandler()" of "imageProjection.cpp" and test the output of the transformed IMU data. The user can rotate the sensor suite to check whether the readings correspond to the sensor's movement. A YouTube video that shows the corrected IMU data can be found here (link to YouTube).
Download some sample datasets to test the functionality of the package. The datasets below are configured to run using the default settings:
The datasets below need the parameters to be configured. In these datasets, the point cloud topic is "points_raw." The IMU topic is "imu_correct," which gives the IMU data in ROS REP105 standard. Because no IMU transformation is needed for this dataset, the following configurations need to be changed to run this dataset successfully:
Ouster (OS1-128) dataset. No extrinsics need to be changed for this dataset if you are using the default settings. Please follow the Ouster notes below to configure the package to run with Ouster data. A video of the dataset can be found on YouTube:
Livox Horizon dataset. Please refer to the following notes section for paramater changes.
KITTI dataset. The extrinsics can be found in the Notes KITTI section below. To generate more bags using other KITTI raw data, you can use the python script provided in "config/doc/kitti2bag".
Run the launch file:
roslaunch lio_sam run.launch
Play existing bag files:
rosbag play your-bag.bag -r 3
rosservice call [service] [resolution] [destination]
$ rosservice call /lio_sam/save_map 0.2 "/Downloads/LOAM/"
Zigzag or jerking behavior: if your lidar and IMU data formats are consistent with the requirement of LIO-SAM, this problem is likely caused by un-synced timestamp of lidar and IMU data.
Jumpping up and down: if you start testing your bag file and the base_link starts to jump up and down immediately, it is likely your IMU extrinsics are wrong. For example, the gravity acceleration has negative value.
mapOptimization crash: it is usually caused by GTSAM. Please install the GTSAM specified in the README.md. More similar issues can be found here.
gps odometry unavailable: it is generally caused due to unavailable transform between message frame_ids and robot frame_id (for example: transform should be available from "imu_frame_id" and "gps_frame_id" to "base_link" frame. Please read the Robot Localization documentation found here.
Thank you for citing LIO-SAM (IROS-2020) if you use any of this code.
@inproceedings{liosam2020shan,
title={LIO-SAM: Tightly-coupled Lidar Inertial Odometry via Smoothing and Mapping},
author={Shan, Tixiao and Englot, Brendan and Meyers, Drew and Wang, Wei and Ratti, Carlo and Rus Daniela},
booktitle={IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
pages={5135-5142},
year={2020},
organization={IEEE}
}
Part of the code is adapted from LeGO-LOAM.
@inproceedings{legoloam2018shan,
title={LeGO-LOAM: Lightweight and Ground-Optimized Lidar Odometry and Mapping on Variable Terrain},
author={Shan, Tixiao and Englot, Brendan},
booktitle={IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
pages={4758-4765},
year={2018},
organization={IEEE}
}