1、高效且精确的激光雷达-惯性-视觉融合定位及建图系统

FAST-LIVO2

环境安装步骤:

2. 预先条件

2.1 Ubuntu and ROS

Ubuntu 16.0420.04. ROS Installation.
Ubuntu 16.04
20.04. ROS 安装。

2.2 PCL && Eigen && OpenCV

PCL>=1.6, Follow PCL Installation.
PCL>=1.6,遵循 PCL 安装指南。

Eigen>=3.3.4, Follow Eigen Installation.
Eigen>=3.3.4,遵循 Eigen 安装指南。

OpenCV>=3.2, Follow Opencv Installation.
OpenCV>=3.2,遵循 Opencv 安装指南。

注:笔记本中用鱼香ros一键安装的ros这些软件版本刚好合适,笔记本中ros是melodic,ubuntu18.04

2.3 Sophus安装

Sophus Installation for the non-templated/double-only version.
Sophus 非模板/仅双精度版本安装

1
2
3
4
5
6
git clone https://github.com/strasdat/Sophus.git
cd Sophus
git checkout a621ff
mkdir build && cd build && cmake ..
make
sudo make install

注:但是众所周知,这个版本的Sophus是有bug的,解决方法如下:

  • 打开Sophus/sophus/so2.cpp文件

  • 、
    cd sophus/
    vim so2.cpp
    
    1
    2
    3

    * 将代码修改如下:

    // SO2::SO2() // { // unit_complex_.real() = 1.; // unit_complex_.imag() = 0.; // } //修改为: SO2::SO2() { unit_complex_.real(1.); unit_complex_.imag(0.); }
    1
    2
    3

    再返回来重新编译

    cd ~/桌面/Sophus/build
    1

    make
    1
    2
    3
    4
    5
    6
    7



    同时要注意在/src/rgp_vikit/vikit_common/CMakeLists.txt.加入下面一句

    ```cpp
    SET(Sophus_LIBRARIES libSophus.so)

还有一些说法是:

出现Sophus相关的报错,在”/home/kwanwaipang/catkin_ws/src/rpg_vikit/vikit_common/CMakeLists.txt”中添加下面代码即可

1
2
#添加Sophus_LIBRARIES
SET(Sophus_LIBRARIES "/usr/local/lib/libSophus.so")

还有一个说法是按照这个视频里操作:

Fast-livo2复现-从数据集下载,相关依赖安装,源码下载,编译和运行全流程_哔哩哔哩_bilibili

创建一个ros工作空间

1
2
3
4
5
6
7
8
# 创建源码文件夹:
mkdir -p ~/catkin_ws/src

# 进入 src 文件夹:
cd ~/catkin_ws/src

# 初始化文件夹:
catkin_init_workspace

编译ROS工作空间

1
2
3
4
5
# 进入工作空间目录
cd ~/catkin_ws/

# 开始编译
catkin_make

设置环境变量

1
2
3
4
5
6
7
8
# 设置环境变量
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc

# 让终端生效
source ~/.bashrc

# 查看环境变量
echo $ROS_PACKAGE_PATH

2.4 Vikit

​ Vikit contains camera models, some math and interpolation functions that we need. Vikit is a catkin project, therefore, download it into your catkin workspace source folder.
​ Vikit 包含相机模型和一些我们需要的数学和插值函数。Vikit 是一个 catkin 项目,因此将其下载到您的 catkin 工作空间源文件夹中。

1
2
3
# Different from the one used in fast-livo1
cd catkin_ws/src
git clone https://github.com/xuankuzcr/rpg_vikit.git

2.5 livox_ros_driver

Follow livox_ros_driver Installation.
遵循 Livox_ros_driver 安装指南。

2.5.1 Livox-SDK Installation

  1. Download or clone Livox-SDK from Github to local;
    下载或克隆 Livox-SDK 到本地;
  2. Refer to the corresponding README.md document to install and run Livox-SDK;
    请参阅相应的 README.md 文档安装和运行 Livox-SDK。

2.5.2 Ubuntu 18.04/16.04/14.04 LTS 具体步骤

Dependencies 依赖关系

​ Livox SDK requires CMake 3.0.0+ as dependencies. You can install these packages using apt:
Livox SDK 需要 CMake 3.0.0+作为依赖。您可以使用 apt 安装这些软件包:

1
sudo apt install cmake

实际上根本不用安装cmake,系统里的版本刚好合适

2.5.3 编译 Livox SDK

​ In the Livox SDK directory, run the following commands to compile the project:
在 Livox SDK 目录下,运行以下命令以编译项目:

1
2
3
4
5
git clone https://github.com/Livox-SDK/Livox-SDK.git
cd Livox-SDK
cd build && cmake ..
make
sudo make install

2.6. 获取并构建 livox_ros_driver

  1. 从 GitHub 获取 livox_ros_driver:

  git clone https://github.com/Livox-SDK/livox_ros_driver.git ws_livox/src

    Note : 注意:确保使用上述命令将代码克隆到本地,否则由于文件路径问题将导致编译错误。

  1. 使用以下命令构建 livox_ros_driver:
1
2
cd ws_livox
catkin_make
  1. 使用以下命令更新当前 ROS 软件包环境:

    source ./devel/setup.sh

  1. 可能遇到的问题:

​ 安装编译了livox_ros_driver和livox_SDK,在编译R3LIVE算法时,遇到报错fatal error: livox_ros_driver/CustomMsg.h: 没有那个文件或目录

4 | #include <livox_ros_driver/

​ 网上有的说是ROS没装完整,但是我编译lili-om也用到了livox_ros_driver和livox_SDK,所以问题不应该是ROS没装完整或者是livox_ros_driver和livox_SDK没按照要求编译安装,

注:在编译livox_ros_driver前一定要注意要把它的工作空间建在你所要编译的slam算法的工作空间的src目录中,然后再编译livox_ros_driver。

原文链接:https://blog.csdn.net/qq_59475883/article/details/127758942

3. 构建

Clone the repository and catkin_make:
克隆仓库并运行 catkin_make:

1
2
3
4
5
cd ~/catkin_ws/src
git clone https://github.com/hku-mars/FAST-LIVO2
cd ../
catkin_make
source ~/catkin_ws/devel/setup.bash

4. 运行我们的示例

Download our collected rosbag files via OneDrive (FAST-LIVO2-Dataset).
下载我们的收集的 rosbag 文件,通过 OneDrive(FAST-LIVO2-Dataset)。

1
2
roslaunch fast_livo mapping_avia.launch
rosbag play YOUR_DOWNLOADED.bag