Ask Your Question

Revision history [back]

The convert_pointcloud_to_image node in pcl_ros does exactly what you're looking for.

The convert_pointcloud_to_image node in pcl_ros does exactly what you're looking for.

The convert_pointcloud_to_image node in pcl_ros does exactly what you're looking for.


Edit: The reason for that crash you're seeing is that you put in an unorganized point cloud (i.e., height = 1). The convert_pointcloud_to_image node can only process organized point clouds. For example, this is how the data from an Asus Xtion looks like:

$ rostopic echo -n1 /camera/depth_registered/points | grep -v data
header: 
  seq: 0
  stamp: 
    secs: 1445245860
    nsecs: 100976221
  frame_id: camera_rgb_optical_frame
height: 240
width: 320
fields: 
  - 
    name: x
    offset: 0
    count: 1
  - 
    name: y
    offset: 4
    count: 1
  - 
    name: z
    offset: 8
    count: 1
  - 
    name: rgb
    offset: 16
    count: 1
is_bigendian: False
point_step: 32
row_step: 10240
is_dense: False

Notice that height !=1, which means this is an organized point cloud.