| 18 | namespace grid_map_pcl_test { |
| 19 | |
| 20 | TEST(GridMapPclLoaderTest, FlatGroundRealDataset) // NOLINT |
| 21 | { |
| 22 | grid_map_pcl_test::setVerbosityLevel(ros::console::levels::Warn); |
| 23 | |
| 24 | grid_map::GridMapPclLoader gridMapPclLoader; |
| 25 | gridMapPclLoader.loadParameters(grid_map_pcl_test::getConfigFilePath()); |
| 26 | gridMapPclLoader.loadCloudFromPcdFile(grid_map_pcl_test::getTestPcdFilePath()); |
| 27 | gridMapPclLoader.preProcessInputCloud(); |
| 28 | gridMapPclLoader.initializeGridMapGeometryFromInputCloud(); |
| 29 | gridMapPclLoader.addLayerFromInputCloud(grid_map_pcl_test::layerName); |
| 30 | |
| 31 | const auto& gridMap = gridMapPclLoader.getGridMap(); |
| 32 | const auto elevationValues = grid_map_pcl_test::getNonNanElevationValues(gridMap); |
| 33 | |
| 34 | EXPECT_TRUE(!elevationValues.empty()); |
| 35 | |
| 36 | // test that all the elevation values are equal |
| 37 | // allow for some difference (2cm) since the input cloud is noisy (real dataset) |
| 38 | double referenceElevation = elevationValues.front(); |
| 39 | for (const auto& elevation : elevationValues) { |
| 40 | EXPECT_NEAR(elevation, referenceElevation, 2e-2); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | TEST(GridMapPclLoaderTest, PerfectPlane) // NOLINT |
| 45 | { |
nothing calls this directly
no test coverage detected