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. 解决windows下tomcat端口被占用[Address already in use: JVM_Bind]

    有时候电脑比较卡,项目比较大的情况下,eclipse没有完全停止tomcat的情况下,下次启动会出现tomcat的端口被占用无法启动的情况,主要报如下错误 解决方案 window下打开命令窗口(快捷键 ...

  2. struts2中常用constant命令配置

    struts.objectFactory这个属性用 于说明Struts2的 对象池创建工厂,Struts2也有自己的对象池,就像Spring那样,在配置文件中你可以引用对象池中的对象,你可以借助于Sp ...

  3. C# IL中间代码注入实现切面编程

    背景及现状:之前分享的那篇“面向切面编程–渲染监控日志记录方案”中提供了利用RealProxy作为代理类来生成代理的面向切面的编程方法,那个方法可以实现面向切面编程进行日志记录,现在渲染主程序也是采用 ...

  4. linq to sql 类的使用

    本文介绍linq to sql模型类的使用 EntityFramework是重量级的数据库模型,如果你想要一个简单轻量级的数据库模型,建议使用linq to sql类 创建模型类 在项目中添加linq ...

  5. javascript——对象的概念——函数 2 (内建函数与类型转换)

    javascript 有许多内建函数,用于各种操作,以下为常用的内建方法. 1.parseInt(object,int):将输入的 int 进制的值 object 转换为 10 进制的数值: obje ...

  6. 问题:oracle floor;结果:Oracle的取整和四舍五入函数——floor,round,ceil,trunc使用说明

    Oracle的取整和四舍五入函数——floor,round,ceil,trunc使用说明 (2011-04-06 16:10:35) 转载▼ 标签: 谈 分类: 渐行渐远 FLOOR——对给定的数字取 ...

  7. 问题:C#将base64转换成二进制图片;结果:c# Base64编码和图片的互相转换代码

    c# Base64编码和图片的互相转换代码 Base64编码在Web方面有很多应用,譬如在URL.电子邮件方面.网上有很多相关的资源用于提供Base64编码和其他编码的转换,.Net Framewor ...

  8. 问题:oracle 排序 null值放在最后;结果: ORACLE中null的排序问题

    ORACLE中null的排序问题 关键字: oracle nulls 问题描述:    在平时的业务处理中,经常遇到要对业务数据进行排序,并且要对null值也做相应的排序.在Oracle中,进行Ord ...

  9. 给Activity切换过程添加动画效果

    首先,在资源文件中定义一些动画效果 例如: <scale android:duration="@android:integer/config_mediumAnimTime" ...

  10. 读书笔记<深入理解JVM>01 关于OutOfMemoryError 堆空间的溢出

    代码片段如下: package com.gosaint.shiro; import java.util.ArrayList; import java.util.List; public class H ...