| 17 | using namespace grid_map; |
| 18 | |
| 19 | TEST(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 | |
| 40 | TEST(GridMapCvProcessing, changeResolutionForMovedMap) { |
| 41 | // Create grid map. |
nothing calls this directly
no test coverage detected