iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::StandardConvergenceCriteria Class Reference

#include <nrt/PointCloud2/Registration/Convergence/StandardConvergenceCriteria.H>

A standard convergence criteria.

This convergence criteria implements the following requirements for convergence (any one is enough to converge): some maximum number of iterations the transform from source to target cannot be updated (difference between current and previous is less than some threshold) the mean squared error (MSE) between the current set of correspondences and the previous is smaller than some threshold

tests/test-PointCloud2OpenNI.C, and tests/test-PointCloud2Registration.C.

Definition at line 49 of file StandardConvergenceCriteria.H.

Inherits nrt::ConvergenceCriteriaBase.

Public Types

enum  ConvergenceState {
  not_converged, max_iterations, transform, absolute_mse,
 Represents the current state of the convergence.
- Public Types inherited from nrt::ConvergenceCriteriaBase
typedef std::shared_ptr
< ConvergenceCriteriaBase > 
 Convenience typedef for shared ptr to this.

Public Member Functions

 StandardConvergenceCriteria (size_t maxIterations=100, bool failAfterMaxIterations=false, double rotationThreshold=0.99999, double translationThreshold=0.0003, double relativeMSE=0.00001, double absoluteMSE=1e-12, size_t maxSimilarTransforms=0)
 Create a standard convergence criteria. More...
bool converged (size_t const iteration, PointCloud2::AffineTransform const &transform, Correspondences const correspondences)
 Check whether we have converged. More...
ConvergenceState getConvergenceState () const
 Get our convergence state.
void reset ()
 Resets any internal state associated with determining convergence.
size_t maxIterations () const
 Gets the maximum number of iterations for convergence.
- Public Member Functions inherited from nrt::ConvergenceCriteriaBase
virtual ~ConvergenceCriteriaBase ()
 Virtual destruction.
virtual bool converged (size_t const iteration, AffineTransform const &transform, Correspondences const correspondences)=0
 Check whether we have converged. More...
virtual void reset ()=0
 Resets any internal state associated with determining convergence.
virtual size_t maxIterations () const =0
 Gets the maximum number of iterations for convergence.

Protected Member Functions

double calculateMSE (Correspondences const &c) const
 Computes an MSE score.

Constructor & Destructor Documentation

nrt::StandardConvergenceCriteria::StandardConvergenceCriteria ( size_t  maxIterations = 100,
bool  failAfterMaxIterations = false,
double  rotationThreshold = 0.99999,
double  translationThreshold = 0.0003,
double  relativeMSE = 0.00001,
double  absoluteMSE = 1e-12,
size_t  maxSimilarTransforms = 0 

Create a standard convergence criteria.

Initializes a standard convergence with several default parameters

[in]maxIterationsMaximum number of iterations
[in]failAfterMaxIterationsWhether it is considered a failure to converge after the max iterations is reached.
[in]rotationThresholdThe rotation threshold (default value is equivalent to 0.256 degrees)
[in]translationThresholdThe translation threshold in meters
[in]relativeMSERelative MSE threshold, in the range[0,1]
[in]absoluteMSEAbsolute MSE threshold
[in]maxSimilarTransformsMaximum number of consecutive similar transforms from either MSE or transform scores required for convergence from either of these methods

Member Function Documentation

bool nrt::StandardConvergenceCriteria::converged ( size_t const  iteration,
PointCloud2::AffineTransform const &  transform,
Correspondences const  correspondences 

Check whether we have converged.

[in]iterationCurrent iteration of the optimization
[in]transformCurrent transform estimated by the optimization
[in]correspondencesThe current set of correspondences
Whether convergence has been reached

The documentation for this class was generated from the following file: