30TEST(ConeEvaluatorTest, CloseToGroundTrue) {
33 GroundGrid ground_grid(10.0, 1.0, 1.0, 0.0, 0.0, 360.0);
35 std::vector<std::array<float, 5>> pts = {{1.0, 2.0, 0.0, 0.1, 0}};
37 std::vector<int> indices = {0};
38 Cluster cluster(input_cloud, indices);
41 ASSERT_TRUE(
evaluator.close_to_ground(cluster, ground_grid));
47TEST(ConeEvaluatorTest, CloseToGroundFalse) {
50 GroundGrid ground_grid(10.0, 1.0, 1.0, 0.0, 0.0, 360.0);
52 std::vector<std::array<float, 5>> pts = {{1.0, 2.0, 1.0, 0.1, 0}};
54 std::vector<int> indices = {0};
55 Cluster cluster(input_cloud, indices);
58 ASSERT_FALSE(
evaluator.close_to_ground(cluster, ground_grid));
64TEST(ConeEvaluatorTest, CylinderFitsConeTrue) {
68 std::vector<std::array<float, 5>> pts = {{0.10, 0.05, 0.0, 0.1, 0}, {0.15, 0.0, 0.2, 0.1, 0}};
70 std::vector<int> indices = {0, 1};
71 Cluster cluster(input_cloud, indices);
72 ASSERT_TRUE(
evaluator.cylinder_fits_cone(cluster));
78TEST(ConeEvaluatorTest, CylinderFitsConeFalse) {
82 std::vector<std::array<float, 5>> pts = {{0.0, 0.0, 0.0, 0.1, 0}, {1.0, 0.0, 2.0, 0.1, 0}};
84 std::vector<int> indices = {0, 1};
85 Cluster cluster(input_cloud, indices);
86 ASSERT_FALSE(
evaluator.cylinder_fits_cone(cluster));
92TEST(ConeEvaluatorTest, NPointsValidTrue) {
96 std::vector<std::array<float, 5>> pts = {{0.0, 0.0, 0.0, 0.1, 0}, {0.1, 0.0, 0.0, 0.1, 0},
97 {0.2, 0.0, 0.0, 0.1, 0}, {0.3, 0.0, 0.0, 0.1, 0},
98 {0.4, 0.0, 0.0, 0.1, 0}, {0.5, 0.0, 0.0, 0.1, 0}};
100 std::vector<int> indices = {0, 1, 2, 3, 4, 5};
101 Cluster cluster(input_cloud, indices);
102 ASSERT_TRUE(
evaluator.npoints_valid(cluster));
108TEST(ConeEvaluatorTest, NPointsValidFalse) {
112 std::vector<std::array<float, 5>> pts = {{0.0, 0.0, 0.0, 0.1, 0}, {0.1, 0.0, 0.0, 0.1, 0}};
114 std::vector<int> indices = {0, 1};
115 Cluster cluster(input_cloud, indices);
116 ASSERT_FALSE(
evaluator.npoints_valid(cluster));