激光雷达与惯导标定:Lidar_IMU_Init 编译
- 功能包安装
- 安装ceres-solver-2.0.0 (注意安装2.2.0不行,必须要安装2.0.0)
LI-Init是一种鲁棒、实时的激光雷达惯性系统初始化方法。该方法可校准激光雷达与IMU之间的时间偏移量和外部参数,以及重力矢量和IMU偏差。我们的方法不需要任何目标或额外的传感器,特定的结构化环境,先前的环境点图或初始值的外在和时间偏移。
功能包安装
需要环境要求:
Ubuntu >= 18.04.
ROS >= Melodic
PCL >= 1.8
Eigen >= 3.3.4
下载源码
git clone https://github.com/hku-mars/LiDAR_IMU_Init.git
下载完成提示
正克隆到 ‘LiDAR_IMU_Init’…
remote: Enumerating objects: 340, done.
remote: Counting objects: 100% (118/118), done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 340 (delta 79), reused 78 (delta 55), pack-reused 222
接收对象中: 100% (340/340), 46.43 MiB | 2.57 MiB/s, 完成.
处理 delta 中: 100% (161/161), 完成.
拷贝到工作空间中进行编译
报错提示如下:
CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by “livox_ros_driver”
with any of the following names:
livox_ros_driverConfig.cmake
livox_ros_driver-config.cmake
Add the installation prefix of “livox_ros_driver” to CMAKE_PREFIX_PATH or
set “livox_ros_driver_DIR” to a directory containing one of the above
files. If “livox_ros_driver” provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
LiDAR_IMU_Init/CMakeLists.txt:45 (find_package)
原因是该功能包的CMakeLists.txt文件中的第45行:
find_package(catkin REQUIRED COMPONENTSgeometry_msgsnav_msgssensor_msgsroscpprospystd_msgspcl_rostflivox_ros_driver #需要这个功能包但是没有找到message_generationeigen_conversions
)
需要livox_ros_driver
这个功能包但是没有找到
安装这个功能包,需要提前下载安装好Livox SDK
git clone https://github.com/Livox-SDK/Livox-SDK.git
cd Livox-SDK
cd build && cmake ..
成功后提示:
– Configuring done
– Generating done
– Build files have been written to: /home/jk-jone/Livox-SDK/build
make
成功后提示:
[100%] Linking CXX executable lidar_utc_sync
[100%] Built target lidar_utc_sync
sudo make install
成功后提示:
– Install configuration: “”
– Installing: /usr/local/lib/liblivox_sdk_static.a
– Installing: /usr/local/include/livox_def.h
– Installing: /usr/local/include/livox_sdk.h
下载livox_ros_driver功能包
git clone https://github.com/Livox-SDK/livox_ros_driver.git
放到工作空间中进行编译
则不再提示
Could not find a package configuration file provided by “livox_ros_driver”
再次编译提示缺少Ceres功能包
Make Error at LiDAR_IMU_Init/CMakeLists.txt:61 (find_package):
By not providing “FindCeres.cmake” in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by “Ceres”, but
CMake did not find one.
Could not find a package configuration file provided by “Ceres” with any of
the following names:
CeresConfig.cmake
ceres-config.cmake
Add the installation prefix of “Ceres” to CMAKE_PREFIX_PATH or set
“Ceres_DIR” to a directory containing one of the above files. If “Ceres”
provides a separate development package or SDK, be sure it has been
installed.
安装ceres-solver-2.0.0 (注意安装2.2.0不行,必须要安装2.0.0)
先安装ceres依赖
sudo apt-get install cmake
sudo apt-get install libgoogle-glog-dev libgflags-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install libeigen3-dev
下载ceres-solver-2.0.0
git clone https://github.com/ceres-solver/ceres-solver # 这个版本不行
git clone -b 2.0.0 https://github.com/ceres-solver/ceres-solver.git
下载完成后形成该文件
然后进行编译
cd ceres-solver
mkdir build
cd build
cmake ..
成功后提示
– Build the examples.
– Configuring done
– Generating done
– Build files have been written to: /home/jk-jone/ceres-solver/build
然后再进行make
make -j4
成功后显示:
[ 99%] Built target ba_iterschur_suitesparse_clusttri_user_test
[100%] Linking CXX executable …/…/…/bin/ba_sparsecholesky_suitesparse_user_threads_test
[100%] Built target ba_sparsecholesky_suitesparse_user_threads_test
最后进行安装
sudo make install
成功后显示 :
– Installing: /usr/local/include/ceres/internal/config.h
– Installing: /usr/local/include/ceres/internal/export.h
– Installing: /usr/local/lib/cmake/Ceres/CeresTargets.cmake
– Installing: /usr/local/lib/cmake/Ceres/CeresTargets-release.cmake
– Installing: /usr/local/lib/cmake/Ceres/CeresConfig.cmake
– Installing: /usr/local/lib/cmake/Ceres/CeresConfigVersion.cmake
– Installing: /usr/local/lib/cmake/Ceres/FindGlog.cmake
至此Ceres-solver-2.0.0安装完毕
这个功能包对ceres-solver的版本有要求,2.2.0的版本有问题,需要2.0.0的版本
再次对工作空间进行编译
编译成功