PointCloud subscriber/publisher types
Hi,
When working with PointClouds, I usually subscribe to a sensor_msgs::PointCloud2
topic, and convert to a pcl::PointCloud
inside my code. Then, once I'm done mainpulating the cloud, I convert it back to a sensor_msgs::PointCloud2
to publish it, using these functions:
pcl::fromROSMsg
pcl::toROSMsg
My first question is: what is the cost of using these functions? I am assuming there's a memcpy involved, which (when dealing with kinect data) is probably not negligible.
Second: is there a way to avoid this, by directly subscribing/publishing pcl::PointCloud
types? I believe that there is a publisher/subscriber for pcl types, but I'm not sure whether it actually saves time, or does the same conversion/memcpy behind the scenes.
Thanks, Ivan