Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions test/surface/test_moving_least_squares.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,35 @@ PointCloud<PointNormal>::Ptr cloud_with_normals1 (new PointCloud<PointNormal>);
search::KdTree<PointXYZ>::Ptr tree3;
search::KdTree<PointNormal>::Ptr tree4;

PointCloud<PointXYZ>::Ptr cloud_almost_on_line(new PointCloud<PointXYZ>);

TEST(PCL, MovingLeastSquares_almost_on_line)
{
cloud_almost_on_line->push_back(pcl::PointXYZ(-89.546, 4.03964, 450.883));
cloud_almost_on_line->push_back(pcl::PointXYZ(-88.8728, 4.03964, 450.883));
cloud_almost_on_line->push_back(pcl::PointXYZ(-86.8529, 4.03964, 450.883));
cloud_almost_on_line->push_back(pcl::PointXYZ(-85.5064, 4.03964, 450.883));
Comment on lines +64 to +71

// Init objects
PointCloud<PointXYZ> mls_points;
MovingLeastSquares<PointXYZ, PointXYZ> mls;

// Set parameters
mls.setInputCloud(cloud_almost_on_line);
mls.setSearchRadius(4.65032);
mls.setUpsamplingMethod(MovingLeastSquares<PointXYZ, PointXYZ>::SAMPLE_LOCAL_PLANE);
mls.setUpsamplingRadius(0.8);
mls.setUpsamplingStepSize(0.4);

// Reconstruct
mls.process(mls_points);

for (size_t i = 0; i < mls_points.size(); ++i) {
// Check for NaNs in output
EXPECT_TRUE(pcl::isFinite(mls_points[i]));
Comment on lines +87 to +89
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (size_t i = 0; i < mls_points.size(); ++i) {
// Check for NaNs in output
EXPECT_TRUE(pcl::isFinite(mls_points[i]));
for (const auto& mls_point : mls_points) {
// Check for NaNs in output
EXPECT_TRUE(pcl::isFinite(mls_point));

Suggested by clang-tidy

}
Comment on lines +84 to +90
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TEST (PCL, MovingLeastSquares)
{
Expand Down
Loading