Skip to content

add explicit instantiations to transformation estimation LM and one to ICP #6258

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

Merged
1 change: 1 addition & 0 deletions registration/include/pcl/registration/icp.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,4 +463,5 @@ class IterativeClosestPointWithNormals
extern template class pcl::IterativeClosestPoint<pcl::PointXYZ, pcl::PointXYZ>;
extern template class pcl::IterativeClosestPoint<pcl::PointXYZI, pcl::PointXYZI>;
extern template class pcl::IterativeClosestPoint<pcl::PointXYZRGB, pcl::PointXYZRGB>;
extern template class pcl::IterativeClosestPoint<pcl::PointXYZ, pcl::PointNormal>;
#endif // PCL_NO_PRECOMPILE
4 changes: 2 additions & 2 deletions registration/include/pcl/registration/impl/registration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Registration<PointSource, PointTarget, Scalar>::getFitnessScore(double max_range
if (!input_->is_dense && !pcl::isXYZFinite(point))
continue;
// Find its nearest neighbor in the target
tree_->nearestKSearch(point, 1, nn_indices, nn_dists);
tree_->nearestKSearchT(point, 1, nn_indices, nn_dists);

// Deal with occlusions (incomplete targets)
if (nn_dists[0] <= max_range) {
Expand Down Expand Up @@ -216,4 +216,4 @@ Registration<PointSource, PointTarget, Scalar>::align(PointCloudSource& output,
deinitCompute();
}

} // namespace pcl
} // namespace pcl
2 changes: 1 addition & 1 deletion registration/include/pcl/registration/registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ class Registration : public PCLBase<PointSource> {
pcl::Indices& indices,
std::vector<float>& distances)
{
int k = tree_->nearestKSearch(cloud, index, 1, indices, distances);
int k = tree_->nearestKSearchT(cloud[index], 1, indices, distances);
if (k == 0)
return (false);
return (true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,13 @@ class TransformationEstimationLM
} // namespace pcl

#include <pcl/registration/impl/transformation_estimation_lm.hpp>

#if !defined(PCL_NO_PRECOMPILE) && \
!defined(PCL_REGISTRATION_TRANSFORMATION_ESTIMATION_LM_CPP_)
extern template class pcl::registration::TransformationEstimationLM<pcl::PointXYZ,
pcl::PointXYZ>;
extern template class pcl::registration::TransformationEstimationLM<pcl::PointXYZI,
pcl::PointXYZI>;
extern template class pcl::registration::TransformationEstimationLM<pcl::PointXYZRGB,
pcl::PointXYZRGB>;
#endif // PCL_NO_PRECOMPILE
1 change: 1 addition & 0 deletions registration/src/icp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ template class PCL_EXPORTS pcl::IterativeClosestPoint<pcl::PointXYZ, pcl::PointX
template class PCL_EXPORTS pcl::IterativeClosestPoint<pcl::PointXYZI, pcl::PointXYZI>;
template class PCL_EXPORTS
pcl::IterativeClosestPoint<pcl::PointXYZRGB, pcl::PointXYZRGB>;
template class PCL_EXPORTS pcl::IterativeClosestPoint<pcl::PointXYZ, pcl::PointNormal>;
#endif // PCL_NO_PRECOMPILE
13 changes: 13 additions & 0 deletions registration/src/transformation_estimation_lm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,17 @@
*
*/

#define PCL_REGISTRATION_TRANSFORMATION_ESTIMATION_LM_CPP_
#include <pcl/registration/transformation_estimation_lm.h>
#include <pcl/pcl_config.h> // for PCL_NO_PRECOMPILE

#ifndef PCL_NO_PRECOMPILE
#include <pcl/pcl_exports.h> // for PCL_EXPORTS
#include <pcl/point_types.h>
template class PCL_EXPORTS
pcl::registration::TransformationEstimationLM<pcl::PointXYZ, pcl::PointXYZ>;
template class PCL_EXPORTS
pcl::registration::TransformationEstimationLM<pcl::PointXYZI, pcl::PointXYZI>;
template class PCL_EXPORTS
pcl::registration::TransformationEstimationLM<pcl::PointXYZRGB, pcl::PointXYZRGB>;
#endif // PCL_NO_PRECOMPILE