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

Function getPositionFromIndex

grid_map_core/src/GridMapMath.cpp:114–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112using namespace internal;
113
114bool getPositionFromIndex(Position& position,
115 const Index& index,
116 const Length& mapLength,
117 const Position& mapPosition,
118 const double& resolution,
119 const Size& bufferSize,
120 const Index& bufferStartIndex)
121{
122 if (!checkIfIndexInRange(index, bufferSize)) return false;
123 Vector offset;
124 getVectorToFirstCell(offset, mapLength, resolution);
125 position = mapPosition + offset + resolution * getIndexVectorFromIndex(index, bufferSize, bufferStartIndex);
126 return true;
127}
128
129bool getIndexFromPosition(Index& index,
130 const Position& position,

Callers 7

TESTFunction · 0.85
getSubmapInformationFunction · 0.85
getPositionMethod · 0.85
isInsideMethod · 0.85
isInsideMethod · 0.85
isInsideMethod · 0.85
isInsideMethod · 0.85

Calls 3

checkIfIndexInRangeFunction · 0.85
getVectorToFirstCellFunction · 0.85
getIndexVectorFromIndexFunction · 0.85

Tested by 1

TESTFunction · 0.68