1、下载ceres,下载地址http://ceres-solver.org/installation.html#linux点那个latest stable release
2、 安装依赖
// CMake
sudo apt-get install cmake
// google-glog + gflags
sudo apt-get install libgoogle-glog-dev libgflags-dev
// Use ATLAS for BLAS & LAPACK
sudo apt-get install libatlas-base-dev
// Eigen3
sudo apt-get install libeigen3-dev
// 下面这个是可选项不安装也可以
sudo apt-get install libsuitesparse-dev
3、编译安装ceres,在你下载的压缩包路径下右键打开终端
tar zxf ceres-solver-2.1.0.tar.gz
mkdir build
cd build
cmake ..
make -j2
sudo make install
3、编译lio_mapping,新开终端(alt+ctrl+t)
mkdir -p lio_mapping/src
cd lio_mapping/src/
git clone https://github.com/hyye/lio-mapping.git
cd ..
catkin_make -DCMAKE_BUILD_TYPE=Release
4、编译报错如下,打开/Downloads/ceres-solver-2.1.0/CMakeLists.txt,照下面改动三处,改完后重新安装ceres(cd进ceres的build路径下,make -j2,sudo make install)。重新进入工作空间编译lio_mapping编译通过
//原内容
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
//改成下面内容
set(CMAKE_C_VISIBILITY_PRESET default)
set(CMAKE_CXX_VISIBILITY_PRESET default)
set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF)
5、 下载数据集,OneDrive里作者的数据集我已经转存在百度网盘里方便你下载链接:https://pan.baidu.com/s/1tbLD66Y_oCXHwJ165sVp3A 提取码:otg0
6、运行lio_mapping(两个launch文件后面都有个&符号)
source devel/setup.bash
roslaunch lio test_indoor.launch &
roslaunch lio map_4D_indoor.launch &
7、在rviz里/Global Options/Fixed Frame/下输入//world,不然没有点云,ubuntu20.04这个版本 rviz输入两个//,//world才会显示/world,我这里还是提示我Global Status Error不管他
//在下载数据集的地方右键当前路径打开终端播包
rosbag play fast1.bag