You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code is quite old now so it is not compliant with new PCL version. For instance, new version no longer uses boost::shared_ptr.
One thing you can do is to change the local IndicesPtr type def (in file include/Normal2dEstimation.h:L26) from boost::shared_ptr<std::vector<int> > to const std::shared_ptr<const std::vector<int, std::allocator > >.
I'm not sure if this idea will work, but you can try it. Otherwise, trying to update the code with the new PCL API doesn't seem to be a big deal.
error: cannot convert ‘const IndicesPtr’ {aka ‘const boost::shared_ptr<std::vector<int, std::allocator > >’} to ‘const IndicesConstPtr&’ {aka ‘const std::shared_ptr<const std::vector<int, std::allocator > >&’}
60 | this->m_kd_tree->setInputCloud(m_in_cloud, m_indices);
| ^~~~~~~~~
| |
| const IndicesPtr {aka const boost::shared_ptr<std::vector<int, std::allocator > >}
In file included from /home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/../include/Normal2dEstimation.h:14,
from /home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/Normal2dEstimation.cpp:5:
/usr/local/include/pcl-1.12/pcl/search/search.h:121:47: note: initializing argument 2 of ‘void pcl::search::Search::setInputCloud(const PointCloudConstPtr&, const IndicesConstPtr&) [with PointT = pcl::PointXYZ; pcl::search::Search::PointCloudConstPtr = std::shared_ptr<const pcl::PointCloudpcl::PointXYZ >; pcl::search::Search::IndicesConstPtr = std::shared_ptr<const std::vector<int, std::allocator > >]’
121 | const IndicesConstPtr &indices = IndicesConstPtr ());
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/Normal2dEstimation.cpp: In member function ‘void Normal2dEstimation::compute(const Ptr&) const’:
/home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/Normal2dEstimation.cpp:125:48: error: cannot convert ‘const IndicesPtr’ {aka ‘const boost::shared_ptr<std::vector<int, std::allocator > >’} to ‘const IndicesConstPtr&’ {aka ‘const std::shared_ptr<const std::vector<int, std::allocator > >&’}
125 | this->m_kd_tree->setInputCloud(m_in_cloud, m_indices);
| ^~~~~~~~~
| |
| const IndicesPtr {aka const boost::shared_ptr<std::vector<int, std::allocator > >}
In file included from /home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/../include/Normal2dEstimation.h:14,
from /home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/Normal2dEstimation.cpp:5:
/usr/local/include/pcl-1.12/pcl/search/search.h:121:47: note: initializing argument 2 of ‘void pcl::search::Search::setInputCloud(const PointCloudConstPtr&, const IndicesConstPtr&) [with PointT = pcl::PointXYZ; pcl::search::Search::PointCloudConstPtr = std::shared_ptr<const pcl::PointCloudpcl::PointXYZ >; pcl::search::Search::IndicesConstPtr = std::shared_ptr<const std::vector<int, std::allocator > >]’
121 | const IndicesConstPtr &indices = IndicesConstPtr ());
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/Normal2dEstimation.cpp: In member function ‘bool Normal2dEstimation::computePointNormal2d(boost::shared_ptr<std::vector<int, std::allocator > >&, Eigen::Vector3f&) const’:
/home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/Normal2dEstimation.cpp:268:27: error: no matching function for call to ‘pcl::PCApcl::PointXYZ::setIndices(boost::shared_ptr<std::vector<int, std::allocator > >&)’
268 | pca.setIndices(indices);
The text was updated successfully, but these errors were encountered: