MCPcopy Create free account
hub / github.com/ANYbotics/grid_map / TEST

Function TEST

grid_map_pcl/test/GridMapPclLoaderTest.cpp:20–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18namespace grid_map_pcl_test {
19
20TEST(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
44TEST(GridMapPclLoaderTest, PerfectPlane) // NOLINT
45{

Callers

nothing calls this directly

Calls 15

setVerbosityLevelFunction · 0.85
getConfigFilePathFunction · 0.85
getTestPcdFilePathFunction · 0.85
getNonNanElevationValuesFunction · 0.85
createPerfectPlaneFunction · 0.85
getTestDataFolderPathFunction · 0.85
loadCloudFromPcdFileMethod · 0.80
preProcessInputCloudMethod · 0.80

Tested by

no test coverage detected