r3live安装编译及问题解决办法

r3live安装编译

资料:
论文:https://github.com/hku-mars/r3live/tree/master/papers
源码:https://github.com/hku-mars/r3live
视频
b站1:https://www.bilibili.com/video/BV1d341117d6?share_source=copy_web
b站2:https://www.bilibili.com/video/BV1e3411q7Di?share_source=copy_web

说明:本人使用库版本

Ubuntu18.04
GCC version          : 7.5.0
Boost version        : 1.65.1
Eigen version        : 3.3.4
OpenCV version       : 3.4.14

安装ros

ros安装到roswiki官网

安装 livox_ros_driver驱动程序

注:安装驱动之前必须先安装 Livox-SDK
安装 Livox-SDK
1、下载源码到指定文件夹下,或者直接到网站下载压缩文件(本人经常这样操作,(git clone 经常断(网站维护),下载较慢))

github: https://github.com/Livox-SDK/Livox-SDK

2、编译(参考REDAME.md)

mkdir build 
cd build && cmake ..
make
sudo make install

安装livox_ros_driver驱动
1、下载源码到指定文件夹下(ros工作空间的src文件夹下),或者直接到网站下载压缩文件

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

2、编译(参考REDAME.md)

cd ws_livox
catkin_make
source ./devel/setup.sh

安装CGAL and pcl_viewer

sudo apt-get install libcgal-dev pcl-tools

安装OpenCV >= 3.3

参考链接:https://editor.csdn.net/md/?articleId=119868944
查看版本:

pkg-config --modversion opencv

安装pcl

参考链接:随便搜

安装eigen3

参考链接:https://editor.csdn.net/md/?articleId=119877566
查看版本:

cat /usr/include/eigen3/Eigen/src/Core/util/Macros.h

安装ceres

参考链接:
查看版本:

sudo cat /usr/local/include/ceres/version.h 

下载r3live编译

1、下载地址:https://github.com/hku-mars/r3live.git
2、详细操作:

mkdir -p r3live_ws/src 
cd r3live_ws/src
git clone https://github.com/hku-mars/r3live.git  //或者直接将压缩包解压在此文件夹下

3、添加 livox_driver 环境变量:

cd ../
source livox_driver_for_r2live/devel/setup.bash 

4、编译(参考REDAME.md):

catkin_make -j2
source ~/catkin_ws/devel/setup.bash

至此,编译流程完结

编译过程中遇错

1、报错Could not find a package configuration file provided by “livox_ros_driver“

分析:
1、可能未安装驱动livox_ros_driver
2、可能未安装成功,这两种情况参考上述流程
3、未source驱动环境,参考上述流程

2、cgal报错
CMake Error at r3live-master/r3live/CMakeLists.txt:125 (FIND_PACKAGE):
  By not providing "FindCGAL.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "CGAL", but
  CMake did not find one.
  Could not find a package configuration file provided by "CGAL" with any of
  the following names:
    CGALConfig.cmake
    cgal-config.cmake
  Add the installation prefix of "CGAL" to CMAKE_PREFIX_PATH or set
  "CGAL_DIR" to a directory containing one of the above files.  If "CGAL"
  provides a separate development package or SDK, be sure it has been installed.

解决办法:定位到r3live的CMakeLists.txt文件中

#FIND_PACKAGE(CGAL REQUIRED)               //注释掉
FIND_PACKAGE(CGAL QUIET COMPONENTS ImageIO) //添加
3、其他报错(运行过程中报权限问题)

权限
解决办法:删掉build、devel,重新编译

你可能感兴趣的:(系统,软件,库安装,编译相关,c++)