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

Function TEST

grid_map_ros/test/GridMapRosTest.cpp:35–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33using namespace grid_map;
34
35TEST(RosMessageConversion, roundTrip)
36{
37 GridMap mapIn({"layer"});
38 mapIn.setGeometry(Length(2.0, 3.0), 0.5, Position(1.0, 1.5));
39 mapIn["layer"].setRandom();
40
41 grid_map_msgs::GridMap message;
42 GridMapRosConverter::toMessage(mapIn, message);
43 GridMap mapOut;
44 GridMapRosConverter::fromMessage(message, mapOut);
45
46 for (size_t i = 0; i < mapIn.getLayers().size(); ++i) {
47 EXPECT_EQ(mapIn.getLayers().at(i), mapOut.getLayers().at(i));
48 const std::string layer = mapIn.getLayers().at(i);
49 EXPECT_TRUE((mapIn[layer].array() == mapOut[layer].array()).all());
50 }
51
52 EXPECT_EQ(mapIn.getFrameId(), mapOut.getFrameId());
53 EXPECT_TRUE((mapIn.getLength() == mapOut.getLength()).all());
54 EXPECT_TRUE((mapIn.getPosition().array() == mapOut.getPosition().array()).all());
55 EXPECT_TRUE((mapIn.getSize() == mapOut.getSize()).all());
56}
57
58TEST(RosbagHandling, saveLoad)
59{

Callers

nothing calls this directly

Calls 13

expectNearFunction · 0.85
setGeometryMethod · 0.80
atMethod · 0.80
getPositionMethod · 0.80
existsMethod · 0.80
moveMethod · 0.80
resizeMethod · 0.80
endMethod · 0.80
isPastEndMethod · 0.45
setTimestampMethod · 0.45
addMethod · 0.45
getResolutionMethod · 0.45

Tested by

no test coverage detected