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

Method findSubmapParameters

grid_map_core/src/iterators/PolygonIterator.cpp:77–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void PolygonIterator::findSubmapParameters(const grid_map::Polygon& polygon, Index& startIndex, Size& bufferSize) const
78{
79 Position topLeft = polygon_.getVertices()[0];
80 Position bottomRight = topLeft;
81 for (const auto& vertex : polygon_.getVertices()) {
82 topLeft = topLeft.array().max(vertex.array());
83 bottomRight = bottomRight.array().min(vertex.array());
84 }
85 boundPositionToRange(topLeft, mapLength_, mapPosition_);
86 boundPositionToRange(bottomRight, mapLength_, mapPosition_);
87 getIndexFromPosition(startIndex, topLeft, mapLength_, mapPosition_, resolution_, bufferSize_, bufferStartIndex_);
88 Index endIndex;
89 getIndexFromPosition(endIndex, bottomRight, mapLength_, mapPosition_, resolution_, bufferSize_, bufferStartIndex_);
90 bufferSize = getSubmapSizeFromCornerIndeces(startIndex, endIndex, bufferSize_, bufferStartIndex_);
91}
92
93} /* namespace grid_map */
94

Callers

nothing calls this directly

Calls 3

boundPositionToRangeFunction · 0.85
getIndexFromPositionFunction · 0.85

Tested by

no test coverage detected