Memory Leak in transformPointCloud ?
I've written a quick node which will take as input a pointcloud and will transform it and republish it at another arbitrary TF location. This node seems to be ballooning up and eating all of the memory very quickly, It doesn't look like there is a memory leak in my code, but I could be wrong. Is anybody else having problems with this function?
Here's a code snippit from the callback in question (this code was largely modified from The Pointcloud to Image utility in pcl_ros:
void
cloud_cb (const sensor_msgs::PointCloud2ConstPtr& cloud)
{
sensor_msgs::PointCloud2Ptr outp = sensor_msgs::PointCloud2Ptr(new sensor_msgs::PointCloud2);
if ((cloud->width * cloud->height) == 0)
return; //return if the cloud is not dense!
while(!pcl_ros::transformPointCloud(transform_to_, *cloud, *outp, listener_)){
ros::Duration(0.1).sleep();
}
pub_.publish (outp); //publish our cloud image
}
It looks like it really starts to leak memory once its in the while() loop.