[ros-users] point cloud questions

Michael Styer michael at styer.net
Thu Jul 29 21:20:38 UTC 2010

Hello the list,

I'm doing some work with PCL, and I'm finding myself a little bit
confused by the various point cloud messages and classes floating

So far I think I understand the following, but correct me if any of
these are wrong:
* the old point cloud message type was sensor_msgs::PointCloud;
* this has been superseded by sensor_msgs::PointCloud2;
* the PCL library works with objects of type pcl::PointCloud<T>, where T
is one of the defined pcl:: types or a user-defined type;
* a pcl::PointCloud object can be obtained from a PointCloud2 message
using the point_cloud::fromMsg() function;
* although point_cloud::Publisher::publish() accepts (and appears to
publish) pcl::PointCloud<T> objects directly, it converts them to
sensor_msgs::PointCloud2 messages in order to publish them (I was
confused about this for a while).

But I also have a number of questions that I haven't been able to figure
out, so if anyone can help me out here I'd be very grateful!

1) The PCL demo stack publishes point clouds as
sensor_msgs::PointCloud2, but also sets up a point_cloud_converter node
to convert to sensor_msgs::PointCloud. Why does it do this? Is there a
reason I should prefer publishing PointCloud messages over PointCloud2
messages, or vice versa?

2) What's the function of the height and width fields in the
pcl::PointCloud<T> class? In particular, in my node I want to create an
output point cloud which is a subset of the points in the input point
cloud; given the subset, what should the height and width of the output
point cloud be? Do the height and width of the input point cloud refer
to the geometric area enclosing the points, or to the size of the point
cloud vector/matrix?

3) For a given node that publishes a sensor_msgs::PointCloud2 topic, is
there any way for another node to determine the type of the enclosed
points? Or is that information only visible in the source?

That's all I have at the minute... :) Thanks for any advice you can


More information about the ros-users mailing list