ubuntu 20.04 编译和运行SC-LeGo-LOAM

1.搭建文件目录和clone代码

复制代码
mkdir -p SC-LeGo-LOAM/src
cd SC-LeGo-LOAM/src
git clone https://github.com/AbangLZU/SC-LeGO-LOAM.git
cd ..

2.修改代码

需要注意的是原作者使用的是Ouster OS-64雷达,需要更改utility.h文件中适配自己的雷达类型,而本文采用velodyne 16线激光雷达,对utility.h文件要做以下修改

首先是pointCloudTopic

复制代码
extern const string pointCloudTopic = "/os1_points";

替换为

复制代码
extern const string pointCloudTopic = "/velodyne_points";

其次:

复制代码
Ouster OS1-64
extern const int N_SCAN = 64;
extern const int Horizon_SCAN = 1024;
extern const float ang_res_x = 360.0/float(Horizon_SCAN);
extern const float ang_res_y = 33.2/float(N_SCAN-1);
extern const float ang_bottom = 16.6+0.1;
extern const int groundScanInd = 15;

替换为

1)对于16线的VLP雷达,添加

复制代码
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+0.1;
extern const int groundScanInd = 7;

2)对于64线的VLP雷达,添加

复制代码
extern const int N_SCAN = 64;
extern const int Horizon_SCAN = 2083;
extern const float ang_res_x = 360.0/float(Horizon_SCAN);
extern const float ang_res_y = 26.8/float(N_SCAN-1);
extern const float ang_bottom = 24.8;
extern const int groundScanInd = 55;

最后:

注释掉:

复制代码
#include <opencv/cv.h>

加入:

复制代码
#include <opencv2/opencv.hpp>

并且将

复制代码
#include <pcl/kdtree/kdtree_flann.h>

剪切到#include <opencv2/opencv.hpp>前面去

3.编译和运行launch

复制代码
catkin_make

source ./devel/setup.bash
roslaunch lego_loam run.launch

运行launch的经验

1)包名不管是大写和小写,运行是都是小写

2)包名中的"-" 和"" 的区别,尽量运行 ""

4.下载数据包和运行

这里我使用的是LeGo-LOAM的数据包

数据包链接

运行

复制代码
rosbag play --clock ***.bag

5.效果图

相关推荐
iteye_99394 分钟前
让 3 个线程串行的几种方式
java·linux
渡我白衣44 分钟前
Linux操作系统:再谈虚拟地址空间
linux
阿巴~阿巴~1 小时前
Linux 第一个系统程序 - 进度条
linux·服务器·bash
DIY机器人工房1 小时前
代码详细注释:通过stat()和lstat()系统调用获取文件的详细属性信息
linux·嵌入式
望获linux2 小时前
【Linux基础知识系列】第四十三篇 - 基础正则表达式与 grep/sed
linux·运维·服务器·开发语言·前端·操作系统·嵌入式软件
眠りたいです2 小时前
Mysql常用内置函数,复合查询及内外连接
linux·数据库·c++·mysql
我的泪换不回玫瑰2 小时前
Linux系统管理命令
linux
applebomb3 小时前
没合适的组合wheel包,就自行编译flash_attn吧
python·ubuntu·attention·flash
jjkkzzzz3 小时前
Linux下的C/C++开发之操作Zookeeper
linux·zookeeper·c/c++
二当家的素材网3 小时前
Centos和麒麟系统如何每天晚上2点10分定时备份达梦数据库
linux·数据库·centos