【SLAM学习】FAST-LIO配置

本文主要记录如何配置FAST-LIO

Eigen库

Eigen库安装:

sudo apt install libeigen3-dev

查看Eigen版本:

$ pkg-config --modversion eigen3


PCL库

PCL库安装:

sudo apt install libpcl-dev

也可以指定版本安装:

sudo apt install libpcl-dev=1.10.0

Ubuntu默认安装版本:

  • Ubuntu20.04   ——>   1.10.0
  • Ubuntu18.04   ——>   1.8.1
  • Ubuntu16.04   ——>   1.7.2

PCL库的卸载:

sudo apt remove libpcl-dev
# 完全删除软件包及其配置文件
sudo apt purge libpcl-dev

查看PCL版本:

apt-cache show libpcl-dev

若是安装了ROS,默认安装了PCL和Eigen库

Livox ROS Driver

git clone https://github.com/Livox-SDK/Livox-SDK.git
cd Livox-SDK
cd build
cmake ..
make 
sudo make install
git clone https://github.com/Livox-SDK/livox_ros_driver.git ws_livox/src
cd ws_livox
catkin_make
source devel/setup.bash

注意:若要编译FAST-LIO,需要source下Livox ROS Driver的环境变量,也可以把它放在.bashrc中

像这样:(把工程中devel/setup.bash放入~/.bashrc,这样每次重新开一个终端就初始化环境配置)若是没有source下Livox ROS Driver的环境变量的话,就会在编译FAST-LIO的时候报错!!

FAST-LIO

开始编译FAST-LIO ,这里以 S-FAST_LIO 为例进行编译,也可以用原版的FAST-LIO

https://github.com/zlwang7/S-FAST_LIO

mkdir -p S_FAST_LIO_ws/src
cd src
git clone https://github.com/zlwang7/S-FAST_LIO.git
cd ..
catkin_make

若出现:

/usr/bin/ld: /home/robot/Documents/learn_repo/learn_fastlio/S_FAST_LIO_ws/src/S-FAST_LIO/include/esekfom.hpp:217: undefined reference to `Sophus::SO3::matrix() const'
/usr/bin/ld: /home/robot/Documents/learn_repo/learn_fastlio/S_FAST_LIO_ws/src/S-FAST_LIO/include/esekfom.hpp:217: undefined reference to `Sophus::SO3::SO3(Eigen::Matrix<double, 3, 3, 0, 3, 3> const&)'
/usr/bin/ld: /home/robot/Documents/learn_repo/learn_fastlio/S_FAST_LIO_ws/src/S-FAST_LIO/include/esekfom.hpp:217: undefined reference to `Sophus::SO3::log() const'
/usr/bin/ld: /home/robot/Documents/learn_repo/learn_fastlio/S_FAST_LIO_ws/src/S-FAST_LIO/include/esekfom.hpp:218: undefined reference to `Sophus::SO3::matrix() const'
/usr/bin/ld: /home/robot/Documents/learn_repo/learn_fastlio/S_FAST_LIO_ws/src/S-FAST_LIO/include/esekfom.hpp:218: undefined reference to `Sophus::SO3::matrix() const'
/usr/bin/ld: /home/robot/Documents/learn_repo/learn_fastlio/S_FAST_LIO_ws/src/S-FAST_LIO/include/esekfom.hpp:218: undefined reference to `Sophus::SO3::SO3(Eigen::Matrix<double, 3, 3, 0, 3, 3> const&)'
/usr/bin/ld: /home/robot/Documents/learn_repo/learn_fastlio/S_FAST_LIO_ws/src/S-FAST_LIO/include/esekfom.hpp:218: undefined reference to `Sophus::SO3::log() const'

则只需要修改下CMakeLists文件即可

set(Sophus_LIBRARIES "/usr/local/lib/libSophus.so")

重新编译即可!

运行:

source devel/setup.bash
roslaunch sfast_lio mapping_avia.launch 

这时候在播放下数据bag包了

 链接: https://pan.baidu.com/s/16SOBM9heSri6H_Zai3GyCg 提取码: swvs -

rosbag play balcony_5th_floor_avia.bag   

猜你喜欢

转载自blog.csdn.net/qq_42108414/article/details/131530293