- 重构FASTLIO2 适配ROS2
- 添加回环节点,基于位置先验+ICP进行回环检测,基于GTSAM进行位姿图优化
- 添加重定位节点,基于由粗到细两阶段ICP进行重定位
- 增加一致性地图优化,基于BLAM (小场景地图) 和HBA (大场景地图)
- Ubuntu 22.04
- ROS2 Humble
pcl
Eigen
sophus
gtsam
livox_ros_driver2
git clone https://github.com/Livox-SDK/Livox-SDK2.git
cd ./Livox-SDK2/
mkdir build
cd build
cmake .. && make -j
sudo make installmkdir -r ws_livox/src
git clone https://github.com/Livox-SDK/livox_ros_driver2.git ws_livox/src/livox_ros_driver2
cd ws_livox/src/livox_ros_driver2
source /opt/ros/humble/setup.sh
./build.sh humblegit 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新的Sophus依赖fmt,可以在CMakeLists.txt中添加add_compile_definitions(SOPHUS_USE_BASIC_LOGGING)去除,否则会报错
链接: https://pan.baidu.com/s/1rTTUlVwxi1ZNo7ZmcpEZ7A?pwd=t6yb 提取码: t6yb
--来自百度网盘超级会员v7的分享
ros2 launch fastlio2 lio_launch.py
ros2 bag play your_bag_fileros2 launch pgo pgo_launch.py
ros2 bag play your_bag_fileros2 service call /pgo/save_maps interface/srv/SaveMaps "{file_path: 'your_save_dir', save_patches: true}"ros2 launch localizer localizer_launch.py
ros2 bag play your_bag_file // 可选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}"ros2 service call /localizer/relocalize_check interface/srv/IsValid "{"code": 0}"ros2 launch hba hba_launch.pyros2 service call /hba/refine_map interface/srv/RefineMap "{"maps_path": "your maps directory"}"如果需要调用优化服务,保存地图时需要设置save_patches为true
该代码主要使用timerCB作为频率触发主函数,由于ROS2中的timer、subscriber以及service的回调实际上运行在同一个线程上,在电脑性能不是好的时候,会出现调用阻塞的情况,建议使用线程并发的方式将耗时的回调独立出来(如timerCB)来提升性能