研究這個算法一年有餘,踩過的坑及其解決辦法在其它文章中有較長的描述,這裡将糾正過的流程梳理一遍,照着操作就能完整把算法跑起來,如有問題,歡迎一起交流。
1. 最好使用ubuntu18
2.安裝ROS
依據ROS安裝教程安裝完後添加包
sudo apt-get install ros-XXX-cv-bridge ros-XXX-tf ros-XXX-message-filters ros-XXX-image-transport
3.安裝Ceres Solver
git clone https://ceres-solver.googlesource.com/ceres-solver
# CMake
sudo apt-get install cmake
# google-glog + gflags
sudo apt-get install libgoogle-glog-dev libgflags-dev
# BLAS & LAPACK
sudo apt-get install libatlas-base-dev
# Eigen3
sudo apt-get install libeigen3-dev
# SuiteSparse and CXSparse (optional)
sudo apt-get install libsuitesparse-dev
tar zxf ceres-solver-2.0.0.tar.gz
mkdir ceres-bin
cd ceres-bin
cmake ../ceres-solver-2.0.0
make -j3
make test
make install
4.安裝PCL
注意一定要安裝PCL1.9及以上版本,一定一定!!!
各個版本可以從PCL庫集合獲得
git clone https://github.com/PointCloudLibrary/pcl
cd pcl-pcl-1.9 && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j8
sudo make -j8 install
5.建立工作空間
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
cd ..
catkin_make
source devel/setup.bash
6.下載下傳運作算法
cd ~/catkin_ws/src
git clone https://github.com/hku-mars/loam_livox.git
cd ../
catkin_make
source ~/catkin_ws/devel/setup.bash
7.安裝SDK
sudo apt install cmake
git clone https://github.com/Livox-SDK/Livox-SDK.git
cd Livox-SDK
cd build && cmake ..
make
sudo make install
7.安裝Livox ROS Driver
git clone https://github.com/Livox-SDK/livox_ros_driver.git ws_livox/src
cd ws_livox
catkin_make
source ./devel/setup.sh
8.運作loam_livox算法
cd ~/catkin_ws
roslaunch loam_livox rosbag.launch
9.運作Livox ROS Driver
cd ~/ws_livox
source ./devel/setup.sh
roslaunch livox_ros_driver livox_lidar.launch
至此,你就能給周圍環境建出三維點雲地圖啦,希望大家一切順利,科研開心