In this we add madgwick filter for IMU processing and sensor fusion, extra script and configuration files to quickly run the experiments on NTU VIRAL dataset.
I modified a little, delete the livox code to get rid of those extra driver dependences:
-
ROS noetic desktop-full, Ubuntu 20.04
-
glog, gflag: for debug, install it quickly with command here:
# maybe need sudo password if you are running it in your desktop curl -sL https://raw.githubusercontent.com/Kin-Zhang/Kin-Zhang/main/Dockerfiles/installGlog_ownenv.sh | bash # option!! for docker env or already root autho curl -sL https://raw.githubusercontent.com/Kin-Zhang/Kin-Zhang/main/Dockerfiles/setup_lib.sh | bash
-
ffmpeg: if you want to run the script and record things
sudo apt-get install ffmpeg
mkdir $HOME/workspace/flivis/src && cd $HOME/workspace/flivis/src
git clone https://github.com/allenthreee/FLiVIS.git
cd FLiVIS
git submodule update --init
cd ../..
catkin_make
# select what terminal you use
source devel/setup.zsh # source devel/setup.bash
We use livox mid-360 in our experiments: Download livox_ros_driver2, cmake and build it first, then launch the livox lidar.
roslaunch flivis mapping_mid360.launch
[Please check the official fast-lio repo or below origin read for more detail]
Download any seq you want in NTU VIRAL dataset. Extract it and copy the path
roslaunch flivis mapping_NTUviral.launch bag_file:="/home/kin/bags/ntu_viral/eee_01/eee_01.bag"
You will see the pop up rviz window like this one:
There are several changed need be done based on your own env:
source /home/$USER/workspace/flivis_ws/devel/setup.bash # TODO: Please change this one based on your env
export EPOC_DIR=/home/$USER/bags/results/ntuviral_fastlio # TODO: Please change this one based on your env
export DATASET_LOCATION=/home/$USER/bags/ntu_viral/ # TODO: Please change this one based on your env
With all paths correct, please directly run the scripts:
cd /home/kin/workspace/flivis_ws/src/flivis/launch/scripts
chmod +x *
./runall_ntuviral.sh
And it will automatically run all seq in the scripts, please check/comment something if you want to change in the scripts: runall_ntuviral.sh
results table here, others result directly copy from NTUViral Dataset Paper: IJRR 2021, arxiv link
Dataset | VINSFusion | LIOSAM | MLOAM | VIRALSLAM | FASTLIO* |
---|---|---|---|---|---|
eee_01 | 0.608 | 0.075 | 0.249 | 0.060 | 0.131 |
eee_02 | 0.506 | 0.069 | 0.166 | 0.058 | 0.124 |
eee_03 | 0.494 | 0.101 | 0.232 | 0.037 | 0.163 |
nya_01 | 0.397 | 0.076 | 0.123 | 0.051 | 0.122 |
nya_02 | 0.424 | 0.090 | 0.191 | 0.043 | 0.142 |
nya_03 | 0.787 | 0.137 | 0.226 | 0.032 | 0.144 |
sbs_01 | 0.508 | 0.089 | 0.173 | 0.048 | 0.142 |
sbs_02 | 0.564 | 0.083 | 0.147 | 0.062 | 0.140 |
sbs_03 | 0.878 | 0.140 | 0.153 | 0.054 | 0.133 |
SLAM:
- ikd-Tree: A state-of-art dynamic KD-Tree for 3D kNN search.
- R2LIVE: A high-precision LiDAR-inertial-Vision fusion work using FAST-LIO as LiDAR-inertial front-end.
- LI_Init: A robust, real-time LiDAR-IMU extrinsic initialization and synchronization package..
- FAST-LIO-LOCALIZATION: The integration of FAST-LIO with Re-localization function module.
Control and Plan:
- IKFOM: A Toolbox for fast and high-precision on-manifold Kalman filter.
- UAV Avoiding Dynamic Obstacles: One of the implementation of FAST-LIO in robot's planning.
- UGV Demo: Model Predictive Control for Trajectory Tracking on Differentiable Manifolds.
- Bubble Planner: Planning High-speed Smooth Quadrotor Trajectories using Receding Corridors.
FAST-LIO (Fast LiDAR-Inertial Odometry) is a computationally efficient and robust LiDAR-inertial odometry package. It fuses LiDAR feature points with IMU data using a tightly-coupled iterated extended Kalman filter to allow robust navigation in fast-motion, noisy or cluttered environments where degeneration occurs. Our package address many key issues:
- Fast iterated Kalman filter for odometry optimization;
- Automaticaly initialized at most steady environments;
- Parallel KD-Tree Search to decrease the computation;
Related video: FAST-LIO2, FAST-LIO1
Pipeline:
New Features:
- Incremental mapping using ikd-Tree, achieve faster speed and over 100Hz LiDAR rate.
- Direct odometry (scan to map) on Raw LiDAR points (feature extraction can be disabled), achieving better accuracy.
- Since no requirements for feature extraction, FAST-LIO2 can support many types of LiDAR including spinning (Velodyne, Ouster) and solid-state (Livox Avia, Horizon, MID-70) LiDARs, and can be easily extended to support more LiDARs.
- Support external IMU.
- Support ARM-based platforms including Khadas VIM3, Nivida TX2, Raspberry Pi 4B(8G RAM).
Related papers:
FAST-LIO2: Fast Direct LiDAR-inertial Odometry
FAST-LIO: A Fast, Robust LiDAR-inertial Odometry Package by Tightly-Coupled Iterated Kalman Filter
Contributors
Wei Xu 徐威,Yixi Cai 蔡逸熙,Dongjiao He 贺东娇,Fangcheng Zhu 朱方程,Jiarong Lin 林家荣,Zheng Liu 刘政, Borong Yuan
Ubuntu >= 16.04
For Ubuntu 18.04 or higher, the default PCL and Eigen is enough for FAST-LIO to work normally.
ROS >= Melodic. ROS Installation
PCL >= 1.8, Follow PCL Installation.
Eigen >= 3.3.4, Follow Eigen Installation.
Follow livox_ros_driver Installation.
Remarks:
- Since the FAST-LIO must support Livox serials LiDAR firstly, so the livox_ros_driver must be installed and sourced before run any FAST-LIO luanch file.
- How to source? The easiest way is add the line
source $Licox_ros_driver_dir$/devel/setup.bash
to the end of file~/.bashrc
, where$Licox_ros_driver_dir$
is the directory of the livox ros driver workspace (should be thews_livox
directory if you completely followed the livox official document).
Clone the repository and catkin_make:
cd ~/$A_ROS_DIR$/src
git clone https://github.com/hku-mars/fast-lio.git
cd flivis
git submodule update --init
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}
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.
C. We recommend to set the extrinsic_est_en to false if the extrinsic is give. As for the extrinsic initiallization, please refer to our recent work: Robust and Online LiDAR-inertial Initialization.
Connect to your PC to Livox Avia LiDAR by following Livox-ros-driver installation, then
cd ~/$flivis_ROS_DIR$
source devel/setup.bash
roslaunch flivis mapping_avia.launch
roslaunch livox_ros_driver livox_lidar_msg.launch
- For livox serials, FAST-LIO only support the data collected by the
livox_lidar_msg.launch
since only itslivox_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.
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:
- LiDAR point cloud topic name:
lid_topic
- IMU topic name:
imu_topic
- Translational extrinsic:
extrinsic_T
- Rotational extrinsic:
extrinsic_R
(only support rotation matrix)
- The extrinsic parameters in FAST-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.
- FAST-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.
Step A: Setup before run
Edit config/velodyne.yaml
to set the below parameters:
- LiDAR point cloud topic name:
lid_topic
- IMU topic name:
imu_topic
(both internal and external, 6-aixes or 9-axies are fine) - Set the parameter
timestamp_unit
based on the unit of time (Velodyne) or t (Ouster) field in PoindCloud2 rostopic - Line number (we tested 16, 32 and 64 line, but not tested 128 or above):
scan_line
- Translational extrinsic:
extrinsic_T
- Rotational extrinsic:
extrinsic_R
(only support rotation matrix)
- The extrinsic parameters in FAST-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 ~/$flivis_ROS_DIR$
source devel/setup.bash
roslaunch flivis mapping_velodyne.launch
Step C: Run LiDAR's ros driver or play rosbag.
Set pcd_save_enable
in launchfile to 1
. All the scans (in global frame) will be accumulated and saved to the file flivis/PCD/scans.pcd
after the FAST-LIO is terminated. pcl_viewer scans.pcd
can visualize the point clouds.
Tips for pcl_viewer:
- change what to visualize/color by pressing keyboard 1,2,3,4,5 when pcl_viewer is running.
1 is all random
2 is X values
3 is Y values
4 is Z values
5 is intensity
Files: Can be downloaded from google drive
Run:
roslaunch flivis mapping_avia.launch
rosbag play YOUR_DOWNLOADED.bag
NCLT Dataset: Original bin file can be found here.
We produce Rosbag Files and a python script to generate Rosbag files: python3 sensordata_to_rosbag_fastlio.py bin_file_dir bag_name.bag
Run:
roslaunch flivis mapping_velodyne.launch
rosbag play YOUR_DOWNLOADED.bag
In order to validate the robustness and computational efficiency of FAST-LIO in actual mobile robots, we build a small-scale quadrotor which can carry a Livox Avia LiDAR with 70 degree FoV and a DJI Manifold 2-C onboard computer with a 1.8 GHz Intel i7-8550U CPU and 8 G RAM, as shown in below.
The main structure of this UAV is 3d printed (Aluminum or PLA), the .stl file will be open-sourced in the future.
Thanks for LOAM(J. Zhang and S. Singh. LOAM: Lidar Odometry and Mapping in Real-time), Livox_Mapping, LINS and Loam_Livox.