zoukankan      html  css  js  c++  java
  • How to publish a pointcloud of ros msgs in a topic from a pcd file?

    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.
    Pointcloud Visualization

    References:

    1. pcl_ros
  • 相关阅读:
    MemCached总结二:数据管理指令
    MemCached总结一:Unbutu操作系统下memcached服务器安装和telnet方式连接memcache
    Laravel5 开启Debug
    状压dp
    树形dp
    区间dp
    线性dp
    背包九讲
    dp求解各种子串子序列
    线段树详解
  • 原文地址:https://www.cnblogs.com/linweilin/p/9770726.html
Copyright © 2011-2022 走看看