激光雷達與慣導標定: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的版本
再次對工作空間進行編譯
編譯成功