Skip to content

Commit da64bf9

Browse files
add explicit instantiations to transformation estimation LM and one to ICP (#6258)
* add explicit instantiation to transformation estimation LM * instantiate icp with normal point type, for use with transformation estimation point2plane * Formatting * Add missing cloud index in registration neighbour search * Update registration/include/pcl/registration/transformation_estimation_lm.h Co-authored-by: Markus Vieth <[email protected]> * Update registration/include/pcl/registration/registration.h Co-authored-by: Markus Vieth <[email protected]> * Use nearestKSearchT in registration.hpp * fix icp explicit instantiations --------- Co-authored-by: Markus Vieth <[email protected]>
1 parent 64e5fb8 commit da64bf9

File tree

6 files changed

+28
-3
lines changed

6 files changed

+28
-3
lines changed

Diff for: registration/include/pcl/registration/icp.h

+1
Original file line numberDiff line numberDiff line change
@@ -463,4 +463,5 @@ class IterativeClosestPointWithNormals
463463
extern template class pcl::IterativeClosestPoint<pcl::PointXYZ, pcl::PointXYZ>;
464464
extern template class pcl::IterativeClosestPoint<pcl::PointXYZI, pcl::PointXYZI>;
465465
extern template class pcl::IterativeClosestPoint<pcl::PointXYZRGB, pcl::PointXYZRGB>;
466+
extern template class pcl::IterativeClosestPoint<pcl::PointXYZ, pcl::PointNormal>;
466467
#endif // PCL_NO_PRECOMPILE

Diff for: registration/include/pcl/registration/impl/registration.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Registration<PointSource, PointTarget, Scalar>::getFitnessScore(double max_range
148148
if (!input_->is_dense && !pcl::isXYZFinite(point))
149149
continue;
150150
// Find its nearest neighbor in the target
151-
tree_->nearestKSearch(point, 1, nn_indices, nn_dists);
151+
tree_->nearestKSearchT(point, 1, nn_indices, nn_dists);
152152

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

219-
} // namespace pcl
219+
} // namespace pcl

Diff for: registration/include/pcl/registration/registration.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ class Registration : public PCLBase<PointSource> {
665665
pcl::Indices& indices,
666666
std::vector<float>& distances)
667667
{
668-
int k = tree_->nearestKSearch(cloud, index, 1, indices, distances);
668+
int k = tree_->nearestKSearchT(cloud[index], 1, indices, distances);
669669
if (k == 0)
670670
return (false);
671671
return (true);

Diff for: registration/include/pcl/registration/transformation_estimation_lm.h

+10
Original file line numberDiff line numberDiff line change
@@ -349,3 +349,13 @@ class TransformationEstimationLM
349349
} // namespace pcl
350350

351351
#include <pcl/registration/impl/transformation_estimation_lm.hpp>
352+
353+
#if !defined(PCL_NO_PRECOMPILE) && \
354+
!defined(PCL_REGISTRATION_TRANSFORMATION_ESTIMATION_LM_CPP_)
355+
extern template class pcl::registration::TransformationEstimationLM<pcl::PointXYZ,
356+
pcl::PointXYZ>;
357+
extern template class pcl::registration::TransformationEstimationLM<pcl::PointXYZI,
358+
pcl::PointXYZI>;
359+
extern template class pcl::registration::TransformationEstimationLM<pcl::PointXYZRGB,
360+
pcl::PointXYZRGB>;
361+
#endif // PCL_NO_PRECOMPILE

Diff for: registration/src/icp.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@ template class PCL_EXPORTS pcl::IterativeClosestPoint<pcl::PointXYZ, pcl::PointX
4848
template class PCL_EXPORTS pcl::IterativeClosestPoint<pcl::PointXYZI, pcl::PointXYZI>;
4949
template class PCL_EXPORTS
5050
pcl::IterativeClosestPoint<pcl::PointXYZRGB, pcl::PointXYZRGB>;
51+
template class PCL_EXPORTS pcl::IterativeClosestPoint<pcl::PointXYZ, pcl::PointNormal>;
5152
#endif // PCL_NO_PRECOMPILE

Diff for: registration/src/transformation_estimation_lm.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,17 @@
3636
*
3737
*/
3838

39+
#define PCL_REGISTRATION_TRANSFORMATION_ESTIMATION_LM_CPP_
3940
#include <pcl/registration/transformation_estimation_lm.h>
41+
#include <pcl/pcl_config.h> // for PCL_NO_PRECOMPILE
42+
43+
#ifndef PCL_NO_PRECOMPILE
44+
#include <pcl/pcl_exports.h> // for PCL_EXPORTS
45+
#include <pcl/point_types.h>
46+
template class PCL_EXPORTS
47+
pcl::registration::TransformationEstimationLM<pcl::PointXYZ, pcl::PointXYZ>;
48+
template class PCL_EXPORTS
49+
pcl::registration::TransformationEstimationLM<pcl::PointXYZI, pcl::PointXYZI>;
50+
template class PCL_EXPORTS
51+
pcl::registration::TransformationEstimationLM<pcl::PointXYZRGB, pcl::PointXYZRGB>;
52+
#endif // PCL_NO_PRECOMPILE

0 commit comments

Comments
 (0)