赞
踩
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 <execution>
· 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 #注意更改激光雷达线声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/481527
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。