Lego-loam编译安装与运行

安装依赖:

  1. 下载gtsam
cd ~
git clone https://bitbucket.org/gtborg/gtsam.git
  1. 编译
cd ~/gtsam
mkdir build
cd build
cmake ..
make check   #可选的,运行单元测试,我没执行这个命令,因为在TX2上编译太慢了,太慢了,太慢了
make install

下载并编译LeGO-LOAM

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/RobustFieldAutonomyLab/LeGO-LOAM.git
cd ..
catkin_make -j1

当第一次编译代码时,需要在“catkin_make”后面添加“-j1”以生成一些消息类型。将来的编译不需要“-j1”。

Cmake报错:
CMake Error at /usr/share/cmake-3.5/Modules/CMakeFindDependencyMacro.cmake:45 (message):
Invalid arguments to find_dependency
Call Stack (most recent call first):
/usr/local/lib/cmake/GTSAM/GTSAMConfig.cmake:17 (find_dependency)
LeGO-LOAM/LeGO-LOAM/CMakeLists.txt:23 (find_package)

– Configuring incomplete, errors occurred!
See also “/home/fish/catkin_legoLOAM/build/CMakeFiles/CMakeOutput.log”.
See also “/home/fish/catkin_legoLOAM/build/CMakeFiles/CMakeError.log”.
Invoking “cmake” failed

解决方法:
将/usr/local/lib/cmake/GTSAM/GTSAMConfig.cmake:17 行的find_dependency改成find_package

cd  /usr/local/lib/cmake/GTSAM/
sudo gedit GTSAMConfig.cmake 

改完后重新catkin_make -j1即可。

运行

  1. 运行 launch 文件
roslaunch lego_loam run.launch
  • 注意:参数“/ use_sim_time”,对于模拟则设置为“true”,对于使用真实机器人则设置为“false”。
  • 播放bag文件
rosbag play *.bag --clock --topic /velodyne_points /imu/data
  • 注意:虽然 /imu/data 是可选的,但如果提供的话,它可以大大提高估计的准确性。

LeGO-LOAM初探:原理,安装和测试_W_Tortoise的博客-CSDN博客_lego-loam  https://blog.csdn.net/learning_tortosie/article/details/86527542

 

你可能感兴趣的:(SLAM,Lego-LOAM)