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

Function TEST

grid_map_cv/test/GridMapCvProcessingTest.cpp:19–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17using namespace grid_map;
18
19TEST(GridMapCvProcessing, changeResolution) {
20 // Create grid map.
21 GridMap mapIn;
22 mapIn.setGeometry(grid_map::Length(2.0, 1.0), 0.01);
23 mapIn.add("layer", 1.0);
24 for (grid_map::CircleIterator iterator(mapIn, mapIn.getPosition(), 0.2); !iterator.isPastEnd(); ++iterator) {
25 mapIn.at("layer", *iterator) = 2.0;
26 }
27
28 // Change resolution.
29 GridMap mapOut;
30 EXPECT_TRUE(GridMapCvProcessing::changeResolution(mapIn, mapOut, 0.1));
31
32 // Check data.
33 EXPECT_TRUE((mapIn.getLength() == mapOut.getLength()).all());
34 EXPECT_TRUE(mapIn.getPosition() == mapOut.getPosition());
35 EXPECT_TRUE((mapIn.getSize() == mapOut.getSize() * 10).all());
36 EXPECT_EQ(mapIn["layer"](0, 0), mapOut["layer"](0, 0)); // Corner.
37 EXPECT_EQ(mapIn.atPosition("layer", mapIn.getPosition()), mapOut.atPosition("layer", mapOut.getPosition())); // Center.
38}
39
40TEST(GridMapCvProcessing, changeResolutionForMovedMap) {
41 // Create grid map.

Callers

nothing calls this directly

Calls 9

setGeometryMethod · 0.80
getPositionMethod · 0.80
atMethod · 0.80
atPositionMethod · 0.80
moveMethod · 0.80
setBasicLayersMethod · 0.80
GridMapClass · 0.50
addMethod · 0.45
isPastEndMethod · 0.45

Tested by

no test coverage detected