Skip to content

lee-sunkyoung/FASTLIO2_ROS2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FASTLIO2 ROS2

Development Environment

Component Version
OS Ubuntu 22.04
ROS Humble Hawksbill
Eigen3 3.4.0
Lidar Velodyne-VLP16
IMU Xsens MTi-610

Prerequisites

pcl
Eigen
sophus
gtsam(optional for LC)
sudo apt install libpcap-dev libpcl* pcl-tools ros-humble-pcl-ros -y
sudo apt install ros-humble-gtsam -y

ros-humble-gtsam-dbgsym(optional)

Check your version

eigen

pkg-config --modversion eigen3

gtsam (select one)

gtsam_version
pkg-config --modversion gtsam

Install Sophus

cd
git clone https://github.com/strasdat/Sophus.git
cd Sophus
git checkout 1.22.10
mkdir build && cd build
cmake .. -DSOPHUS_USE_BASIC_LOGGING=ON
make
sudo make install

How to Use

1. FAST-LIO2

ros2 launch fastlio2 lio_launch.py

2. PGO

ros2 launch pgo pgo_launch.py

3. Save Map

ros2 service call /pgo/save_maps interface/srv/SaveMaps "{file_path: 'your_save_dir', save_patches: true}"

4. Odometry + Relocalization

  1. Launch the Relocalization Node
ros2 launch localizer localizer_launch.py
ros2 bag play your_bag_file // optional
  1. Set Initial Relocalization Values
ros2 service call /localizer/relocalize interface/srv/Relocalize "{"pcd_path": "your_map.pcd", "x": 0.0, "y": 0.0, "z": 0.0, "yaw": 0.0, "pitch": 0.0, "roll": 0.0}"
  1. Check Relocalization Result
ros2 service call /localizer/relocalize_check interface/srv/IsValid "{"code": 0}"

5. Consistent Map Optimization

  1. Launch the Map Optimization Node
ros2 launch hba hba_launch.py
  1. Call the Optimization Service
ros2 service call /hba/refine_map interface/srv/RefineMap "{"maps_path": "your maps directory"}"

Note: If you plan to call the optimization service, you must set save_patches to true when saving the map.


Acknowledgments

  1. FASTLIO2
  2. BLAM
  3. HBA

Performance Notes

This code mainly uses timerCB to trigger the main function at a fixed frequency. In ROS2, timer, subscriber, and service callbacks are executed in the same thread. On machines with limited performance, this can cause blocking issues. To improve performance, it is recommended to use multithreading so that time-consuming callbacks (e.g., timerCB) run in a separate thread.

About

FASTLIO2_ROS2 for Velodyne or other users

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 93.0%
  • CMake 4.6%
  • Python 2.4%