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

Method initializeFromImage

grid_map_ros/src/GridMapRosConverter.cpp:332–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332bool GridMapRosConverter::initializeFromImage(const sensor_msgs::Image& image,
333 const double resolution, grid_map::GridMap& gridMap,
334 const grid_map::Position& position)
335{
336 const double lengthX = resolution * image.height;
337 const double lengthY = resolution * image.width;
338 Length length(lengthX, lengthY);
339 gridMap.setGeometry(length, resolution, position);
340 gridMap.setFrameId(image.header.frame_id);
341 gridMap.setTimestamp(image.header.stamp.toNSec());
342 return true;
343}
344
345bool GridMapRosConverter::addLayerFromImage(const sensor_msgs::Image& image,
346 const std::string& layer, grid_map::GridMap& gridMap,

Callers

nothing calls this directly

Calls 3

setGeometryMethod · 0.80
setFrameIdMethod · 0.45
setTimestampMethod · 0.45

Tested by

no test coverage detected