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

最新文章

  1. 关于Finereport移动端报表二次开发的两个小例子
  2. Codeforces Round #Pi (Div. 2) C. Geometric Progression map
  3. Activity的活动周期
  4. 【百度地图API】圣诞节里不会迷路的麋鹿——驾车导航
  5. WebBrowser控件使用技巧分享
  6. Polycarp&#39;s problems
  7. JavaSE教程-03Java中分支语句与四种进制转换-思维导图
  8. 记一次python的一些参数
  9. Python 函数调用&amp;定义函数&amp;函数参数
  10. java8实战二------lambda表达式和函数式接口,简单就好
  11. Base 底层库开源项目总结
  12. 创建spark_读取数据
  13. 数据库中char和varchar区别
  14. 18.os模块获取url后缀
  15. 使用EF操作Oracle数据库小计
  16. hpu 1267 Cafeteria (01背包)
  17. 基于反射启动Spring容器
  18. 造成MySQL全表扫描的原因
  19. spring 事务配置
  20. Android-进程理解/进程的优先级别

热门文章

  1. Docker资源
  2. 操作Oracle 一条龙
  3. TFSEclipsePlugin-UpdateSiteArchive 手动拷贝
  4. Day2-Python基础2---字典操作
  5. 关于web.xml不同版本之间的区别
  6. 【转】 Pro Android学习笔记(八一):服务(6):复杂数据Parcel
  7. Swing编程把图片放入frame里。先不作为背景图片
  8. expected declaration specifiers or '...' before string constant
  9. 侯捷STL学习(五)--allocator和容器之间的实现关系
  10. java ----获取路径的各种方法(总结)