/////////////////////////////////////////////////////////////////////////////////////////////////////////////
| 56 | |
| 57 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 58 | TEST (PCL, BOARDLocalReferenceFrameEstimation) |
| 59 | { |
| 60 | PointCloud<Normal>::Ptr normals (new PointCloud<Normal> ()); |
| 61 | PointCloud<ReferenceFrame> bunny_LRF; |
| 62 | |
| 63 | pcl::IndicesPtr indicesptr (new pcl::Indices (indices)); |
| 64 | |
| 65 | // Compute normals |
| 66 | NormalEstimation<PointXYZ, Normal> ne; |
| 67 | |
| 68 | ne.setRadiusSearch (0.01); |
| 69 | ne.setViewPoint (1, 1, 10); |
| 70 | ne.setInputCloud (cloud.makeShared ()); |
| 71 | ne.setSearchMethod (tree); |
| 72 | ne.setIndices (indicesptr); |
| 73 | |
| 74 | ne.compute (*normals); |
| 75 | |
| 76 | // Compute BOARD LRF |
| 77 | BOARDLocalReferenceFrameEstimation<PointXYZ, Normal, ReferenceFrame> lrf_estimator; |
| 78 | |
| 79 | float meshRes = 0.001f; |
| 80 | |
| 81 | lrf_estimator.setFindHoles (true); |
| 82 | lrf_estimator.setRadiusSearch (15 * meshRes); |
| 83 | lrf_estimator.setTangentRadius (15 * meshRes); |
| 84 | |
| 85 | lrf_estimator.setInputCloud (cloud.makeShared ()); |
| 86 | lrf_estimator.setInputNormals (normals); |
| 87 | lrf_estimator.setSearchMethod (tree); |
| 88 | lrf_estimator.setIndices (indicesptr); |
| 89 | |
| 90 | lrf_estimator.compute (bunny_LRF); |
| 91 | |
| 92 | // TESTS |
| 93 | EXPECT_EQ (indices.size (), bunny_LRF.size ()); |
| 94 | |
| 95 | EXPECT_FALSE (bunny_LRF.is_dense); |
| 96 | //EXPECT_EQ (std::numeric_limits<float>::max (), bunny_LRF.at (24).confidence); |
| 97 | EXPECT_TRUE (std::isnan (bunny_LRF.at (24).x_axis[0])); |
| 98 | |
| 99 | // Expected Results |
| 100 | //float point_15_conf = -9.06301; |
| 101 | Eigen::Vector3f point_15_x (-0.784923f, 0.208529f, 0.583448f); |
| 102 | Eigen::Vector3f point_15_y (0.334206f, -0.650436f, 0.682085f); |
| 103 | Eigen::Vector3f point_15_z (0.52173f, 0.730376f, 0.440851f); |
| 104 | |
| 105 | //float point_45_conf = -9.55398; |
| 106 | Eigen::Vector3f point_45_x (0.909111f, 0.30943f, 0.278874f); |
| 107 | Eigen::Vector3f point_45_y (-0.362239f, 0.917811f, 0.162501f); |
| 108 | Eigen::Vector3f point_45_z (-0.205671f, -0.248751f, 0.946479f); |
| 109 | |
| 110 | //float point_163_conf = -9.04891; |
| 111 | Eigen::Vector3f point_163_x (-0.443962f, -0.890073f, -0.103285f); |
| 112 | Eigen::Vector3f point_163_y (0.746929f, -0.30394f, -0.591369f); |
| 113 | Eigen::Vector3f point_163_z (0.494969f, -0.339693f, 0.799759f); |
| 114 | |
| 115 | //float point_253_conf = -9.09443; |
nothing calls this directly
no test coverage detected