24 icp.transformationCheckers.clear();
33 PM::get().TransformationCheckerRegistrar.create(name, params);
35 icp.transformationCheckers.push_back(transformCheck);
42 addFilter(
"CounterTransformationChecker", {{
"maxIterationCount",
toParam(20)}});
43 validate2dTransformation();
48 addFilter(
"DifferentialTransformationChecker", {
49 {
"minDiffRotErr",
toParam(0.001)},
50 {
"minDiffTransErr",
toParam(0.001)},
54 validate2dTransformation();
62 std::shared_ptr<PM::TransformationChecker> extraTransformCheck;
64 extraTransformCheck =
PM::get().TransformationCheckerRegistrar.create(
65 "CounterTransformationChecker"
67 icp.transformationCheckers.push_back(extraTransformCheck);
69 addFilter(
"BoundTransformationChecker", {
70 {
"maxRotationNorm",
toParam(1.0)},
71 {
"maxTranslationNorm",
toParam(1.0)}
74 validate2dTransformation();
80 TEST(Transformation, RigidTransformation)
82 std::shared_ptr<PM::Transformation> rigidTrans;
83 rigidTrans =
PM::get().REG(Transformation).create(
"RigidTransformation");
90 T_3D << 0.99935116, 0.13669771, 0.03436585, 1.71138524,
91 -0.02633967, 0.99326295, -0.04907545, -0.10860933,
92 -0.03615132, 0.04400287, 0.99820427, -0.04454497,
100 for(
int i = 0; i < 10; i++)
102 T_3D = rigidTrans->correctParameters(T_3D);
108 PM::Matrix T_2D_non_ortho = PM::Matrix::Identity(3,3);
109 T_2D_non_ortho(0,0) = 0.8;
110 T_2D_non_ortho(0,1) = -0.5;
111 T_2D_non_ortho(1,0) = 0.5;
112 T_2D_non_ortho(1,1) = 0.8;
114 EXPECT_FALSE(rigidTrans->checkParameters(T_2D_non_ortho));
119 for(
int i = 0; i < 10; i++)
121 T_2D_non_ortho = rigidTrans->correctParameters(T_2D_non_ortho);
122 EXPECT_TRUE(rigidTrans->checkParameters(T_2D_non_ortho));
127 PM::Matrix T_2D_reflection = PM::Matrix::Identity(3,3);
128 T_2D_reflection(1,1) = -1;