ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

pcl::PointCloud vs. sensor_msgs::PointCloud

asked 2011-07-20 13:50:39 -0500

Obviously they are not the same. Which one should a developer be using?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-07-20 20:48:42 -0500

dornhege gravatar image

pcl::PointCloud for "working".

sensor_msgs::PointCloud is a message for sending. You can create a pcl::PointCloud publisher that will automatically send out the right data.

edit flag offensive delete link more


Documentation of how to send pcl::PointClouds natively can be found at
tfoote gravatar image tfoote  ( 2011-07-26 11:27:07 -0500 )edit

answered 2011-07-21 06:01:08 -0500

dejanpan gravatar image

So you wonna use sensor_msgs::PointCloud2 (not sensor_msgs::PointCloud as it is deprecated) if you are passing messages between nodes in ROS (e.g. between kinect driver node and your pointcloud processing node). Once your pointcloud node receives the sensor_msgs::PointCloud2 msg you use pcl::fromROSMsg function to convert it to pcl::PointCloud<pointt> (note that it has to be templated) and that can then be used as input to all pcl algorithms. D.

edit flag offensive delete link more


Wouldn't it just be easier to use the publishers and subscribers in pcl_ros that automatically do the conversion for you as opposed to manually converting via pcl::fromROSMsg/pcl::toROSMsg?
Eric Perko gravatar image Eric Perko  ( 2011-07-21 06:38:18 -0500 )edit

Question Tools


Asked: 2011-07-20 13:50:39 -0500

Seen: 2,988 times

Last updated: Jul 21 '11