Why is "variable or field ‘PointCloudRGBtoI’ declared void" when calling PointCloudXYZRGBtoXYZI()?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Why is "variable or field ‘PointCloudRGBtoI’ declared void" when calling PointCloudXYZRGBtoXYZI()?

hurelyman77
I have a working program to which I've tried to add Harris keypoint detection. To that end, I have to convert the XYZRGBA points to XYZI points, using PointCloudXYZRGBtoXYZI() like so:

int findHarrisKeypoints(const PointCloud::Ptr cloud_in, const double cloud_in_resolution, const pcl::PointCloud<pcl::PointXYZI>::Ptr keypoints)
{
       
    PCL_INFO("Harris is finding keypoints...\n");
       
    float modifier = 2.0f;

    //convert input to intensity...
    pcl::PointCloud<pcl::PointXYZI>::Ptr temp_cloud_in (new pcl::PointCloud<pcl::PointXYZI>);
    pcl::PointCloudXYZRGBtoXYZI (*cloud_in, *temp_cloud_in);

    //find keypoints with Harris
    pcl::HarrisKeypoint3D<pcl::PointXYZI,pcl::PointXYZI> h3d;

    h3d.setNonMaxSupression(true);
    h3d.setRadius(4 * cloud_in_resolution);
    h3d.setRadiusSearch(4 * cloud_in_resolution);
    h3d.setRefine(true);
    h3d.setInputCloud (temp_cloud_in);
    h3d.setNumberOfThreads(2);
    //h3d->setNormals(normal_source);
    h3d.setMethod(pcl::HarrisKeypoint3D<pcl::PointXYZI,pcl::PointXYZI>::HARRIS);
    h3d.compute (*keypoints);

    if(keypoints->points.size() < 1)
    {
    PCL_ERROR("ERROR: DIDN'T COMPUTE ENOUGH KEYPOINTS. ABORTING...\n");
    return -1;
    }
    else
    {
    return 0;
    }
       
}

Why does this fail to compile with the error above? I've #included pcl/point_types_conversion.h and pcl/keypoints/harris_3d.h The compiler claims that the error is coming from the call to PointCloudXYZRGBtoXYZI(), but that may or may not be useful.