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

Function getIndexShiftFromPositionShift

grid_map_core/src/GridMapMath.cpp:168–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168bool getIndexShiftFromPositionShift(Index& indexShift,
169 const Vector& positionShift,
170 const double& resolution)
171{
172 Vector indexShiftVectorTemp = (positionShift.array() / resolution).matrix();
173 Eigen::Vector2i indexShiftVector;
174
175 for (int i = 0; i < indexShiftVector.size(); i++) {
176 indexShiftVector[i] = static_cast<int>(indexShiftVectorTemp[i] + 0.5 * (indexShiftVectorTemp[i] > 0 ? 1 : -1));
177 }
178
179 indexShift = transformMapFrameToBufferOrder(indexShiftVector);
180 return true;
181}
182
183bool getPositionShiftFromIndexShift(Vector& positionShift,
184 const Index& indexShift,

Callers 2

TESTFunction · 0.85
moveMethod · 0.85

Calls 1

Tested by 1

TESTFunction · 0.68