Transformations.cpp
Go to the documentation of this file.
1 #include "../utest.h"
2 
3 using namespace std;
4 using namespace PointMatcherSupport;
5 
6 static inline Eigen::Transform<NumericType, 2, Eigen::Affine> buildUpTransformation2D(const Eigen::Matrix<NumericType, 2, 1>& translation,
7  const Eigen::Rotation2D<NumericType>& rotation,
8  const NumericType scale = 1.0)
9 {
10  const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation =
11  Eigen::Translation<NumericType, 2>(translation) * rotation * Eigen::Scaling(scale);
12  return transformation;
13 }
14 
15 static inline Eigen::Transform<NumericType, 3, Eigen::Affine> buildUpTransformation3D(const Eigen::Matrix<NumericType, 3, 1>& translation,
16  const Eigen::Quaternion<NumericType>& rotation,
17  const NumericType scale = 1.0)
18 {
19  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation =
20  Eigen::Translation<NumericType, 3>(translation) * Eigen::AngleAxis<NumericType>(rotation.normalized()) * Eigen::Scaling(scale);
21  return transformation;
22 }
23 
25  std::shared_ptr<PM::Transformation>& transformator,
26  const NumericType kEpsilonNumericalError = 0)
27 {
28  // Transform point cloud.
29  auto transformedCloud = cloud;
30  transformator->inPlaceCompute(transformation, transformedCloud);
31  // Assert on the result.
32  // Transformation quality. 'Who tests the unit test?'
33  EXPECT_TRUE(transformator->checkParameters(transformation));
34  // Features.
35  for (size_t i = 0; i < cloud.getNbPoints(); ++i)
36  {
37  const auto transformedFeature = transformation * cloud.features.col(i);
38  EXPECT_TRUE(transformedFeature.isApprox(transformedCloud.features.col(i), kEpsilonNumericalError));
39  }
40 
41  // Descriptors.
42  int row(0);
43  const int descCols(cloud.descriptors.cols());
44  const unsigned int nbRows = transformation.rows() - 1;
45  const unsigned int nbCols = transformation.cols() - 1;
46  const PM::TransformationParameters R(transformation.topLeftCorner(nbRows, nbCols));
47  for (size_t i = 0; i < cloud.descriptorLabels.size(); ++i)
48  {
49  const int span(cloud.descriptorLabels[i].span);
50  const std::string& name(cloud.descriptorLabels[i].text);
51  if (name == "normals" || name == "observationDirections" || name == "orientationX" || name == "orientationY" || name == "orientationZ")
52  {
53  const auto transformedDescriptor = R * cloud.descriptors.block(row, 0, span, descCols);
54  EXPECT_TRUE(transformedDescriptor.isApprox(transformedCloud.descriptors.block(row, 0, span, descCols), kEpsilonNumericalError));
55  }
56  row += span;
57  }
58  EXPECT_EQ(cloud.featureLabels, transformedCloud.featureLabels);
59  EXPECT_EQ(cloud.descriptorLabels, transformedCloud.descriptorLabels);
60  EXPECT_EQ(cloud.timeLabels, transformedCloud.timeLabels);
61  EXPECT_TRUE(cloud.times.isApprox(transformedCloud.times, 0));
62 }
63 
64 //---------------------------
65 // Transformation Checker modules
66 //---------------------------
67 
68 // Utility classes
70 {
71 public:
72  std::shared_ptr<PM::TransformationChecker> transformCheck;
73 
74  // Will be called for every tests
75  virtual void SetUp()
76  {
77  icp.setDefault();
78  // Uncomment for consol outputs
79  //setLogger(PM::get().LoggerRegistrar.create("FileLogger"));
80 
81  icp.transformationCheckers.clear();
82  }
83 
84  // Will be called for every tests
85  virtual void TearDown() {}
86 
88  {
89  transformCheck = PM::get().TransformationCheckerRegistrar.create(name, params);
90 
91  icp.transformationCheckers.push_back(transformCheck);
92  }
93 };
94 
95 
96 TEST_F(TransformationCheckerTest, CounterTransformationChecker)
97 {
98  addFilter("CounterTransformationChecker", { { "maxIterationCount", toParam(20) } });
99  validate2dTransformation();
100 }
101 
102 TEST_F(TransformationCheckerTest, DifferentialTransformationChecker)
103 {
104  addFilter("DifferentialTransformationChecker",
105  { { "minDiffRotErr", toParam(0.001) }, { "minDiffTransErr", toParam(0.001) }, { "smoothLength", toParam(4) } });
106  validate2dTransformation();
107 }
108 
109 TEST_F(TransformationCheckerTest, BoundTransformationChecker)
110 {
111  // Since that transChecker is trigger when the distance is growing
112  // and that we do not expect that to happen in the test dataset, we
113  // keep the Counter to get out of the looop
114  std::shared_ptr<PM::TransformationChecker> extraTransformCheck;
115 
116  extraTransformCheck = PM::get().TransformationCheckerRegistrar.create("CounterTransformationChecker");
117  icp.transformationCheckers.push_back(extraTransformCheck);
118 
119  addFilter("BoundTransformationChecker", { { "maxRotationNorm", toParam(1.0) }, { "maxTranslationNorm", toParam(1.0) } });
120  validate2dTransformation();
121 }
122 
123 //---------------------------
124 // Transformation
125 //---------------------------
126 TEST(Transformation, RigidTransformationParameterCheck)
127 {
128  std::shared_ptr<PM::Transformation> rigidTrans;
129  rigidTrans = PM::get().REG(Transformation).create("RigidTransformation");
130 
131  //-------------------------------------
132  // Construct a 3D non-orthogonal matrix
133  PM::Matrix T_3D = PM::Matrix::Identity(4, 4);
134  //T_3D(0,0) = 2.3;
135  //T_3D(0,1) = 0.03;
136  T_3D << 0.99935116, 0.13669771, 0.03436585, 1.71138524, -0.02633967, 0.99326295, -0.04907545, -0.10860933, -0.03615132, 0.04400287,
137  0.99820427, -0.04454497, 0., 0., 0., 1.;
138 
139  EXPECT_FALSE(rigidTrans->checkParameters(T_3D));
140 
141  EXPECT_THROW(rigidTrans->compute(data3D, T_3D), TransformationError);
142 
143  // Check stability over iterations
144  for (int i = 0; i < 10; i++)
145  {
146  T_3D = rigidTrans->correctParameters(T_3D);
147  EXPECT_TRUE(rigidTrans->checkParameters(T_3D));
148  }
149 
150  //-------------------------------------
151  // Construct a 2D non-orthogonal matrix
152  PM::Matrix T_2D_non_ortho = PM::Matrix::Identity(3, 3);
153  T_2D_non_ortho(0, 0) = 0.8;
154  T_2D_non_ortho(0, 1) = -0.5;
155  T_2D_non_ortho(1, 0) = 0.5;
156  T_2D_non_ortho(1, 1) = 0.8;
157 
158  EXPECT_FALSE(rigidTrans->checkParameters(T_2D_non_ortho));
159 
160  EXPECT_THROW(rigidTrans->compute(data2D, T_2D_non_ortho), TransformationError);
161  EXPECT_THROW(rigidTrans->inPlaceCompute(T_2D_non_ortho, data2D), TransformationError);
162 
163  // Check stability over iterations
164  for (int i = 0; i < 10; i++)
165  {
166  T_2D_non_ortho = rigidTrans->correctParameters(T_2D_non_ortho);
167  EXPECT_TRUE(rigidTrans->checkParameters(T_2D_non_ortho));
168  }
169 
170  //-------------------------------------
171  // Construct a 2D reflection matrix
172  PM::Matrix T_2D_reflection = PM::Matrix::Identity(3, 3);
173  T_2D_reflection(1, 1) = -1;
174 
175  EXPECT_THROW(rigidTrans->correctParameters(T_2D_reflection), TransformationError);
176 }
177 
178 TEST(Transformation, ComputePureTranslationDataPoints2D)
179 {
180  std::shared_ptr<PM::Transformation> transformator = PM::get().REG(Transformation).create("PureTranslation");
181 
182  // Identity.
183  {
184  const Eigen::Matrix<NumericType, 2, 1> translation{ 0, 0 };
185  const Eigen::Rotation2D<NumericType> rotation{ 0 };
186  const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
187  // Transform and assert on the result.
188  assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
189  }
190  // Pure translation.
191  {
192  const Eigen::Matrix<NumericType, 2, 1> translation{ -1.0001, 34.5 };
193  const Eigen::Rotation2D<NumericType> rotation{ 0 };
194  const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
195  // Transform and assert on the result.
196  assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
197  }
198 }
199 
200 TEST(Transformation, ComputePureTranslationDataPoints3D)
201 {
202  std::shared_ptr<PM::Transformation> transformator = PM::get().REG(Transformation).create("PureTranslation");
203 
204  // Identity.
205  {
206  const Eigen::Matrix<NumericType, 3, 1> translation{ 0, 0, 0 };
207  const Eigen::Quaternion<NumericType> rotation{ 1, 0, 0, 0 };
208  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation);
209  // Transform and assert on the result.
210  assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
211  }
212 
213  // Pure translation.
214  {
215  const Eigen::Matrix<NumericType, 3, 1> translation{ -1.0001, 5, -12321.234 };
216  const Eigen::Quaternion<NumericType> rotation{ 1, 0, 0, 0 };
217  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation);
218  // Transform and assert on the result.
219  assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
220  }
221 }
222 
223 TEST(Transformation, ComputeRigidTransformDataPoints2D)
224 {
225  std::shared_ptr<PM::Transformation> transformator = PM::get().REG(Transformation).create("RigidTransformation");
226 
227  // Identity.
228  {
229  const Eigen::Matrix<NumericType, 2, 1> translation{ 0, 0 };
230  const Eigen::Rotation2D<NumericType> rotation{ 0 };
231  const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
232  // Transform and assert on the result.
233  assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
234  }
235  // Pure translation.
236  {
237  const Eigen::Matrix<NumericType, 2, 1> translation{ -1.0001, 34.5 };
238  const Eigen::Rotation2D<NumericType> rotation{ 0 };
239  const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
240  // Transform and assert on the result.
241  assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
242  }
243  // Pure rotation.
244  {
245  const Eigen::Matrix<NumericType, 2, 1> translation{ 0, 0 };
246  const Eigen::Rotation2D<NumericType> rotation{ 3.53453 };
247  const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
248  // Transform and assert on the result.
249  assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
250  }
251  // Translation + rotation.
252  {
253  const Eigen::Matrix<NumericType, 2, 1> translation{ -3.11, 100.222 };
254  const Eigen::Rotation2D<NumericType> rotation{ -123.3 };
255  const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation);
256  // Transform and assert on the result.
257  assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
258  }
259 }
260 
261 TEST(Transformation, ComputeRigidTransformDataPoints3D)
262 {
263  std::shared_ptr<PM::Transformation> transformator = PM::get().REG(Transformation).create("RigidTransformation");
264 
265  // Identity.
266  {
267  const Eigen::Matrix<NumericType, 3, 1> translation{ 0, 0, 0 };
268  const Eigen::Quaternion<NumericType> rotation{ 1, 0, 0, 0 };
269  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation);
270  // Transform and assert on the result.
271  assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
272  }
273 
274  // Pure translation.
275  {
276  const Eigen::Matrix<NumericType, 3, 1> translation{ -1.0001, 5, -12321.234 };
277  const Eigen::Quaternion<NumericType> rotation{ 1, 0, 0, 0 };
278  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation);
279  // Transform and assert on the result.
280  assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
281  }
282  // Pure rotation.
283  {
284  const Eigen::Matrix<NumericType, 3, 1> translation{ 0, 0, 0 };
285  const Eigen::Quaternion<NumericType> rotation{ 1, -5, 23, 0.5 };
286  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation);
287  // Transform and assert on the result.
288  assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator, 1e-7);
289  }
290  // Translation + rotation.
291  {
292  const Eigen::Matrix<NumericType, 3, 1> translation{ 1, -3, -4 };
293  const Eigen::Quaternion<NumericType> rotation{ 0, -2.54, 0, 0.5 };
294  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation);
295  // Transform and assert on the result.
296  assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator, 1e-7);
297  }
298 }
299 
300 TEST(Transformation, ComputeSimilarityTransformDataPoints2D)
301 {
302  std::shared_ptr<PM::Transformation> transformator = PM::get().REG(Transformation).create("SimilarityTransformation");
303 
304  // Identity.
305  {
306  const Eigen::Matrix<NumericType, 2, 1> translation{ 0, 0 };
307  const Eigen::Rotation2D<NumericType> rotation{ 0 };
308  const NumericType scale{ 1.0 };
309  const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
310  // Transform and assert on the result.
311  assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
312  }
313  // Pure Upscaling.
314  {
315  const Eigen::Matrix<NumericType, 2, 1> translation{ 0, 0 };
316  const Eigen::Rotation2D<NumericType> rotation{ 0 };
317  const NumericType scale{ 5.0 };
318  const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
319  // Transform and assert on the result.
320  assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
321  }
322  // Pure Downscaling.
323  {
324  const Eigen::Matrix<NumericType, 2, 1> translation{ 0, 0 };
325  const Eigen::Rotation2D<NumericType> rotation{ 0 };
326  const NumericType scale{ 0.1 };
327  const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
328  // Transform and assert on the result.
329  assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
330  }
331  // Pure translation + Downscaling.
332  {
333  const Eigen::Matrix<NumericType, 2, 1> translation{ -1.0001, 34.5 };
334  const Eigen::Rotation2D<NumericType> rotation{ 0 };
335  const NumericType scale{ 0.5 };
336  const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
337  // Transform and assert on the result.
338  assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
339  }
340  // Pure rotation + Upscaling.
341  {
342  const Eigen::Matrix<NumericType, 2, 1> translation{ 0, 0 };
343  const Eigen::Rotation2D<NumericType> rotation{ 3.53453 };
344  const NumericType scale{ 1.9 };
345  const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
346  // Transform and assert on the result.
347  assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
348  }
349  // Translation + rotation + Upscaling.
350  {
351  const Eigen::Matrix<NumericType, 2, 1> translation{ -3.11, 100.222 };
352  const Eigen::Rotation2D<NumericType> rotation{ -123.3 };
353  const NumericType scale{ 1.9 };
354  const Eigen::Transform<NumericType, 2, Eigen::Affine> transformation = buildUpTransformation2D(translation, rotation, scale);
355  // Transform and assert on the result.
356  assertOnDataPointsTransformation(data2D, transformation.matrix(), transformator);
357  }
358 }
359 
360 TEST(Transformation, ComputeSimilarityTransformDataPoints3D)
361 {
362  std::shared_ptr<PM::Transformation> transformator = PM::get().REG(Transformation).create("SimilarityTransformation");
363 
364  // Identity.
365  {
366  const Eigen::Matrix<NumericType, 3, 1> translation{ 0, 0, 0 };
367  const Eigen::Quaternion<NumericType> rotation{ 1, 0, 0, 0 };
368  const NumericType scale{ 1.0 };
369  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation, scale);
370  // Transform and assert on the result.
371  assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
372  }
373  // Pure Upscaling.
374  {
375  const Eigen::Matrix<NumericType, 3, 1> translation{ 0, 0, 0 };
376  const Eigen::Quaternion<NumericType> rotation{ 1, 0, 0, 0 };
377  const NumericType scale{ 5.0 };
378  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation, scale);
379  // Transform and assert on the result.
380  assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
381  }
382  // Pure Downscaling.
383  {
384  const Eigen::Matrix<NumericType, 3, 1> translation{ 0, 0, 0 };
385  const Eigen::Quaternion<NumericType> rotation{ 1, 0, 0, 0 };
386  const NumericType scale{ 0.1 };
387  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation, scale);
388  // Transform and assert on the result.
389  assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
390  }
391  // Pure translation + Downscaling.
392  {
393  const Eigen::Matrix<NumericType, 3, 1> translation{ -1.0001, 5, -12321.234 };
394  const Eigen::Quaternion<NumericType> rotation{ 1, 0, 0, 0 };
395  const NumericType scale{ 0.5 };
396  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation, scale);
397  // Transform and assert on the result.
398  assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator);
399  }
400  // Pure rotation + Upscaling.
401  {
402  const Eigen::Matrix<NumericType, 3, 1> translation{ 0, 0, 0 };
403  const Eigen::Quaternion<NumericType> rotation{ 1, -5, 23, 0.5 };
404  const NumericType scale{ 1.9 };
405  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation, scale);
406  // Transform and assert on the result.
407  assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator, 1e-7);
408  }
409  // Translation + rotation + Upscaling.
410  {
411  const Eigen::Matrix<NumericType, 3, 1> translation{ 1, -3, -4 };
412  const Eigen::Quaternion<NumericType> rotation{ 0, -2.54, 0, 0.5 };
413  const NumericType scale{ 1.9 };
414  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation, scale);
415  // Transform and assert on the result.
416  assertOnDataPointsTransformation(data3D, transformation.matrix(), transformator, 1e-7);
417  }
418 }
419 
420 TEST(Transformation, ComputeSimilarityTransformTrajectory3D)
421 {
422  DP trajectory = DP::load(dataPath + "trajectory.vtk");
423  std::shared_ptr<PM::Transformation> transformator = PM::get().REG(Transformation).create("SimilarityTransformation");
424 
425  // Identity.
426  {
427  const Eigen::Matrix<NumericType, 3, 1> translation{ 0, 0, 0 };
428  const Eigen::Quaternion<NumericType> rotation{ 1, 0, 0, 0 };
429  const NumericType scale{ 1.0 };
430  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation, scale);
431  // Transform and assert on the result.
432  assertOnDataPointsTransformation(trajectory, transformation.matrix(), transformator);
433  }
434  // Pure Upscaling.
435  {
436  const Eigen::Matrix<NumericType, 3, 1> translation{ 0, 0, 0 };
437  const Eigen::Quaternion<NumericType> rotation{ 1, 0, 0, 0 };
438  const NumericType scale{ 5.0 };
439  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation, scale);
440  // Transform and assert on the result.
441  assertOnDataPointsTransformation(trajectory, transformation.matrix(), transformator);
442  }
443  // Pure Downscaling.
444  {
445  const Eigen::Matrix<NumericType, 3, 1> translation{ 0, 0, 0 };
446  const Eigen::Quaternion<NumericType> rotation{ 1, 0, 0, 0 };
447  const NumericType scale{ 0.1 };
448  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation, scale);
449  // Transform and assert on the result.
450  assertOnDataPointsTransformation(trajectory, transformation.matrix(), transformator);
451  }
452  // Pure translation + Downscaling.
453  {
454  const Eigen::Matrix<NumericType, 3, 1> translation{ -1.0001, 5, -12321.234 };
455  const Eigen::Quaternion<NumericType> rotation{ 1, 0, 0, 0 };
456  const NumericType scale{ 0.5 };
457  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation, scale);
458  // Transform and assert on the result.
459  assertOnDataPointsTransformation(trajectory, transformation.matrix(), transformator);
460  }
461  // Pure rotation + Upscaling.
462  {
463  const Eigen::Matrix<NumericType, 3, 1> translation{ 0, 0, 0 };
464  const Eigen::Quaternion<NumericType> rotation{ 1, -5, 23, 0.5 };
465  const NumericType scale{ 1.9 };
466  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation, scale);
467  // Transform and assert on the result.
468  assertOnDataPointsTransformation(trajectory, transformation.matrix(), transformator, 1e-6);
469  }
470  // Translation + rotation + Upscaling.
471  {
472  const Eigen::Matrix<NumericType, 3, 1> translation{ 1, -3, -4 };
473  const Eigen::Quaternion<NumericType> rotation{ 0, -2.54, 0, 0.5 };
474  const NumericType scale{ 1.9 };
475  const Eigen::Transform<NumericType, 3, Eigen::Affine> transformation = buildUpTransformation3D(translation, rotation, scale);
476  // Transform and assert on the result.
477  assertOnDataPointsTransformation(trajectory, transformation.matrix(), transformator, 1e-6);
478  }
479 }
buildUpTransformation3D
static Eigen::Transform< NumericType, 3, Eigen::Affine > buildUpTransformation3D(const Eigen::Matrix< NumericType, 3, 1 > &translation, const Eigen::Quaternion< NumericType > &rotation, const NumericType scale=1.0)
Definition: Transformations.cpp:15
PointMatcher< float >::Parameters
Parametrizable::Parameters Parameters
alias
Definition: PointMatcher.h:186
PointMatcherSupport::toParam
std::string toParam(const S &value)
Return the string value using lexical_cast.
Definition: Parametrizable.h:123
assertOnDataPointsTransformation
static void assertOnDataPointsTransformation(const PM::DataPoints &cloud, const PM::TransformationParameters &transformation, std::shared_ptr< PM::Transformation > &transformator, const NumericType kEpsilonNumericalError=0)
Definition: Transformations.cpp:24
TransformationCheckerTest
Definition: Transformations.cpp:69
DataPoints
PM::DataPoints DataPoints
Definition: pypoint_matcher_helper.h:16
icp_customized.name
string name
Definition: icp_customized.py:45
icp.rotation
rotation
Definition: icp.py:74
TransformationCheckerTest::SetUp
virtual void SetUp()
Definition: Transformations.cpp:75
PointMatcher::DataPoints
A point cloud.
Definition: PointMatcher.h:207
TEST_F
TEST_F(TransformationCheckerTest, CounterTransformationChecker)
Definition: Transformations.cpp:96
EXPECT_TRUE
#define EXPECT_TRUE(condition)
Definition: gtest.h:19327
TransformationCheckerTest::transformCheck
std::shared_ptr< PM::TransformationChecker > transformCheck
Definition: Transformations.cpp:72
TransformationCheckerTest::addFilter
void addFilter(string name, PM::Parameters params)
Definition: Transformations.cpp:87
testing::internal::string
::std::string string
Definition: gtest.h:1979
IcpHelper
Definition: utest.h:32
icp.translation
translation
Definition: icp.py:73
EXPECT_EQ
#define EXPECT_EQ(expected, actual)
Definition: gtest.h:19747
PointMatcher::Transformation
A function that transforms points and their descriptors given a transformation matrix.
Definition: PointMatcher.h:404
EXPECT_FALSE
#define EXPECT_FALSE(condition)
Definition: gtest.h:19330
data2D
DP data2D
Definition: utest.cpp:46
align_sequence.params
params
Definition: align_sequence.py:13
TransformationCheckerTest::TearDown
virtual void TearDown()
Definition: Transformations.cpp:85
PointMatcher< float >::Matrix
Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dense matrix over ScalarType.
Definition: PointMatcher.h:169
TEST
TEST(Transformation, RigidTransformationParameterCheck)
Definition: Transformations.cpp:126
dataPath
std::string dataPath
Definition: utest.cpp:43
data3D
DP data3D
Definition: utest.cpp:48
NumericType
double NumericType
Definition: utest.h:15
std
build_map.transformation
transformation
Definition: build_map.py:37
icp
Definition: icp.py:1
EXPECT_THROW
#define EXPECT_THROW(statement, expected_exception)
Definition: gtest.h:19311
buildUpTransformation2D
static Eigen::Transform< NumericType, 2, Eigen::Affine > buildUpTransformation2D(const Eigen::Matrix< NumericType, 2, 1 > &translation, const Eigen::Rotation2D< NumericType > &rotation, const NumericType scale=1.0)
Definition: Transformations.cpp:6
PointMatcher< float >::get
static const PointMatcher & get()
Return instances.
Definition: Registry.cpp:146
PointMatcherSupport
Functions and classes that are not dependant on scalar type are defined in this namespace.
Definition: Bibliography.cpp:45
PointMatcherSupport::TransformationError
An expection thrown when a transformation has invalid parameters.
Definition: PointMatcher.h:89
PointMatcher::DataPoints::load
static DataPoints load(const std::string &fileName)
Load a point cloud from a file, determine format from extension.
Definition: pointmatcher/IO.cpp:375
PointMatcher< float >::TransformationParameters
Matrix TransformationParameters
A matrix holding the parameters a transformation.
Definition: PointMatcher.h:182


libpointmatcher
Author(s):
autogenerated on Mon Sep 16 2024 02:24:10