Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make have bug #4

Open
chenxiaocongAI opened this issue Dec 30, 2022 · 1 comment
Open

make have bug #4

chenxiaocongAI opened this issue Dec 30, 2022 · 1 comment

Comments

@chenxiaocongAI
Copy link

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);

@Enderdead
Copy link
Owner

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.

Good lucK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants