20 #include "leica_scanstation_utils/LeicaUtils.h" 22 #include <gtest/gtest.h> 43 std::string
f = pkg_path +
"/test/cube.ply";
45 int sample_points = 20000;
57 ASSERT_EQ(tf, Eigen::Matrix4f::Identity());
59 initial_alignment.
run();
63 double tolerance = 1e-3;
75 ASSERT_EQ(tf, Eigen::Matrix4f::Identity());
77 initial_alignment.
run();
81 double translation = 0.05;
82 double tolerance = 1e-3;
84 EXPECT_TRUE(abs(tf.col(3)[0]-translation) <= tolerance);
85 EXPECT_TRUE(abs(tf.col(3)[1]-translation) <= tolerance);
86 EXPECT_TRUE(abs(tf.col(3)[2]-translation) <= tolerance);
93 initial_alignment.
run();
96 double translation = 0.05;
97 double tolerance = 1e-3;
99 EXPECT_TRUE(abs(tf.col(3)[0]-translation) <= tolerance);
100 EXPECT_TRUE(abs(tf.col(3)[1]-translation) <= tolerance);
101 EXPECT_TRUE(abs(tf.col(3)[2]-translation) <= tolerance);
108 initial_alignment.
run();
111 double translation = 0.05;
112 double tolerance = 1e-3;
114 EXPECT_TRUE(abs(tf.col(3)[0]-translation) <= tolerance);
115 EXPECT_TRUE(abs(tf.col(3)[1]-translation) <= tolerance);
116 EXPECT_TRUE(abs(tf.col(3)[2]-translation) <= tolerance);
123 initial_alignment.
run();
126 double translation = 0.05;
127 double tolerance = 1e-3;
129 EXPECT_TRUE(abs(tf.col(3)[0]-translation) <= tolerance);
130 EXPECT_TRUE(abs(tf.col(3)[1]-translation) <= tolerance);
131 EXPECT_TRUE(abs(tf.col(3)[2]-translation) <= tolerance);
141 int main(
int argc,
char **argv){
142 testing::InitGoogleTest(&argc, argv);
143 return RUN_ALL_TESTS();
pcl::PointCloud< pcl::PointXYZRGB > PointCloudRGB
int main(int argc, char **argv)
PointCloudRGB::Ptr cloudRGB
PointCloudRGB::Ptr sourceRGB
void run()
Perform initial alignment.
pcl::PointCloud< pcl::PointXYZRGB > PointCloudRGB
Eigen::Matrix4f getRigidTransform()
Get the rigid transform object.
void applyTFtoCloud(PointCloudRGB::Ptr cloud)
Once initial alignment is finished, apply rigid transformation to given cloud.
This class is used to obtain pcl::PointCloud from CAD file. Supported formats: .OBJ.
ROSLIB_DECL std::string getPath(const std::string &package_name)
static void translateCloud(PointCloudRGB::Ptr cloud_in, PointCloudRGB::Ptr cloud_out, double x_offset=0, double y_offset=0, double z_offset=0)
Apply translation to Cloud. Values given in [m].
void convertCloud(PointCloudRGB::Ptr cloud)
convert cloud defined by path in construstor into cloud
void cubePointCloud(PointCloudRGB::Ptr cloud)
void setMethod(AlignmentMethod method)
Set the AlignmentMethod object.
PointCloudRGB::Ptr targetRGB
TEST_F(TestInitialAlignment, testApplyTF)