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:
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.
The conversion to and from PCL datatypes is quite computationally expensive. I have observed something like 100ms for a conversion of a Kinect frame on a 1Ghz Atom core.
When publishing over the network the Kinect data was unusable.
Using nodelets I was able to take processing of the Kinect from 10Hz and 150% cpu to 30Hz and 87% cpu on an Atom by publishing using the exact same data type. Here's a launch file which brings up the kinect and processes the data inside the same process using nodelets.
Asked: 2011-03-23 08:37:45 -0500
Seen: 305 times
Last updated: Mar 25 '11