lego loam 跑镭神32线激光雷达
师弟反应镭神32线激光雷达(32C)录制的数据包不能跑lego loam,这里就总结一下。
首先lego loam默认的接受的topic name是velodyne_points,点云的frame_id是velodyne,镭神驱动发布的topic name为point_raw,frame_id为world这里需要写一个程序转一下:
#include "ros/ros.h"
#include "std_msgs/String.h"
#include "sensor_msgs/PointCloud2.h"
#include <string> #include <sstream> /**
* This tutorial demonstrates simple sending of messages over the ROS system.
*/ static ros::Publisher g_scan_pub; static void main_topic_callback(const sensor_msgs::PointCloud2::ConstPtr& input)
{
sensor_msgs::PointCloud2 msg = *input;
msg.header.frame_id = "velodyne";
g_scan_pub.publish(msg);
} int main(int argc, char *argv[])
{
/**
* The ros::init() function needs to see argc and argv so that it can perform
* any ROS arguments and name remapping that were provided at the command line.
* For programmatic remappings you can use a different version of init() which takes
* remappings directly, but for most command-line programs, passing argc and argv is
* the easiest way to do it. The third argument to init() is the name of the node.
*
* You must call one of the versions of ros::init() before using any other
* part of the ROS system.
*/
ros::init(argc, argv, "trans_leishen_velodyne"); /**
* NodeHandle is the main access point to communications with the ROS system.
* The first NodeHandle constructed will fully initialize this node, and the last
* NodeHandle destructed will close down the node.
*/
ros::NodeHandle private_nh("~");
ros::NodeHandle n; /**
* The advertise() function is how you tell ROS that you want to
* publish on a given topic name. This invokes a call to the ROS
* master node, which keeps a registry of who is publishing and who
* is subscribing. After this advertise() call is made, the master
* node will notify anyone who is trying to subscribe to this topic name,
* and they will in turn negotiate a peer-to-peer connection with this
* node. advertise() returns a Publisher object which allows you to
* publish messages on that topic through a call to publish(). Once
* all copies of the returned Publisher object are destroyed, the topic
* will be automatically unadvertised.
*
* The second parameter to advertise() is the size of the message queue
* used for publishing messages. If messages are published more quickly
* than we can send them, the number here specifies how many messages to
* buffer up before throwing some away.
*/ std::string main_topic;
std::string scan_topic; if (!private_nh.getParam("main_topic", main_topic))
{
ROS_ERROR("can not get main_topic!");
exit();
} if (!private_nh.getParam("scan_topic", scan_topic))
{
ROS_ERROR("can not get scan_topic!");
exit();
} g_scan_pub = n.advertise<sensor_msgs::PointCloud2>(scan_topic, );
ros::Subscriber main_topic_sub = n.subscribe<sensor_msgs::PointCloud2>(main_topic, , main_topic_callback); /**
* A count of how many messages we have sent. This is used to create
* a unique string for each message.
*/
ros::spin(); return ;
}
在把我的launch文件(leishen_dispatcher.launch)也贴出来:
<launch>
<arg name="scan_topic_name" default="velodyne_points" />
<arg name="main_topic_name" default="point_raw" /> <node pkg="record_gnss_pc" name="trans_leishen_velodyne" type="trans_leishen_velodyne" output="screen">
<param name="scan_topic" value="$(arg scan_topic_name)" />
<param name="main_topic" value="$(arg main_topic_name)" />
</node>
</launch>
在将代码lego loam中的utility.h文件中添加的镭神32C的配置文件(激光雷达扫描频率分别为5Hz与10Hz)也贴一下:
// LeiShen-32C-5Hz
// extern const int N_SCAN = 32;
// extern const int Horizon_SCAN = 4000;
// extern const float ang_res_x = 360.0 / float(Horizon_SCAN);
// extern const float ang_res_y = 26 / float(N_SCAN-1);
// extern const float ang_bottom = 16.5;
// extern const int groundScanInd = 10; //地面的线扫条数 // LeiShen-32C-10Hz
extern const int N_SCAN = ;
extern const int Horizon_SCAN = ;
extern const float ang_res_x = 360.0 / float(Horizon_SCAN);
extern const float ang_res_y = 26.0 / float(N_SCAN-);
extern const float ang_bottom = 16.5;
extern const int groundScanInd = ; //地面的线扫条数
最后把imageProjection.cpp中159行的注释删除,程序部分调整完毕。
编译。
运行lego loam:
$ roslaunch lego_loam run.launch
运行上面的launch文件
$ roslaunch record_data leishen_dispatcher.launch
最后运行你的bag
$ rosbag play --clock -----.bag
不要忘记--clock
就可以开始了。
lego loam 跑镭神32线激光雷达的更多相关文章
- 使用velodyne16线激光雷达跑loam-velodyne
一.velodyne-VLP16使用教程 推荐网址: http://blog.csdn.net/littlethunder/article/details/51920681 https://www.c ...
- 镭神激光雷达对于Autoware的适配
1. 前言 我们的自动驾驶采用镭神激光雷达,在使用Autoware的时候,需要对镭神激光雷达的底层驱动,进行一些改变以适配Autoware. 2. 修改 (1)首先修改lslidar_c32.laun ...
- 使用ros_driver运行velodyne16线激光雷达
一.使用ros_driver运行VLP16 推荐网址: http://blog.csdn.net/littlethunder/article/details/51920681 https://www. ...
- Lidar激光雷达市场
Lidar激光雷达市场 近年来,激光雷达技术在飞速发展,从一开始的激光测距技术,逐步发展了激光测速.激光扫描成像.激光多普勒成像等技术,如今在无人驾驶.AGV.机器人等领域已相继出现激光雷达的身影. ...
- 阿里巴巴AI Lab成立两年,都做了些什么?
https://mp.weixin.qq.com/s/trkCGvpW6aCgnFwLxrGmvQ 撰稿 & 整理|Debra 编辑|Debra 导读:在 2018 云栖人工智能峰会上,阿里巴 ...
- 激光雷达 LOAM 论文 解析
转自:https://blog.csdn.net/hltt3838/article/details/109261334 固态激光雷达的一段视频:https://v.qq.com/x/page/a078 ...
- AD19新功能之跟随走线
跟随走线 AD19新增跟随走线,比如需要按照特定的轨迹进行走线,比如要绕着一个圆进行走线,或者靠着边框走线,普通模式下的效果如下图所示,线会跟着指针跑: 在走线模式下,按住 shift + f ,然后 ...
- TOF摄像机可以替代Flash激光雷达吗?
TOF摄像机可以替代Flash激光雷达吗? 一.基于ToF技术的Flash激光雷达 基本成像原理上ToF Camera与LiDAR相同,都采用飞行时间测距技术(包括利用APD或SPAD的直接测距法,和 ...
- 漫谈 SLAM 技术(上)
欢迎大家前往腾讯云社区,获取更多腾讯海量技术实践干货哦~ 作者:解洪文 导语 随着最近几年机器人.无人机.无人驾驶.VR/AR的火爆,SLAM技术也为大家熟知,被认为是这些领域的关键技术之一.本文对S ...
随机推荐
- 深入理解Java中的Garbage Collection
前提 最近由于系统业务量比较大,从生产的GC日志(结合Pinpoint)来看,需要对部分系统进行GC调优.但是鉴于以往不是专门做这一块,但是一直都有零散的积累,这里做一个相对全面的总结.本文只针对Ho ...
- .NET 使用OLEDB导入Excel数据
/** * *在本章节中主要讲解的是如何使用OLEDB将Excel中的数据导入到数据库中 * */using System; using System.Data; using System.Data. ...
- Python使用数字与字符串的技巧
1.少写数字字面量 "数字字面量(integer literal)" 是指那些直接出现在代码里的数字.它们分布在代码里的各个角落,比如代码 del users[0] 里的 0 就是 ...
- PHP面试题2019年新浪工程师面试题及答案解析
一.单选题(共28题,每题5分) 1.以下语句输出的结果是什么? A.3$a\$a3336 B.33\$a3336 C.$a$a\$a3336 D.3$a\$a333$a$a 参考答案:A 答案解析: ...
- 函数的防抖---js
执行规定一段时间后执行 <input type="text" id="inp" /> <script> var oInp = docum ...
- 双十一DIY装机记
一.装机背景 最近发现古董笔记本太卡了,用了近6年,尽管自己不打游戏,但是业余时间写写代码,同时开两个编辑器,打开个大一点的软件都卡的不行,据说更换固态硬盘可以提高速度,于是乎,京东买了一个500 ...
- LFI (local file inclusion vulnerability)本地文件包含
代码实例: <?php $file = $_GET['file']; if(isset($file)) { include("pages/$file"); } else { ...
- jenkins解决乱码
1.Jenkins系统设置中修改 点击左侧“系统管理”——右侧选择“系统设置”——“全局属性”,选择第一项:Environment variables,键值对列表,点击增加: 键:LANG 值:zh. ...
- 访问rabbitmq-server失败
测试项目正常运行突然访问不了,各项目启动失败,查看日志发现是RabbitMQ拒绝连接. 重启后依然失败,看var/log/rabbitmq/startup_err 发现什么错误信息也没有,后查看磁盘空 ...
- bayaim_当前国内外Hadoop的实际使用案例
当前国内外Hadoop的实际使用案例 说到Hadoop,很多朋友都想知道到底它是如何被应用的呢?通过下文,笔者就向大家介绍一下具体的情况. 1.Yahoo Yahoo是Hadoop的最大支持者,截至2 ...