I am using PCL 1.3. Is there any function to convert pointcloud to pointcloud::ptr. I am new at PCL libraries. I have a ROS node subscribing to sensor_msgs/PoinCloud2 topic then I am converting it into pcl::Poincloud and now I want to do pcl::StatisticalOutlierRemoval. The outlier removal function takes in the pointers, not the Poincloud itself(That's what I understood). So for that purpose I would like to know the solution of how to convert between them?
pcl::PointCloud<pcl::PointXYZ> point_cloud
pcl::fromPCLPointCloud2(cloud_filtered, point_cloud);
pcl::removeNaNFromPointCloud(point_cloud, point_cloud, nan_idx);
pcl::StatisticalOutlierRemoval<pcl::PointXYZ> sor;
sor.setInputCloud (point_cloud);
sor.setMeanK (50);
sor.setStddevMulThresh (1.0);
sor.filter (*point_cloud);
error: no matching function for call to ‘pcl::StatisticalOutlierRemovalpcl::PointXYZ::setInputCloud(**pcl::PointCloudpcl::PointXYZ**&)’
note: candidate: void pcl::PCLBase::setInputCloud(const PointCloudConstPtr&) [with PointT = pcl::PointXYZ; pcl::PCLBase::PointCloudConstPtr = boost::shared_ptr<const pcl::PointCloudpcl::PointXYZ >]