45 #include <pcl/registration/registration.h> 46 #include <pcl/registration/transformation_estimation_svd.h> 47 #include <pcl/registration/transformation_estimation_point_to_plane_lls.h> 48 #include <pcl/registration/transformation_estimation_symmetric_point_to_plane_lls.h> 49 #include <pcl/registration/correspondence_estimation.h> 50 #include <pcl/registration/default_convergence_criteria.h> 93 template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar =
float>
108 using Ptr = shared_ptr<IterativeClosestPoint<PointSource, PointTarget, Scalar> >;
109 using ConstPtr = shared_ptr<const IterativeClosestPoint<PointSource, PointTarget, Scalar> >;
181 const auto fields = pcl::getFields<PointSource> ();
183 for (
const auto &field : fields)
188 else if (field.name ==
"normal_x")
193 else if (field.name ==
"normal_y")
198 else if (field.name ==
"normal_z")
215 const auto fields = pcl::getFields<PointSource> ();
217 for (
const auto &field : fields)
219 if (field.name ==
"normal_x" || field.name ==
"normal_y" || field.name ==
"normal_z")
308 template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar =
float>
320 using Ptr = shared_ptr<IterativeClosestPoint<PointSource, PointTarget, Scalar> >;
321 using ConstPtr = shared_ptr<const IterativeClosestPoint<PointSource, PointTarget, Scalar> >;
326 reg_name_ =
"IterativeClosestPointWithNormals";
345 auto symmetric_transformation_estimation = pcl::make_shared<pcl::registration::TransformationEstimationSymmetricPointToPlaneLLS<PointSource, PointTarget, Scalar> > ();
371 if (symmetric_transformation_estimation)
403 #include <pcl/registration/impl/icp.hpp> bool enforce_same_direction_normals_
Whether or not to negate source and/or target normals such that they point in the same direction in t...
typename Registration< PointSource, PointTarget, float >::PointCloudTarget PointCloudTarget
Defines functions, macros and traits for allocating and using memory.
DefaultConvergenceCriteria represents an instantiation of ConvergenceCriteria, and implements the fol...
TransformationEstimationPtr transformation_estimation_
A TransformationEstimation object, used to calculate the 4x4 rigid transformation.
IterativeClosestPointWithNormals is a special case of IterativeClosestPoint, that uses a transformati...
bool target_has_normals_
Internal check whether target dataset has normals or not.
typename Registration< PointSource, PointTarget, float >::Matrix4 Matrix4
shared_ptr< const IterativeClosestPoint< PointSource, PointTarget, float > > ConstPtr
bool getUseReciprocalCorrespondences() const
Obtain whether reciprocal correspondence are used or not.
virtual void setInputSource(const PointCloudSourceConstPtr &cloud)
Provide a pointer to the input source (e.g., the point cloud that we want to align to the target) ...
PointIndices::Ptr PointIndicesPtr
CorrespondenceEstimationPtr correspondence_estimation_
A CorrespondenceEstimation object, used to estimate correspondences between the source and the target...
int nr_iterations_
The number of iterations the internal optimization ran for (used internally).
std::size_t nx_idx_offset_
Normal fields offset.
CorrespondencesPtr correspondences_
The set of correspondences determined at this ICP step.
typename IterativeClosestPoint< PointSource, PointTarget, Scalar >::PointCloudSource PointCloudSource
virtual void determineRequiredBlobData()
Looks at the Estimators and Rejectors and determines whether their blob-setter methods need to be cal...
Eigen::Matrix< Scalar, 4, 4 > Matrix4
typename PointCloudSource::ConstPtr PointCloudSourceConstPtr
virtual void setInputTarget(const PointCloudTargetConstPtr &cloud)
Provide a pointer to the input target (e.g., the point cloud that we want to align the input source t...
shared_ptr< ::pcl::PointIndices > Ptr
virtual void transformCloud(const PointCloudSource &input, PointCloudSource &output, const Matrix4 &transform)
Apply a rigid transform to a given dataset.
void setEnforceSameDirectionNormals(bool enforce_same_direction_normals)
Set whether or not to negate source or target normals on a per-point basis such that they point in th...
Matrix4 transformation_
The transformation matrix estimated by the registration method.
IterativeClosestPointWithNormals()
Empty constructor.
void setInputSource(const PointCloudSourceConstPtr &cloud) override
Provide a pointer to the input source (e.g., the point cloud that we want to align to the target) ...
typename Registration< PointSource, PointTarget, float >::PointCloudSource PointCloudSource
shared_ptr< IterativeClosestPoint< PointSource, PointTarget, float > > Ptr
virtual ~IterativeClosestPointWithNormals()
Empty destructor.
~IterativeClosestPoint()
Empty destructor.
IterativeClosestPoint provides a base implementation of the Iterative Closest Point algorithm...
shared_ptr< DefaultConvergenceCriteria< Scalar > > Ptr
Registration represents the base registration class for general purpose, ICP-like methods...
typename PointCloudTarget::ConstPtr PointCloudTargetConstPtr
std::size_t y_idx_offset_
bool getEnforceSameDirectionNormals() const
Obtain whether source or target normals are negated on a per-point basis such that they point in the ...
bool source_has_normals_
Internal check whether source dataset has normals or not.
void setInputTarget(const PointCloudTargetConstPtr &cloud) override
Provide a pointer to the input target (e.g., the point cloud that we want to align to the target) ...
virtual void transformCloud(const PointCloudSource &input, PointCloudSource &output, const Matrix4 &transform)
Apply a rigid transform to a given dataset.
shared_ptr< const ::pcl::PointIndices > ConstPtr
pcl::registration::DefaultConvergenceCriteria< Scalar >::Ptr getConvergeCriteria()
Returns a pointer to the DefaultConvergenceCriteria used by the IterativeClosestPoint class...
typename IterativeClosestPoint< PointSource, PointTarget, Scalar >::Matrix4 Matrix4
pcl::registration::DefaultConvergenceCriteria< Scalar >::Ptr convergence_criteria_
std::string reg_name_
The registration method name.
void computeTransformation(PointCloudSource &output, const Matrix4 &guess) override
Rigid transformation computation method with initial guess.
bool need_source_blob_
Checks for whether estimators and rejectors need various data.
bool use_reciprocal_correspondence_
The correspondence type used for correspondence estimation.
void setUseReciprocalCorrespondences(bool use_reciprocal_correspondence)
Set whether to use reciprocal correspondence or not.
bool getUseSymmetricObjective() const
Obtain whether a symmetric objective is used or not.
IterativeClosestPoint()
Empty constructor.
bool use_symmetric_objective_
Type of objective function (asymmetric vs.
CorrespondenceEstimation represents the base class for determining correspondences between target and...
typename PointCloudTarget::Ptr PointCloudTargetPtr
std::size_t z_idx_offset_
PointIndices::ConstPtr PointIndicesConstPtr
std::size_t x_idx_offset_
XYZ fields offset.
typename PointCloudSource::Ptr PointCloudSourcePtr
std::size_t nz_idx_offset_
void setUseSymmetricObjective(bool use_symmetric_objective)
Set whether to use a symmetric objective function or not.
std::size_t ny_idx_offset_