Skip to content
/ PV-LIO Public
forked from HViktorTsoi/PV-LIO

A probabilistic voxelmap-based LiDAR-Inertial Odometry.

License

Notifications You must be signed in to change notification settings

redheli/PV-LIO

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PV-LIO

PV-LIO is a probabilistic voxelmap-based LiDAR-Inertial Odometry. It fuses LiDAR feature points with IMU data using IKFoM to allow robust navigation in fast-motion or narrow environments where degeneration occurs. PV-LIO also supports online LiDAR-IMU extrinsic estimation.

We utilize VoxelMap as the Local Map manager of PV-LIO, it calculates the covariance of each <LiDAR point,planar feature> correspondence according to the LiDAR ranging model and uses it as confidence ratio to guide the update of KF. This enables robust pose estimation in degenerated scenarios such as narrow staircases. We derive the covariance propagation incorporating the LiDAR-IMU extrinsic parameters, enabling state estimation with IMU and online LiDAR-IMU calibration. We also implement a parallel-optimized map update module, which allows for a more efficient map update than the original implementation of VoxelMap.

Some test results are shown below:

Visualization of voxelmap with uncertainty (Hilti 2022 exp11)

Narrow Environment Test

Left: Robosense RS16, staircase_crazy_rotation dataset

Right: Livox AVIA, long_tunnel dataset

Hilti 2022 exp11

Hilti 2022 exp15

Hilti 2022 exp03

Update

  • 2023.07.18: Fix eigen failed error for Ubuntu 20.04.

1. Prerequisites

1.1 Ubuntu and ROS

Ubuntu >= 16.04

For Ubuntu 18.04 or higher, the default PCL and Eigen is enough for PV-LIO to work normally.

ROS >= Melodic. ROS Installation

1.2. PCL && Eigen

PCL >= 1.8, Follow PCL Installation.

Eigen >= 3.3.4, Follow Eigen Installation.

1.3. livox_ros_driver

Follow livox_ros_driver Installation.

Remarks:

  • The livox_ros_driver must be installed and sourced before run any PV-LIO launch file.
  • How to source? The easiest way is add the line source $Livox_ros_driver_dir$/devel/setup.bash to the end of file ~/.bashrc, where $Livox_ros_driver_dir$ is the directory of the livox ros driver workspace (should be the ws_livox directory if you completely followed the livox official document).

2. Build

Clone the repository and catkin_make:

    cd ~/$A_ROS_DIR$/src
    git clone https://github.com/hviktortsoi/PV_LIO.git
    cd PV_LIO
    cd ../..
    catkin_make
    source devel/setup.bash
  • Remember to source the livox_ros_driver before build (follow 1.3 livox_ros_driver)
  • If you want to use a custom build of PCL, add the following line to ~/.bashrc export PCL_ROOT={CUSTOM_PCL_PATH}

3. Directly run

Noted:

A. Please make sure the IMU and LiDAR are Synchronized, that's important.

B. The warning message "Failed to find match for field 'time'." means the timestamps of each LiDAR points are missed in the rosbag file. That is important for the forward propagation and backwark propagation.

3.1 For Livox Avia

Connect to your PC to Livox Avia LiDAR by following Livox-ros-driver installation, then

    cd ~/$PV_LIO_ROS_DIR$
    source devel/setup.bash
    roslaunch pv_lio mapping_avia.launch
    roslaunch livox_ros_driver livox_lidar_msg.launch
  • For livox serials, PV-LIO only support the data collected by the livox_lidar_msg.launch since only its livox_ros_driver/CustomMsg data structure produces the timestamp of each LiDAR point which is very important for the motion undistortion. livox_lidar.launch can not produce it right now.
  • If you want to change the frame rate, please modify the publish_freq parameter in the livox_lidar_msg.launch of Livox-ros-driver before make the livox_ros_driver pakage.

3.2 For Livox serials with external IMU

mapping_avia.launch theratically supports, mid-70, mid-40 or other livox serial LiDAR, but need to setup some parameters befor run:

Edit config/avia.yaml to set the below parameters:

  1. LiDAR point cloud topic name: lid_topic
  2. IMU topic name: imu_topic
  3. Translational extrinsic: extrinsic_T
  4. Rotational extrinsic: extrinsic_R (only support rotation matrix)
  • The extrinsic parameters in PV-LIO is defined as the LiDAR's pose (position and rotation matrix) in IMU body frame (i.e. the IMU is the base frame). They can be found in the official manual.
  • PV-LIO produces a very simple software time sync for livox LiDAR, set parameter time_sync_en to ture to turn on. But turn on ONLY IF external time synchronization is really not possible, since the software time sync cannot make sure accuracy.

3.3 For Velodyne or Ouster (Velodyne as an example)

Step A: Setup before run

Edit config/velodyne.yaml to set the below parameters:

  1. LiDAR point cloud topic name: lid_topic
  2. IMU topic name: imu_topic (both internal and external, 6-aixes or 9-axies are fine)
  3. Line number (we tested 16, 32 and 64 line, but not tested 128 or above): scan_line
  4. Translational extrinsic: extrinsic_T
  5. Rotational extrinsic: extrinsic_R (only support rotation matrix)
  • The extrinsic parameters in PV-LIO is defined as the LiDAR's pose (position and rotation matrix) in IMU body frame (i.e. the IMU is the base frame).

Step B: Run below

    cd ~/$PV_LIO_ROS_DIR$
    source devel/setup.bash
    roslaunch pv_lio mapping_velodyne.launch

Step C: Run LiDAR's ros driver or play rosbag.

3.4 For Robosense, Hesai, etc. (Robosense as an example)

Step A: Setup before run

Edit launch/mapping_robosense.launch, find and modify the following line:

<remap from="/rslidar_points" to="/your_lidar_topic"/>

Fill /your_lidar_topic with your actual LiDAR topic name.

Step B: Edit config/robosense.yaml to set the below parameters:

  1. IMU topic name: imu_topic (both internal and external, 6-aixes or 9-axies are fine)
  2. Line number (we tested 16, 32 and 64 line, but not tested 128 or above): scan_line
  3. Translational extrinsic: extrinsic_T
  4. Rotational extrinsic: extrinsic_R (only support rotation matrix)
  • The extrinsic parameters in PV-LIO is defined as the LiDAR's pose (position and rotation matrix) in IMU body frame (i.e. the IMU is the base frame).

Step C: Run below

    cd ~/$PV_LIO_ROS_DIR$
    source devel/setup.bash
    roslaunch pv_lio mapping_robosense.launch

Step C: Run LiDAR's ros driver or play rosbag.

4. Rosbag Example

4.1 Robosense 16 Rosbag

Files: Can be downloaded from Baidu Pan (password:4kpf) or Google Drive

Run:

roslaunch pv_lio mapping_robosense.launch
cd YOUR_BAG_DOWNLOADED_PATH
rosbag play *.bag

Important: The 3 bags are from the same dataset sequence, so they should be play sequentially, rather than be played alone.

Related Works

  1. VoxelMap: An efficient and probabilistic adaptive voxel mapping method for LiDAR odometry.
  2. FAST-LIO: A computationally efficient and robust LiDAR-inertial odometry (LIO) package
  3. FAST-LIO_LOCALIZATION: A simple localization framework that can re-localize in built point cloud maps.
  4. IKFoM: A computationally efficient and convenient toolkit of iterated Kalman filter.

Acknowledgments

Thanks a lot for the authors of VoxelMap, IKFoM and FAST-LIO;

Thanks to Xiaokai for his help with deriving the covariance propagation.

TBD

  1. Handle conditions where nMeasurements < nDof;
  2. Migrate constant velocity example from VoxelMap to support Pure LiDAR odometry;
  3. Optimize comments and docs, make them more readable;
  4. Improve the efficiency of voxel map visualization;
  5. Publish covariance of points for visualization;

About

A probabilistic voxelmap-based LiDAR-Inertial Odometry.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 97.3%
  • MATLAB 1.2%
  • Other 1.5%