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

Function checkIfPositionWithinMap

grid_map_core/src/GridMapMath.cpp:144–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144bool checkIfPositionWithinMap(const Position& position,
145 const Length& mapLength,
146 const Position& mapPosition)
147{
148 Vector offset;
149 getVectorToOrigin(offset, mapLength);
150 Position positionTransformed = getMapFrameToBufferOrderTransformation().cast<double>() * (position - mapPosition - offset);
151
152 if (positionTransformed.x() >= 0.0 && positionTransformed.y() >= 0.0
153 && positionTransformed.x() < mapLength(0) && positionTransformed.y() < mapLength(1)) {
154 return true;
155 }
156 return false;
157}
158
159void getPositionOfDataStructureOrigin(const Position& position,
160 const Length& mapLength,

Callers 3

TESTFunction · 0.85
getIndexFromPositionFunction · 0.85
isInsideMethod · 0.85

Calls 2

getVectorToOriginFunction · 0.85

Tested by 1

TESTFunction · 0.68