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. C#中获取Excel文件的第一个表名

    //    2.以数据库方式打开并输入数据//      此方式将xls文件所在目录看作数据库,其中的xls文件看作数据库表,表名即文件名(不加扩展名).//      函数importExcelTo ...

  2. Keepalived+Nginx实现负载均衡高可用

    一.负载均衡高可用 Nginx作为负载均衡器,所有请求都到了Nginx,可见Nginx处于非常重点的位置,如果Nginx服务器宕机后端web服务将无法提供服务,影响严重. 为了避免负载均衡服务器的宕机 ...

  3. Java栈,队列,优先队列的使用

    1. 栈的使用: import java.util.*; public class Main{ public static void main(String[] args){ Deque<Str ...

  4. 关于jsp和html页面中的三种弹出框

    代码: <!-- 引入jquery 由于在下面使用jquery选择器,与弹出框无关 --> <script type="text/javascript" src= ...

  5. Linux打包下载命令

    语法:tar [主选项+辅选项] 文件或者目录使用该命令时,主选项是必须要有的,它告诉tar要做什么事情,辅选项是辅助使用的,可以选用. 主选项: c 创建新的档案文件.如果用户想备份一个目录或是一些 ...

  6. 下拉列表---demo---bai

    select.jsp <%@ page language="java" import="java.util.*" pageEncoding="U ...

  7. 2016.6.18主窗体、子窗体InitializeComponent()事件、Load事件发生顺序以及SeleChanged事件的发生

    主窗体,子窗体的InitializeComponent(构造函数).Load事件执行顺序 1.主窗体定义事件 new 主窗体() 构造函数进入主窗体InitializeComponent函数,该函数中 ...

  8. 程序中使用log4J打印信息的两种方式

    (1)通过org.apache.commons.logging.Log 接口实例化: public static Log log = LogFactory.getLog(String name); p ...

  9. C#高级参数out的使用

    C#中有三个高级参数,分别是out,ref,params.本文章中先来介绍out参数的使用. out,用于在方法中返回多余值.(可以理解为让一个方法返回不同的类型值) 我们通过例子来理解例子的功能:用 ...

  10. 剑指offer 38_统计数组中k出现的个数

    思路: 二分法,分别找出第一个和最后一个k出现的位置.相减 加一 #include <stdio.h> //获取第一个K的位置 int getFirstK (int k,int *numb ...