test_cad_to_pointcloud.cpp
Go to the documentation of this file.
1 
18 #include "CADToPointCloud.h"
19 #include "leica_scanstation_utils/LeicaUtils.h"
20 #include <gtest/gtest.h>
21 
22 
23 // Test CADToPointCloud constructor should return success
24 TEST(TestCADToPointCloud, testPLY)
25 {
26  std::string cad_folder_path = ros::package::getPath("leica_point_cloud_processing");
27  std::string file_name = cad_folder_path + "/test/cube.ply";
28 
29  int sample_points = 10000;
30 
31  PointCloudRGB::Ptr cubeRGB {new PointCloudRGB};
32 
33  CADToPointCloud cad2pc(file_name, sample_points);
34  cad2pc.convertCloud(cubeRGB);
35 
36  ASSERT_TRUE(Utils::isValidCloud(cubeRGB));
37  ASSERT_GT(cubeRGB->size(),1);
38 }
39 
40 // Test CADToPointCloud constructor should return success
41 TEST(TestCADToPointCloud, testOBJ)
42 {
43  std::string cad_folder_path = ros::package::getPath("leica_point_cloud_processing");
44  std::string file_name = cad_folder_path + "/test/cube.ply";
45 
46  int sample_points = 10000;
47 
48  PointCloudRGB::Ptr cubeRGB {new PointCloudRGB};
49 
50  CADToPointCloud cad2pc(file_name, sample_points);
51  cad2pc.convertCloud(cubeRGB);
52 
53  ASSERT_TRUE(Utils::isValidCloud(cubeRGB));
54  ASSERT_GT(cubeRGB->size(),1);
55 }
56 
57 // Run all the tests that were declared with TEST()
58 int main(int argc, char **argv){
59  testing::InitGoogleTest(&argc, argv);
60 
61  return RUN_ALL_TESTS();
62 }
pcl::PointCloud< pcl::PointXYZRGB > PointCloudRGB
TEST(TestCADToPointCloud, testPLY)
static bool isValidCloud(PointCloudXYZ::Ptr cloud)
Check whether cloud contains data and is not empty.
Definition: Utils.cpp:46
int main(int argc, char **argv)
This class is used to obtain pcl::PointCloud from CAD file. Supported formats: .OBJ.
ROSLIB_DECL std::string getPath(const std::string &package_name)
void convertCloud(PointCloudRGB::Ptr cloud)
convert cloud defined by path in construstor into cloud


leica_point_cloud_processing
Author(s): Ines Lara Sicilia
autogenerated on Fri Feb 5 2021 03:20:30