PointcloudProcessorTest.cpp
Go to the documentation of this file.
1 /*
2  * PointcloudProcessorTest.cpp
3  *
4  * Created on: Nov 21, 2019
5  * Author: Edo Jelavic
6  * Institute: ETH Zurich, Robotic Systems Lab
7  */
8 
9 #include <cstdlib>
10 
11 #include <gtest/gtest.h>
12 
14 
15 #include "PointcloudCreator.hpp"
16 #include "test_helpers.hpp"
17 
18 namespace grid_map {
19 namespace grid_map_pcl_test {
20 
21 TEST(PointcloudProcessorTest, ExtractClusters) {
23  const auto seed = rand();
25 
26  const unsigned int numTests = 10;
27  for (unsigned int i = 0; i < numTests; ++i) {
28  double minZ, stdDevZ;
29  int nBlobs;
30  auto cloud = grid_map_pcl_test::PointcloudCreator::createNBlobsAboveEachOther(&minZ, &stdDevZ, &nBlobs);
33  auto clusters = pointcloudProcessor.extractClusterCloudsFromPointcloud(cloud);
34  EXPECT_EQ(clusters.size(), nBlobs);
35  }
36 
37  if (::testing::Test::HasFailure()) {
38  std::cout << "\n Test ExtractClusters failed with seed: " << seed << std::endl;
39  }
40 }
41 
42 } /*namespace grid_map_pcl_test */
43 } // namespace grid_map
std::vector< Pointcloud::Ptr > extractClusterCloudsFromPointcloud(Pointcloud::ConstPtr inputCloud) const
static Pointcloud::Ptr createNBlobsAboveEachOther(double *minZ, double *stdDevZ, int *nBlobs)
TEST(GridMapPclLoaderTest, FlatGroundRealDataset)
void loadParameters(const std::string &filename)
void setVerbosityLevel(ros::console::levels::Level level)


grid_map_pcl
Author(s): Dominic Jud , Edo Jelavic
autogenerated on Tue Jun 1 2021 02:13:43