Faster_lio是今年高博在fast_lio上改进的开源SLAM,使得SLAM的效率更高,代码地址为:Faster—LIO;高博的介绍为:Faster-LIO:快速激光IMU里程计。论文地址为:Faster-LIO:快速激光IMU里程计PDF。
具体的安装步骤:
· ROS (melodic or noetic)
· glog: sudo apt-get install libgoogle-glog-dev
· Eigen: sudo apt-get install libeigen3-dev
· pcl: sudo apt-get install libpcl-dev
· yaml-cpp: sudo apt-get install libyaml-cpp-dev
解决的问题:
/home/test/LIVOX/FASTER_LIO/catkin_ws/src/faster-lio/src/laser_mapping.cc:3:10: fatal error: execution: 没有那个文件或目录
#include
· sudo add-apt-repository ppa:ubuntu-toolchain-r/test
· sudo apt update
· sudo apt install gcc-9//注意gcc和g++都是9.0以上的版本 进行编译
· sudo apt install g++-9 //github上缺少这一步,一直报错,用g++ --version 查看才知道没有
· cd /usr/bin
· sudo rm gcc g++
· sudo ln -s gcc-9 gcc
· sudo ln -s g++-9 g++
解决的问题:
In file included from /usr/include/c++/9/pstl/parallel_backend.h:14,
from /usr/include/c++/9/pstl/algorithm_impl.h:25,
from /usr/include/c++/9/pstl/glue_execution_defs.h:52,
from /usr/include/c++/9/execution:32,
from /home/test/LIVOX/FASTER_LIO/catkin_ws/src/faster-lio/src/laser_mapping.cc:3:
/usr/include/c++/9/pstl/parallel_backend_tbb.h:28:2: error: #error Intel(R) Threading Building Blocks 2018 is required; older versions are not supported.
28 | #error Intel(R) Threading Building Blocks 2018 is required; older versions are not supported.
| ^~~~~
In file included from /usr/include/c++/9/pstl/parallel_backend.h:14,
from /usr/include/c++/9/pstl/algorithm_impl.h:25,
from /usr/include/c++/9/pstl/glue_execution_defs.h:52,
from /usr/include/c++/9/execution:32,
from /home/test/LIVOX/FASTER_LIO/catkin_ws/src/faster-lio/src/laser_mapping.cc:3:
/usr/include/c++/9/pstl/parallel_backend_tbb.h: In function ‘void __pstl::__par_backend::__parallel_for(_ExecutionPolicy&&, _Index, _Index, _Fp)’:
/usr/include/c++/9/pstl/parallel_backend_tbb.h:99:27: error: ‘isolate’ is not a member of ‘tbb::this_task_arena’
99 | tbb::this_task_arena::isolate([=]() {
| ^~~~~~~
/usr/include/c++/9/pstl/parallel_backend_tbb.h: In function ‘_Value __pstl::__par_backend::__parallel_reduce(_ExecutionPolicy&&, _Index, _Index, const _Value&, const _RealBody&, const _Reduction&)’:
/usr/include/c++/9/pstl/parallel_backend_tbb.h:111:34: error: ‘isolate’ is not a member of ‘tbb::this_task_arena’
参考:linux tbb 安装_Ubuntu18.04 GCC9 安装
·下载tbb,并cd 到目录
wget https://github.com/intel/tbb/archive/2019_U8.tar.gz
tar zxvf 2019_U8.tar.gz
rm 2019_U8.tar.gz
cd tbb-2019_U8
· 编辑linux.gcc-9.inc
cp build/linux.gcc.inc build/linux.gcc-9.inc
# 使用vscode 编辑文件
code -n build/linux.gcc-9.inc
# 把大约是15,16行的CPLUS ?= g++ CONLY ?= gcc修改为下面语句,然后保存
CPLUS ?= g++-9
CONLY ?= gcc-9
· 编译tbb
make compiler=gcc-9 stdver=c++17 tbb_build_prefix=my_tbb_build
·安装tbb
sudo mkdir /usr/local/tbb-2019_U8
sudo cp -r include /usr/local/tbb-2019_U8/include
sudo ln -s /usr/local/tbb-2019_U8/include/tbb /usr/local/include/tbb
sudo cp -r build/my_tbb_build_release /usr/local/tbb-2019_U8/lib
sudo ln -s /usr/local/tbb-2019_U8/lib/libtbb.so.2 /usr/local/lib/libtbb.so
sudo ln -s /usr/local/tbb-2019_U8/lib/libtbbmalloc.so.2 /usr/local/lib/libtbbmalloc.so
sudo ln -s /usr/local/tbb-2019_U8/lib/libtbbmalloc_proxy.so.2 /usr/local/lib/libtbbmalloc_proxy.so
echo 'export LD_LIBRARY_PATH=/usr/local/tbb-2019_U8/lib:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j4 //注意线程,改为自己的
注意:iVoxel类型需要在编译时指定,默认时现行的iVoxel,若需要变成iVoxel-PHC,需要执行下面指令:
cmake .. -DWITH_IVOX_NODE_TYPE_PHC=ON
· 更改src中的CmakeList.txt文件,将target_link_libraries中的tbb更改为具体的库路径,更改后如下,注意对比新增的代码(很重要)
解决的问题
/bin/sh: 1: /usr/bin/c++: not found
/bin/sh: 1: /usr/bin/c++: not found
src/CMakeFiles/faster_lio.dir/build.make:86: recipe for target 'src/CMakeFiles/faster_lio.dir/pointcloud_preprocess.cc.o' failed
make[2]: *** [src/CMakeFiles/faster_lio.dir/pointcloud_preprocess.cc.o] Error 127
make[2]: *** 正在等待未完成的任务....
src/CMakeFiles/faster_lio.dir/build.make:62: recipe for target 'src/CMakeFiles/faster_lio.dir/laser_mapping.cc.o' failed
make[2]: *** [src/CMakeFiles/faster_lio.dir/laser_mapping.cc.o] Error 127
CMakeFiles/Makefile2:3982: recipe for target 'src/CMakeFiles/faster_lio.dir/all' failed
make[1]: *** [src/CMakeFiles/faster_lio.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${PYTHON_LIBRARIES}
/usr/local/lib/libtbb.so
/usr/local/lib/libtbbmalloc.so
/usr/local/lib/libtbbmalloc_proxy.so
glog
yaml-cpp
)
· 将代码放入工作空间内的src目录下,使用正常的包的编译方法编辑即可;
离线:
调用离线建图,用参数指定bag和配置文件:
固态雷达,也就是avia:
./build/devel/lib/faster_lio/run_mapping_offline --bag_file your_avia_bag_file --config_file ./config/avia.yaml
对于NCLT,机械雷达, 运行:
./build/devel/lib/faster_lio/run_mapping_offline --bag_file your_nclt_bag_file --config_file ./config/velodyne.yaml,注意下面更改的部分,其他的部分是无所谓的部分
common:
dataset: "nclt"
lid_topic: "/points_raw" #注意更改激光雷达话题
imu_topic: "/imu_correct" #注意更改IMU话题
time_sync_en: true # ONLY turn on when external time synchronization is really not possible,确定无法使用外部标定时启用
preprocess:
lidar_type: 2 # 1 for Livox serials LiDAR, 2 for Velodyne LiDAR, 3 for ouster LiDAR,注意更改激光雷达类型
scan_line: 16 #注意更改激光雷达线
blind: 4
time_scale: 1e-3 # 兼容不同数据集的时间单位,仅对Velodyne LiDAR(lidar_type=2)生效
mapping:
acc_cov: 0.1
gyr_cov: 0.1
b_acc_cov: 0.0001
b_gyr_cov: 0.0001
fov_degree: 180
det_range: 100.0
extrinsic_est_en: true # true: enable the online estimation of IMU-LiDAR extrinsic
extrinsic_T: [ 0, 0, 0.28 ]
extrinsic_R: [ 1, 0, 0,
0, 1, 0,
0, 0, 1 ]
publish:
path_publish_en: false
scan_publish_en: true # false: close all the point cloud output
scan_effect_pub_en: true # true: publish the pointscloud of effect point
dense_publish_en: false # false: low down the points number in a global-frame point clouds scan.
scan_bodyframe_pub_en: true # true: output the point cloud scans in IMU-body-frame
path_save_en: true # 保存轨迹,用于精度计算和比较
pcd_save:
pcd_save_en: true
interval: -1 # how many LiDAR frames saved in each pcd file;
# -1 : all frames will be saved in ONE pcd file, may lead to memory crash when having too much frames.
feature_extract_enable: false
point_filter_num: 6
max_iteration: 3
filter_size_surf: 0.5
filter_size_map: 0.5
cube_side_length: 1000
ivox_grid_resolution: 0.5 # default=0.2
ivox_nearby_type: 18 # 6, 18, 26
esti_plane_threshold: 0.1 # default=0.1
在线:
roslaunch faster_lio mapping_avia.launch#固态
rosbag play your bag file
/home/test/LIVOX/FASTER_LIO/catkin_ws/src/faster-lio/src/laser_mapping.cc:3:10: fatal error: execution: 没有那个文件或目录
#include
此问题时std库在c++17的新特性,g++9.0以上版本支持此库,所以确定gcc-9和g+±9已经正确安装,可以解决此问题;
如果已经正确安装,在终端ls列表中g++和gcc时蓝色的,表示已经正确链接,如果时红色的,表示未成功链接;
通过g++ --version和gcc --version查看当前系统的gcc和g++的版本是否大于等于9.0;
此问题是无法正确的include tbb对饮搞定头文件,无论是cmake还是catkin_make编译,此时按照上述说明中源码编译tbb即可;
In file included from /usr/include/c++/9/pstl/parallel_backend.h:14,
from /usr/include/c++/9/pstl/algorithm_impl.h:25,
from /usr/include/c++/9/pstl/glue_execution_defs.h:52,
from /usr/include/c++/9/execution:32,
from /home/test/LIVOX/FASTER_LIO/catkin_ws/src/faster-lio/src/laser_mapping.cc:3:
/usr/include/c++/9/pstl/parallel_backend_tbb.h:28:2: error: #error Intel(R) Threading Building Blocks 2018 is required; older versions are not supported.
28 | #error Intel(R) Threading Building Blocks 2018 is required; older versions are not supported.
| ^~~~~
In file included from /usr/include/c++/9/pstl/parallel_backend.h:14,
from /usr/include/c++/9/pstl/algorithm_impl.h:25,
from /usr/include/c++/9/pstl/glue_execution_defs.h:52,
from /usr/include/c++/9/execution:32,
from /home/test/LIVOX/FASTER_LIO/catkin_ws/src/faster-lio/src/laser_mapping.cc:3:
/usr/include/c++/9/pstl/parallel_backend_tbb.h: In function ‘void __pstl::__par_backend::__parallel_for(_ExecutionPolicy&&, _Index, _Index, _Fp)’:
/usr/include/c++/9/pstl/parallel_backend_tbb.h:99:27: error: ‘isolate’ is not a member of ‘tbb::this_task_arena’
99 | tbb::this_task_arena::isolate([=]() {
| ^~~~~~~
/usr/include/c++/9/pstl/parallel_backend_tbb.h: In function ‘_Value __pstl::__par_backend::__parallel_reduce(_ExecutionPolicy&&, _Index, _Index, const _Value&, const _RealBody&, const _Reduction&)’:
/usr/include/c++/9/pstl/parallel_backend_tbb.h:111:34: error: ‘isolate’ is not a member of ‘tbb::this_task_arena’
/bin/sh: 1: /usr/bin/c++: not found
/bin/sh: 1: /usr/bin/c++: not found
src/CMakeFiles/faster_lio.dir/build.make:86: recipe for target 'src/CMakeFiles/faster_lio.dir/pointcloud_preprocess.cc.o' failed
make[2]: *** [src/CMakeFiles/faster_lio.dir/pointcloud_preprocess.cc.o] Error 127
make[2]: *** 正在等待未完成的任务....
src/CMakeFiles/faster_lio.dir/build.make:62: recipe for target 'src/CMakeFiles/faster_lio.dir/laser_mapping.cc.o' failed
make[2]: *** [src/CMakeFiles/faster_lio.dir/laser_mapping.cc.o] Error 127
CMakeFiles/Makefile2:3982: recipe for target 'src/CMakeFiles/faster_lio.dir/all' failed
make[1]: *** [src/CMakeFiles/faster_lio.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
此问题是让系统自行寻找tbb库无法成功,所以此时需要手动在CmakeList.txt文件中给定库的路径即可,在上面的步骤里都有;
1.faster-lio代码
2.Faster-LIO:快速激光IMU里程计
3.Faster-lio在ubuntu18.04上安装以及运行
4.linux tbb 安装_Ubuntu18.04 GCC9 安装