Lego-loam安装编译

他们在Youtube上有介绍视频,有能力的可以去看一下,视频演示了loam和LeGO-LOAM在i7 4710mq和jetson tx2两种平台下的对比,效果十分好。https://www.youtube.com/watch?v=O3tz_ftHV48

1.编译安装LeGO-LOAM的依赖

gtasm的编译安装

1.下载gtsam的源代码     

git clone https://bitbucket.org/gtborg/gtsam.git

编译安装

mkdir build
cd build
cmake ..
sudo make install

至此,gtsam已经编译安装完成了。

2.LeGO-LOAM的编译安装

1.LeGO-LOAM的编译需要使用catkin,如果已经建立catkin_ws,可以跳过下面这步

mkdir -p catkin_ws/src
cd catkin_ws/src
catkin_init_workspace

2.下载LeGO-Loam的源码

cd ~/catkin_ws/src

git clone https://github.com/RobustFieldAutonomyLab/LeGO-LOAM.git

如果觉得github下载慢,可以使用我clone到gitee的代码

git clone https://gitee.com/Yeah2333/LeGO-LOAM.git

3.编译LeGO-Loam

cd catkin_ws
catkin_make -j1
source ~/devel/setup.bash

4.运行LeGO-LOAM

roslaunch lego_loam run.launch
rosbag play *.bag --clock --topic /velodyne_points /imu/data

5.遇到的问题及解决方法

(1)提示缺少pcl_ros的相关配置文件

$sudo apt-get install ros-kinetic-pcl-ros

(2)

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/chenyi/legoloam_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/chenyi/legoloam_ws/build/CMakeFiles/CMakeError.log".
Makefile:1508: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

gtsam库有问题,使用一位热心的网友发给我的库后重新编译,问题解决,在此表示感谢!

6.RS-LIDAR-16

RS-LIDAR-16默认发布的 topic 为/rslidar_points,而LeGO-LOAM需要订阅的 topic 为/velodyne_points,因此使用以下命令:

rosbag play *.bag --clock /rslidar_points:=/velodyne_points

但是,出现以下错误:

featureAssociation: /build/pcl-2t3l2O/pcl-1.7.2/kdtree/include/pcl/kdtree/impl/kdtree_flann.hpp:136: int pcl::KdTreeFLANN<PointT, Dist>::nearestKSearch(const PointT&, int, std::vector&, std::vector&) const [with PointT = pcl::PointXYZI; Dist = flann::L2_Simple]: Assertion `point_representation_->isValid (point) && “Invalid (NaN, Inf) point coordinates given to nearestKSearch!”’ failed.
[featureAssociation-6] process has died [pid 4388, exit code -6, cmd /home/nvidia/LeGO-LOAM-catkin_ws/devel/lib/lego_loam/featureAssociation __name:=featureAssociation __log:=/home/nvidia/.ros/log/20171d1e-1a4c-11e9-bf05-00044bc4e145/featureAssociation-6.log].
log file: /home/nvidia/.ros/log/20171d1e-1a4c-11e9-bf05-00044bc4e145/featureAssociation-6*.log

猜测是要针对RS-LIDAR-16的硬件特性,在代码上做一些必要的修改,因为LeGO-LOAM是专门基于VLP-16优化的。

参考下一部分【新传感器】的内容,如果RS-LIDAR-16与VLP-16硬件参数不同,需要修改参数,但是有点疑惑,因为在没有修改参数的前提下,Velodyne 32线激光雷达数据效果非常好。

本想在Github上提issue,结果没有了入口。代码刚开源时,我就 watch 了,平时提 issue 的人不少,查了下邮箱,最近的是前天。不确定作者会不会再恢复,以及什么时候恢复。
新传感器

使代码适应新传感器的关键是确保点云可以正确投影到距离图像,并且可以正确检测地面。例如,VLP-16沿两个方向的角分辨率为0.2°和2°。它有16个光束。最底部光束的角度为-15°。
因此,“utility.h” 中的参数如下所示。
使用新传感器时,请确保 ground_cloud 具有足够的匹配点。在发布任何问题之前,请阅读此内容。

extern const int N_SCAN = 16;
extern const int Horizon_SCAN = 1800;
extern const float ang_res_x = 0.2;
extern const float ang_res_y = 2.0;
extern const float ang_bottom = 15.0;
extern const int groundScanInd = 7;

猜你喜欢

转载自blog.csdn.net/weixin_43211438/article/details/88795171