TransformationCheckersImpl.h
Go to the documentation of this file.
1 // kate: replace-tabs off; indent-width 4; indent-mode normal
2 // vim: ts=4:sw=4:noexpandtab
3 /*
4 
5 Copyright (c) 2010--2012,
6 François Pomerleau and Stephane Magnenat, ASL, ETHZ, Switzerland
7 You can contact the authors at <f dot pomerleau at gmail dot com> and
8 <stephane at magnenat dot net>
9 
10 All rights reserved.
11 
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions are met:
14  * Redistributions of source code must retain the above copyright
15  notice, this list of conditions and the following disclaimer.
16  * Redistributions in binary form must reproduce the above copyright
17  notice, this list of conditions and the following disclaimer in the
18  documentation and/or other materials provided with the distribution.
19  * Neither the name of the <organization> nor the
20  names of its contributors may be used to endorse or promote products
21  derived from this software without specific prior written permission.
22 
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 DISCLAIMED. IN NO EVENT SHALL ETH-ASL BE LIABLE FOR ANY
27 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34 */
35 
36 #ifndef __POINTMATCHER_TRANSFORMATIONCHECKERS_H
37 #define __POINTMATCHER_TRANSFORMATIONCHECKERS_H
38 
39 #include "PointMatcher.h"
40 
41 template<typename T>
43 {
49 
52  typedef typename PointMatcher<T>::Vector Vector;
56  typedef typename PointMatcher<T>::Matrix Matrix;
57 
59  {
62 
63  inline static const std::string description()
64  {
65  return "This checker stops the ICP loop after a certain number of iterations.";
66  }
67  inline static const ParametersDoc availableParameters()
68  {
69  return {
70  {"maxIterationCount", "maximum number of iterations ", "40", "0", "2147483647", &P::Comp<unsigned>}
71  };
72  }
73 
74  const unsigned maxIterationCount;
75 
77  virtual void init(const TransformationParameters& parameters, bool& iterate);
78  virtual void check(const TransformationParameters& parameters, bool& iterate);
79  };
80 
82  {
83  inline static const std::string description()
84  {
85  return "This checker stops the ICP loop when the relative motions (i.e. abs(currentIter - lastIter)) of rotation and translation components are below a fix thresholds. This allows to stop the iteration when the point cloud is stabilized. Smoothing can be applied to avoid oscillations. Inspired by \\cite{Chetverikov2002Trimmed}.";
86  }
87  inline static const ParametersDoc availableParameters()
88  {
89  return {
90  {"minDiffRotErr", "threshold for rotation error (radian)", "0.001", "0.", "6.2831854", &P::Comp<T>},
91  {"minDiffTransErr", "threshold for translation error", "0.001", "0.", "inf", &P::Comp<T>},
92  {"smoothLength", "number of iterations over which to average the differencial error", "3", "0", "2147483647", &P::Comp<unsigned>}
93  };
94  }
95 
98  const unsigned int smoothLength;
99 
100  protected:
103 
104  public:
106 
107  virtual void init(const TransformationParameters& parameters, bool& iterate);
108  virtual void check(const TransformationParameters& parameters, bool& iterate);
109  };
110 
112  {
113  inline static const std::string description()
114  {
115  return "This checker stops the ICP loop with an exception when the transformation values exceed bounds.";
116  }
117  inline static const ParametersDoc availableParameters()
118  {
119  return {
120  {"maxRotationNorm", "rotation bound", "1", "0", "inf", &P::Comp < T > },
121  {"maxTranslationNorm", "translation bound", "1", "0", "inf", &P::Comp < T > }
122  };
123  }
124 
127 
128  protected:
132 
133  public:
134  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
136  virtual void init(const TransformationParameters& parameters, bool& iterate);
137  virtual void check(const TransformationParameters& parameters, bool& iterate);
138  };
139 }; // TransformationCheckersImpl
140 
141 #endif // __POINTMATCHER_TRANSFORMATIONCHECKERS_H
TransformationCheckersImpl
Definition: TransformationCheckersImpl.h:42
TransformationCheckersImpl::CounterTransformationChecker::MaxNumIterationsReached
Struct used to inform through an exeption that ICP reached max number of iterations.
Definition: TransformationCheckersImpl.h:61
PointMatcher::VectorVector
std::vector< Vector, Eigen::aligned_allocator< Vector > > VectorVector
A vector of vector over ScalarType, not a matrix.
Definition: PointMatcher.h:163
TransformationCheckersImpl::BoundTransformationChecker::initialRotation3D
Quaternion initialRotation3D
Definition: TransformationCheckersImpl.h:129
build_map.T
T
Definition: build_map.py:34
TransformationCheckersImpl::CounterTransformationChecker::check
virtual void check(const TransformationParameters &parameters, bool &iterate)
Set iterate to false if iteration should stop.
Definition: TransformationCheckersImpl.cpp:64
TransformationCheckersImpl::BoundTransformationChecker::availableParameters
static const ParametersDoc availableParameters()
Definition: TransformationCheckersImpl.h:117
TransformationCheckersImpl::Vector
PointMatcher< T >::Vector Vector
Definition: TransformationCheckersImpl.h:52
TransformationCheckersImpl::BoundTransformationChecker::check
virtual void check(const TransformationParameters &parameters, bool &iterate)
Set iterate to false if iteration should stop.
Definition: TransformationCheckersImpl.cpp:198
TransformationCheckersImpl::BoundTransformationChecker::initialTranslation
Vector initialTranslation
Definition: TransformationCheckersImpl.h:131
TransformationCheckersImpl::CounterTransformationChecker::CounterTransformationChecker
CounterTransformationChecker(const Parameters &params=Parameters())
Definition: TransformationCheckersImpl.cpp:46
TransformationCheckersImpl::QuaternionVector
PointMatcher< T >::QuaternionVector QuaternionVector
Definition: TransformationCheckersImpl.h:55
TransformationCheckersImpl::ParameterDoc
Parametrizable::ParameterDoc ParameterDoc
Definition: TransformationCheckersImpl.h:47
PointMatcher::QuaternionVector
std::vector< Quaternion, Eigen::aligned_allocator< Quaternion > > QuaternionVector
A vector of quaternions over ScalarType.
Definition: PointMatcher.h:167
testing::internal::string
::std::string string
Definition: gtest.h:1979
TransformationCheckersImpl::DifferentialTransformationChecker::init
virtual void init(const TransformationParameters &parameters, bool &iterate)
Init, set iterate to false if iteration should stop.
Definition: TransformationCheckersImpl.cpp:103
TransformationCheckersImpl::ParametersDoc
Parametrizable::ParametersDoc ParametersDoc
Definition: TransformationCheckersImpl.h:48
TransformationCheckersImpl::Quaternion
PointMatcher< T >::Quaternion Quaternion
Definition: TransformationCheckersImpl.h:54
TransformationCheckersImpl::BoundTransformationChecker::initialRotation2D
T initialRotation2D
Definition: TransformationCheckersImpl.h:130
TransformationCheckersImpl::BoundTransformationChecker::maxTranslationNorm
const T maxTranslationNorm
Definition: TransformationCheckersImpl.h:126
TransformationCheckersImpl::DifferentialTransformationChecker
Definition: TransformationCheckersImpl.h:81
TransformationCheckersImpl::DifferentialTransformationChecker::minDiffTransErr
const T minDiffTransErr
Definition: TransformationCheckersImpl.h:97
PointMatcherSupport::Parametrizable::ParametersDoc
std::vector< ParameterDoc > ParametersDoc
The documentation of all parameters.
Definition: Parametrizable.h:187
align_sequence.params
params
Definition: align_sequence.py:13
TransformationCheckersImpl::VectorVector
PointMatcher< T >::VectorVector VectorVector
Definition: TransformationCheckersImpl.h:53
TransformationCheckersImpl::Matrix
PointMatcher< T >::Matrix Matrix
Definition: TransformationCheckersImpl.h:56
PointMatcherSupport::Parametrizable::parameters
Parameters parameters
parameters with their values encoded in string
Definition: Parametrizable.h:204
PointMatcher::Matrix
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dense matrix over ScalarType.
Definition: PointMatcher.h:169
PointMatcher::TransformationChecker
A transformation checker can stop the iteration depending on some conditions.
Definition: PointMatcher.h:583
TransformationCheckersImpl::TransformationParameters
PointMatcher< T >::TransformationParameters TransformationParameters
Definition: TransformationCheckersImpl.h:51
TransformationCheckersImpl::CounterTransformationChecker::availableParameters
static const ParametersDoc availableParameters()
Definition: TransformationCheckersImpl.h:67
PointMatcher::Vector
Eigen::Matrix< T, Eigen::Dynamic, 1 > Vector
A vector over ScalarType.
Definition: PointMatcher.h:161
TransformationCheckersImpl::BoundTransformationChecker::BoundTransformationChecker
EIGEN_MAKE_ALIGNED_OPERATOR_NEW BoundTransformationChecker(const Parameters &params=Parameters())
Definition: TransformationCheckersImpl.cpp:167
TransformationCheckersImpl::TransformationChecker
PointMatcher< T >::TransformationChecker TransformationChecker
Definition: TransformationCheckersImpl.h:50
TransformationCheckersImpl::DifferentialTransformationChecker::description
static const std::string description()
Definition: TransformationCheckersImpl.h:83
TransformationCheckersImpl::CounterTransformationChecker::description
static const std::string description()
Definition: TransformationCheckersImpl.h:63
TransformationCheckersImpl::CounterTransformationChecker
Definition: TransformationCheckersImpl.h:58
PointMatcherSupport::Parametrizable
The superclass of classes that are constructed using generic parameters. This class provides the para...
Definition: Parametrizable.h:141
TransformationCheckersImpl::P
PointMatcherSupport::Parametrizable P
Definition: TransformationCheckersImpl.h:45
TransformationCheckersImpl::BoundTransformationChecker
Definition: TransformationCheckersImpl.h:111
PointMatcherSupport::Parametrizable::ParameterDoc
The documentation of a parameter.
Definition: Parametrizable.h:160
TransformationCheckersImpl::BoundTransformationChecker::description
static const std::string description()
Definition: TransformationCheckersImpl.h:113
TransformationCheckersImpl::CounterTransformationChecker::init
virtual void init(const TransformationParameters &parameters, bool &iterate)
Init, set iterate to false if iteration should stop.
Definition: TransformationCheckersImpl.cpp:58
TransformationCheckersImpl::DifferentialTransformationChecker::translations
VectorVector translations
Definition: TransformationCheckersImpl.h:102
TransformationCheckersImpl::CounterTransformationChecker::maxIterationCount
const unsigned maxIterationCount
Definition: TransformationCheckersImpl.h:74
PointMatcher.h
public interface
TransformationCheckersImpl::DifferentialTransformationChecker::availableParameters
static const ParametersDoc availableParameters()
Definition: TransformationCheckersImpl.h:87
TransformationCheckersImpl::DifferentialTransformationChecker::DifferentialTransformationChecker
DifferentialTransformationChecker(const Parameters &params=Parameters())
Definition: TransformationCheckersImpl.cpp:85
TransformationCheckersImpl::Parameters
Parametrizable::Parameters Parameters
Definition: TransformationCheckersImpl.h:46
TransformationCheckersImpl::DifferentialTransformationChecker::minDiffRotErr
const T minDiffRotErr
Definition: TransformationCheckersImpl.h:96
TransformationCheckersImpl::Parametrizable
PointMatcherSupport::Parametrizable Parametrizable
Definition: TransformationCheckersImpl.h:44
TransformationCheckersImpl::DifferentialTransformationChecker::check
virtual void check(const TransformationParameters &parameters, bool &iterate)
Set iterate to false if iteration should stop.
Definition: TransformationCheckersImpl.cpp:127
PointMatcher::Quaternion
Eigen::Quaternion< T > Quaternion
A quaternion over ScalarType.
Definition: PointMatcher.h:165
PointMatcherSupport::Parametrizable::Parameters
std::map< std::string, Parameter > Parameters
Parameters stored as a map of string->string.
Definition: Parametrizable.h:199
TransformationCheckersImpl::BoundTransformationChecker::init
virtual void init(const TransformationParameters &parameters, bool &iterate)
Init, set iterate to false if iteration should stop.
Definition: TransformationCheckersImpl.cpp:183
PointMatcher::TransformationParameters
Matrix TransformationParameters
A matrix holding the parameters a transformation.
Definition: PointMatcher.h:182
TransformationCheckersImpl::DifferentialTransformationChecker::rotations
QuaternionVector rotations
Definition: TransformationCheckersImpl.h:101
TransformationCheckersImpl::DifferentialTransformationChecker::smoothLength
const unsigned int smoothLength
Definition: TransformationCheckersImpl.h:98
TransformationCheckersImpl::BoundTransformationChecker::maxRotationNorm
const T maxRotationNorm
Definition: TransformationCheckersImpl.h:125


libpointmatcher
Author(s):
autogenerated on Mon Jan 1 2024 03:24:43