Skip to content

Commit

Permalink
Fix GICP6D test
Browse files Browse the repository at this point in the history
M_PI/0.1 would mean 10*M_PI or 5 times 360 degrees. GICP can't reliably find the correct solution for such large rotations (it might e.g. align the object upside down).
When using 0.25*M_PI (45 degrees), the transformation is the correct one, and we can even tighten the error threshold to 1e-4
  • Loading branch information
mvieth committed Oct 2, 2023
1 parent d3d35d3 commit 1334a27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/registration/test_registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ TEST (PCL, GeneralizedIterativeClosestPoint6D)
PointCloud<PointT>::Ptr src_full (new PointCloud<PointT>);
copyPointCloud (cloud_with_color, *src_full);
PointCloud<PointT>::Ptr tgt_full (new PointCloud<PointT>);
sampleRandomTransform (delta_transform, M_PI/0.1, .03);
sampleRandomTransform (delta_transform, 0.25*M_PI, .03);
pcl::transformPointCloud (cloud_with_color, *tgt_full, delta_transform);
PointCloud<PointT> output;

Expand All @@ -616,7 +616,7 @@ TEST (PCL, GeneralizedIterativeClosestPoint6D)
// Register
reg.align (output);
EXPECT_EQ (output.size (), src->size ());
EXPECT_LT (reg.getFitnessScore (), 0.003);
EXPECT_LT (reg.getFitnessScore (), 1e-4);

// Check again, for all possible caching schemes
for (int iter = 0; iter < 4; iter++)
Expand All @@ -637,7 +637,7 @@ TEST (PCL, GeneralizedIterativeClosestPoint6D)
// Register
reg.align (output);
EXPECT_EQ (output.size (), src->size ());
EXPECT_LT (reg.getFitnessScore (), 0.003);
EXPECT_LT (reg.getFitnessScore (), 1e-4);
}
}

Expand Down

0 comments on commit 1334a27

Please sign in to comment.