How to publish a pointcloud of ros msgs in a topic from a pcd file?

Two methods

1. modified source

2. pcd_to_pointcloud

  • run ros node pcl_ros in a terminal

    usage:
$ rosrun pcl_ros pcd_to_pointcloud <file.pcd> [ <interval> ]

Loads a PCD file, publishing it one or more times as a ROS point cloud message.

Published Topics

  • cloud_pcd (sensor_msgs/PointCloud2)

    // A stream of point clouds generated from the PCD file.
// <interval> is the (optional) number of seconds to sleep between messages.
// If <interval> is zero or not specified the message is published once.
  • in my condition, I use
// can add _frame_id:=/camera_link
$ rosrun pcl_ros pcd_to_pointcloud /home/william/Documents/demos/cylinders/preprocessing/data/realSense02.pcd 10 _frame_id:=/map
  • run rviz:

    $ rosrun rviz rviz

If the frame id you add is not camera_link, then should be edit.

click 'Add', click 'By topic', choose 'Pointcloud2' below topic '/cloud_pcd'. Then the pointcloud can be visualized.

References:

  1. pcl_ros

How to publish a pointcloud of ros msgs in a topic from a pcd file?的更多相关文章

  1. ROS(一)Topic 通信

    ROS系统起源于2007年斯坦福大学人工智能实验室的项目与机器人技术公司Willow Garage的个人机器人项目(Personal Robots Program)之间的合作,2008年之后就由Wil ...

  2. ros 使用命令测试topic

    发布话题 $ rostopic pub -r /chatter std_msgs/String "test" 输出数据: $ rostopic echo /chatter data ...

  3. python smbus IOError: [Errno 2] No such file or directory

    1.打开配置文件 sudo nano /boot/config.txt 打开以下选项 "dtparam=i2c_arm=on" ctrl + o 保存 ctrl + x 退出 2. ...

  4. 如何在ROS中使用PCL(2)

    记录关于我们运行roslaunch openni_launch openni.launch  命令时生成的话题以及这些话题的数据类型便于后期的处理,只有知道它们的数据结构,才能很好的对数据进行处理,我 ...

  5. ROS教程

    Learning ROS 学习ROS Depending on your learning style and preferences, you can take two approaches to ...

  6. ROS语音交互(四)接入图灵语义理解

    首先程序中会用到Json,curl 安装相应的库 $ sudo apt-get install libcurl3 libcurl4-openssl-dev$ sudo apt-get install ...

  7. ROS多个master消息互通

    需求 有时候我们需要有几个不同的master, 他们之间要交换topic的内容,这时候就不能使用ros自带的设置同一个master的方法. 我们的处理方法是,构造一个client和一个server,他 ...

  8. 理解ROS话题

    首先需要打开一个终端在里面运行roscore: roscore 再打开一个终端,在里面运行一个turtlesim_node节点: rosrun turtlesim turtlesim_node 打开另 ...

  9. (二)ROS系统架构及概念 ROS Architecture and Concepts 以Kinetic为主更新 附课件PPT

    第2章 ROS系统架构及概念 ROS Architecture and Concepts PPT说明: 正文用白色,命令或代码用黄色,右下角为对应中文译著页码. 这一章需要掌握ROS文件系统,运行图级 ...

随机推荐

  1. 把ASM下的HDD VM转换成ARM下Managed Disk的SSD VM

    在ASM下,要把HDD的VM转换成SSD的VM步骤非常复杂.需要手工把Disk从普通存储账户复制到高级存储账户.再通过这个Disk创建VM. 目前在有了ASM到ARM的迁移工具,以及Managed D ...

  2. Azure Managed Disk

    Azure的磁盘存储是保存在存储账户中的Page Blob.由于Azure Storage Account的各种限制,在设计VM的磁盘存储时,要符合Azure磁盘存储账户的最佳实践,请参考:http: ...

  3. 蓝桥杯 历届试题 PREV-34 矩阵翻硬币

    历届试题 矩阵翻硬币   时间限制:1.0s   内存限制:256.0MB 问题描述 小明先把硬币摆成了一个 n 行 m 列的矩阵. 随后,小明对每一个硬币分别进行一次 Q 操作. 对第x行第y列的硬 ...

  4. binlog之三:binlog开启、查看

    0.开启二进制日志记录功能:        #vim /etc/my.cnf            [mysqld]            log_bin=mysql-bin            b ...

  5. Apache Continuum 远程命令执行漏洞

    这个是apache现在不维护的服务了. 服务使用了struts2框架,目前测试是使用的最新版.

  6. SetConsoleCtrlHandler演示

    #include "stdafx.h"#include <Windows.h> static BOOL WINAPI Handler(DWORD cntrlEvent) ...

  7. C语言学习笔记--函数与指针

    1. 函数类型 (1)C 语言中的函数有自己特定的类型,这个类型由返回值.参数类型和参数个数共同决定.如 int add(int i,int j)的类型为 int(int,int). (2)C 语言中 ...

  8. Windows系统上release版本程序bug跟踪解决方案(1)-日志记录

    使用场景: Win32程序在release模式下编译完成,发送给最终用户使用时,我们的程序有时候也会出现崩溃的情况,这个时候如果能快速定位崩溃原因或提供一些程序崩溃时的状态信息,对我们解决问题将会带来 ...

  9. 【总结整理】WMS、WMTS、WFS

    参考:http://www.cnblogs.com/naaoveGIS/p/5508882.html WMTS:WMTS是OGC制定的一种发布瓦块地图的Web服务规范,wms主要是动态地图,wmts是 ...

  10. Blender 软件 四视图布局的创建方法

    Blender 软件 四视图布局的创建方法 我使用的Blender版本:Blender V 2.77 Q: 为什么要创建一个:四视图布局场景? A: 原因1:四视图布局最适合模型建模.原因2:在 Bl ...