LIO-SAM environment configuration(Linux 20.04; ROS Noetic)

LIO-SAM environment configuration(Linux 20.04; ROS Noetic)

  1. Make sure you have installed ROS completely

  2. Install gtsam from official github

I am highly recommend you to install from Releases(The version I downloaded is 4.1.1)

1
2
3
4
5
6
# cd to address where you download gtsam
$ cd ~/gtsam-4.1.1
$ mkdir build && cd build
$ cmake -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF -DGTSAM_USE_SYSTEM_EIGEN=ON ..
$ sudo make -j8
$ sudo make install
  1. create workspace
    1
    2
    3
    4
    5
    $ mkdir -p ~/catkin_ws/src
    $ cd ~/catkin_ws/src
    $ git clone https://github.com/TixiaoShan/LIO-SAM.git
    $ cd ..
    $ catkin_make

problems&solutions

Q1:

1
fatal error: opencv/cv.h: No such file or directory

A1:

1
# ubuntu20.04 install opencv4.2 by default, so we should change ~/include/utility.h
  • step1:
    use #include <opencv2/opencv.hpp> instead of #include <opencv/cv.h> in utility.h

  • step2:
    move#include <pcl/kdtree/kdtree_flann.h>in front of #include <opencv2/opencv.hpp>

Q2:

1
/usr/include/pcl-1.10/pcl/pcl_config.h:7:4: error: #error PCL requires C++14 or above

A2:
it mean that PCL 1.10 require C++14 or higher
openCMakeLists.txt, change set(CMAKE_CXX_FLAGS "-std=c++11") to set(CMAKE_CXX_FLAGS "-std=c++14")

Q3:

1
error while loading shared libraries: libmetis-gtsam.so: cannot open shared object file

A3:
after installing gtsam, you’d better run sudo ldconfig, in order to update link settings
then, init workspace, run catkin_makeagain


LIO-SAM environment configuration(Linux 20.04; ROS Noetic)
http://example.com/2023/10/09/LIO-SAM/
作者
Qisong He
发布于
2023年10月9日
更新于
2023年10月9日
许可协议