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

Method getIndexLimitedToMapRange

grid_map_core/src/iterators/LineIterator.cpp:96–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96bool LineIterator::getIndexLimitedToMapRange(const grid_map::GridMap& gridMap,
97 const Position& start, const Position& end,
98 Index& index)
99{
100 Position newStart = start;
101 Vector direction = (end - start).normalized();
102 while (!gridMap.getIndex(newStart, index)) {
103 newStart += (gridMap.getResolution() - std::numeric_limits<double>::epsilon()) * direction;
104 if ((end - newStart).norm() < gridMap.getResolution() - std::numeric_limits<double>::epsilon())
105 return false;
106 }
107 return true;
108}
109
110void LineIterator::initializeIterationParameters()
111{

Callers

nothing calls this directly

Calls 2

getIndexMethod · 0.80
getResolutionMethod · 0.45

Tested by

no test coverage detected