Invalid allocation size error in pcl1.7.2

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

Invalid allocation size error in pcl1.7.2

KIRUBHAKARAN
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hi,

I try to display aligned rgb point clouds using icp algorithm.But during alignment of point cloud it throws "Invalid allocation size error".

My code:
pcl::PointCloud<pcl::PointXYZRGB>::Ptr PassingCloudstoICP( pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointCloud1, pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointCloud2)
        {
                pcl::IterativeClosestPoint<pcl::PointXYZRGB, pcl::PointXYZRGB> icp;
                icp.setInputCloud (pointCloud1);
                 icp.setInputTarget (pointCloud2);
                // Set the max correspondence distance to 5cm (e.g., correspondences with higher distances will be ignored)
                icp.setMaxCorrespondenceDistance (0.05);
                //Set the maximum number of iterations (criterion 1)
                icp.setMaximumIterations (25);
                // Set the transformation epsilon (criterion 2)
                icp.setTransformationEpsilon (1e-8);
                // Set the euclidean distance difference epsilon (criterion 3)
                icp.setEuclideanFitnessEpsilon (1);
                //Perform the alignment
                icp.align(*finalcloud);
                return finalcloud;
        }


I have tried to debug it and done code walkthrough,when icp.align(*finalcloud) executes it goes to the following file registration.hpp,here it goes through following
function.

---"pcl::Registration<PointSource, PointTarget, Scalar>::align (PointCloudSource &output, const Matrix4& guess)"  
     --- initcompute()
     ---- setInputCloud(target_) -- when this line executes the compiler throws "Invalid allocation size 4294967295 bytes"


Please suggest me how to fix this error.



Any help is appreciated.