8#include <gtest/gtest.h>
25 source_cloud = std::make_shared<pcl::PointCloud<pcl::PointXYZI>>();
26 source_cloud->points.push_back(pcl::PointXYZI{3, -3, 0, 0});
27 source_cloud->points.push_back(pcl::PointXYZI{2, -4, 0, 0});
28 source_cloud->points.push_back(pcl::PointXYZI{4, -4, 0, 0});
38 ICP icp(
"../../src/perception/test/icp/icp_tests/basic_cloud.pcd", 0.1, 50, 1e-8, 1);
39 const pcl::PointCloud<pcl::PointXYZI>::Ptr target_cloud =
40 std::make_shared<pcl::PointCloud<pcl::PointXYZI>>();
41 ASSERT_NO_THROW(icp.
executeICP(source_cloud, target_cloud));
48 ICP icp(
"../../src/perception/test/icp/icp_tests/basic_cloud.pcd", 100.0, 300, 5, 5);
50 const pcl::PointCloud<pcl::PointXYZI>::Ptr aligned_cloud =
51 std::make_shared<pcl::PointCloud<pcl::PointXYZI>>();
52 const double fitness_score = icp.
executeICP(source_cloud, aligned_cloud);
55 ASSERT_GE(fitness_score, 0);
62 ICP icp(
"../../src/perception/test/icp/icp_tests/basic_cloud.pcd", 1.0, 50, 1e-8, 5);
64 const pcl::PointCloud<pcl::PointXYZI>::Ptr aligned_cloud =
65 std::make_shared<pcl::PointCloud<pcl::PointXYZI>>();
66 const double fitness_score = icp.
executeICP(source_cloud, aligned_cloud);
68 ASSERT_EQ(fitness_score, -1);
Class for performing Iterative Closest Point (ICP) registration.
double executeICP(pcl::PointCloud< pcl::PointXYZI >::Ptr source, pcl::PointCloud< pcl::PointXYZI >::Ptr final_cloud)
Execute the ICP registration.
Test suite for the ICP class.
pcl::PointCloud< pcl::PointXYZI >::Ptr source_cloud
void SetUp() override
Set up the test fixture.
TEST_F(ICPSuite, Initialization)
Test case to check if ICP initializes properly.