1. First obtain the laser radar and IMU calibration files
For information on lidar and IMU calibration, please refer to my other blog:
(3 messages) Using lidar_align for external parameter calibration of lidar and IMU (super detailed tutorial)_╰︶ ̄ Mo Dongxian۩۩۩’s blog-CSDN blog https://blog.csdn.net/qq_49959714/article/details /128119029?spm=1001.2014.3001.5501 2. Download and install LIOSAM
Download link:
TixiaoShan/LIO-SAM: LIO-SAM: Tightly-coupled Lidar Inertial Odometry via Smoothing and Mapping (github.com) https://github.com/TixiaoShan/LIO-SAM Extract it to the ros workspace
For information on how to create a ros workspace, please refer to my other blog
(3 messages) How to create a ros workspace, create a ros function package, and create a ros node under ubuntu_╰︶ ̄ Mo Dongxian۩۩۩’s blog-CSDN blog_ubuntu Create a workspace https://blog.csdn.net/ qq_49959714/article/details/127028396?spm=1001.2014.3001.5501 Then execute the following command:
sudo apt-get install -y ros-melodic-navigation
sudo apt-get install -y ros-melodic-robot-localization
sudo apt-get install -y ros-melodic-robot-state-publisher
sudo add-apt-repository ppa:borglab/gtsam-release-4.0
sudo apt install libgtsam-dev libgtsam-unstable-dev
cd ~/catkin_ws
catkin_make
You may encounter the following problems this time:
C++: internal conpiler error: Killed (program cc1plus)Please subnit a full bug report,
with preprocessed source if appropriate.
See <file:///usr /share/doc/gcc-7/README.Bugs> for instructions.
LIO-SAM/CNakeFiles/lio_san_napOptnization.dir /build.nake:62: recipe for target 'LIO-SAM/CMakeFiles/lio_san_napOptnization.dir /src/mapoptnization.cpp.o' failednake[2]: ***[LIO-SAM/CNakeFiles/lio_san_napOptnization.dir /src/mapoptnization.cpp.o] Error 4
CMakeFiles/Makefile2:2868: recipe for target 'LIO-SAN/CMakeFiles/lio_san_napOptnmization.dir/all' failed
make[1]:***[LIO-SAM/CMakeFiles/lio_san_nap0ptnization.dir/all] Error 2make[1]:***waiting for unfinished jobs... .
The reason is that the library related to libtbb.so.2 was not found
Solution:
Search for the location of the library in the terminal:
locate libtbb.so.2
Then add the following code to the corresponding location in the CMakeLists.txt file in the LIO-SAM folder
"/usr/lib/x86_64-linux-gnu/libtbb.so.2"
Finally, recompile catkin_make and there will be no problem.