error 2664 cannot convert argument 1 from 'std::shared_ptr' to 'const boost::shared_ptr ...

created at 05-29-2022 views: 3

error

error 2664 cannot convert argument 1 from 'std::shared_ptr' to 'const boost::shared_ptr < const pcl::PointRepresentat

When running the code for continuous multiple point cloud registration with PCL1.8.

There is an error in the non-linear ICP code of the registration function:

// registration
pcl::IterativeClosestPointNonLinear<PointNormalT, PointNormalT> reg; // nonlinear LM-ICP registration
reg.setTransformationEpsilon(1e-6);//Set the convergence judgment condition, the smaller the precision, the slower the convergence
reg.setMaxCorrespondenceDistance(0.1);
reg.setPointRepresentation(std::make_shared<const MyPointRepresentation>(point_representation));
reg.setInputSource(points_with_normals_src);
reg.setInputTarget(points_with_normals_tgt);

solution

Change std::maked_shared to boost::maked_shared

dreg.setPointRepresentation(std::make_shared<const MyPointRepresentation>(point_representation));
created at:05-29-2022
edited at: 05-29-2022: