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

Function bindIndicesToRange

grid_map_core/src/CubicInterpolation.cpp:299–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297}
298
299void bindIndicesToRange(const GridMap &gridMap, IndicesMatrix *indices)
300{
301 const int numCol = gridMap.getSize().y();
302 const int numRow = gridMap.getSize().x();
303
304 //top left
305 {
306 const unsigned int iBoundToRange = bindIndexToRange(indices->topLeft_.x(), numRow);
307 const unsigned int jBoundToRange = bindIndexToRange(indices->topLeft_.y(), numCol);
308 indices->topLeft_ = Index(iBoundToRange, jBoundToRange);
309 }
310
311 //top right
312 {
313 const unsigned int iBoundToRange = bindIndexToRange(indices->topRight_.x(), numRow);
314 const unsigned int jBoundToRange = bindIndexToRange(indices->topRight_.y(), numCol);
315 indices->topRight_ = Index(iBoundToRange, jBoundToRange);
316 }
317
318 //bottom left
319 {
320 const unsigned int iBoundToRange = bindIndexToRange(indices->bottomLeft_.x(), numRow);
321 const unsigned int jBoundToRange = bindIndexToRange(indices->bottomLeft_.y(), numCol);
322 indices->bottomLeft_ = Index(iBoundToRange, jBoundToRange);
323 }
324
325 //bottom right
326 {
327 const unsigned int iBoundToRange = bindIndexToRange(indices->bottomRight_.x(), numRow);
328 const unsigned int jBoundToRange = bindIndexToRange(indices->bottomRight_.y(), numCol);
329 indices->bottomRight_ = Index(iBoundToRange, jBoundToRange);
330 }
331
332}
333
334bool getFirstOrderDerivatives(const Matrix &layerData, const IndicesMatrix &indices, Dim2D dim,
335 double resolution, DataMatrix *derivatives)

Callers 1

Calls 1

bindIndexToRangeFunction · 0.85

Tested by

no test coverage detected