Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You still need to remove the NaN values from the point cloud. You can do that in the callback like this:

void callback (pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_in_)
{

        pcl::PointCloud<pcl::PointXYZ> filtered_cloud_ = pcl::PointCloud<pcl::PointXYZ>::Ptr (newpcl::PointCloud<pcl::PointXYZ>);

    //remove NaN points from the cloud
    std::vector<int> indices;
    pcl::removeNaNFromPointCloud(*cloud_in_,*filtered_cloud_, indices);

}

You still need to remove the NaN values from the point cloud. You can do that in the callback like this:

void callback (pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_in_)
{

        pcl::PointCloud<pcl::PointXYZ> filtered_cloud_ = pcl::PointCloud<pcl::PointXYZ>::Ptr (newpcl::PointCloud<pcl::PointXYZ>);
(new pcl::PointCloud<pcl::PointXYZ>);

    //remove NaN points from the cloud
    std::vector<int> indices;
    pcl::removeNaNFromPointCloud(*cloud_in_,*filtered_cloud_, indices);

}