Point Cloud Library (PCL)
1.11.0
|
44 #include <pcl/registration/eigen.h>
45 #include <pcl/correspondence.h>
46 #include <pcl/registration/convergence_criteria.h>
50 namespace registration
65 template <
typename Scalar =
float>
69 using Ptr = shared_ptr<DefaultConvergenceCriteria<Scalar> >;
70 using ConstPtr = shared_ptr<const DefaultConvergenceCriteria<Scalar> >;
72 using Matrix4 = Eigen::Matrix<Scalar, 4, 4>;
224 for (
const auto &correspondence : correspondences)
225 mse += correspondence.distance;
226 mse /= double (correspondences.size ());
280 #include <pcl/registration/impl/default_convergence_criteria.hpp>
@ CONVERGENCE_CRITERIA_NO_CORRESPONDENCES
Defines all the PCL and non-PCL macros used.
void setTranslationThreshold(const double threshold)
Set the translation threshold (maximum allowable difference between two consecutive transformations) ...
void setMaximumIterations(const int nr_iterations)
Set the maximum number of iterations the internal optimization should run for.
bool hasConverged() override
Check if convergence has been reached.
@ CONVERGENCE_CRITERIA_ABS_MSE
double translation_threshold_
The translation threshold is the relative translation between two iterations (0 if no translation).
double calculateMSE(const pcl::Correspondences &correspondences) const
Calculate the mean squared error (MSE) of the distance for a given set of correspondences.
int max_iterations_
The maximum nuyyGmber of iterations that the registration loop is to be executed.
shared_ptr< ConvergenceCriteria > Ptr
DefaultConvergenceCriteria represents an instantiation of ConvergenceCriteria, and implements the fol...
int max_iterations_similar_transforms_
The maximum number of iterations that the internal rotation, translation, and MSE differences are all...
void setRelativeMSE(const double mse_relative)
Set the relative MSE between two consecutive sets of correspondences.
bool getFailureAfterMaximumIterations() const
Get whether the registration will fail or converge when the maximum number of iterations is reached.
ConvergenceState convergence_state_
The state of the convergence (e.g., why did the registration converge).
const int & iterations_
The number of iterations done by the registration loop so far.
const pcl::Correspondences & correspondences_
The current set of point correspondences between the source and the target.
shared_ptr< const ConvergenceCriteria > ConstPtr
void setMaximumIterationsSimilarTransforms(const int nr_iterations)
Set the maximum number of consecutive iterations that the internal rotation, translation,...
@ CONVERGENCE_CRITERIA_NOT_CONVERGED
double getTranslationThreshold() const
Get the rotation threshold cosine angle (maximum allowable difference between two consecutive transfo...
@ CONVERGENCE_CRITERIA_REL_MSE
void setConvergenceState(ConvergenceState c)
Sets the convergence state externally (for example, when ICP does not find enough correspondences to ...
int getMaximumIterations() const
Get the maximum number of iterations the internal optimization should run for, as set by the user.
ConvergenceState getConvergenceState()
Return the convergence state after hasConverged ()
~DefaultConvergenceCriteria()
Empty destructor.
@ CONVERGENCE_CRITERIA_ITERATIONS
void setAbsoluteMSE(const double mse_absolute)
Set the absolute MSE between two consecutive sets of correspondences.
void setRotationThreshold(const double threshold)
Set the rotation threshold cosine angle (maximum allowable difference between two consecutive transfo...
@ CONVERGENCE_CRITERIA_FAILURE_AFTER_MAX_ITERATIONS
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
double mse_threshold_relative_
The relative change from the previous MSE for the current set of correspondences, e....
bool failure_after_max_iter_
Specifys if the registration fails or converges when the maximum number of iterations is reached.
int getMaximumIterationsSimilarTransforms() const
Get the maximum number of consecutive iterations that the internal rotation, translation,...
double getRotationThreshold() const
Get the rotation threshold cosine angle (maximum allowable difference between two consecutive transfo...
double getAbsoluteMSE() const
Get the absolute MSE between two consecutive sets of correspondences.
double correspondences_prev_mse_
The MSE for the previous set of correspondences.
@ CONVERGENCE_CRITERIA_TRANSFORM
const Matrix4 & transformation_
The current transformation obtained by the transformation estimation method.
Eigen::Matrix< float, 4, 4 > Matrix4
double correspondences_cur_mse_
The MSE for the current set of correspondences.
void setFailureAfterMaximumIterations(const bool failure_after_max_iter)
Specifies if the registration fails or converges when the maximum number of iterations is reached.
int iterations_similar_transforms_
Internal counter for the number of iterations that the internal rotation, translation,...
double getRelativeMSE() const
Get the relative MSE between two consecutive sets of correspondences.
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
ConvergenceCriteria represents an abstract base class for different convergence criteria used in regi...
Defines functions, macros and traits for allocating and using memory.
double rotation_threshold_
The rotation threshold is the relative rotation between two iterations (as angle cosine).
double mse_threshold_absolute_
The absolute change from the previous MSE for the current set of correspondences.
DefaultConvergenceCriteria(const int &iterations, const Matrix4 &transform, const pcl::Correspondences &correspondences)
Empty constructor.