Function grid_map::incrementIndexForSubmap

Function Documentation

bool grid_map::incrementIndexForSubmap(Index &submapIndex, Index &index, const Index &submapTopLeftIndex, const Size &submapBufferSize, const Size &bufferSize, const Index &bufferStartIndex = Index::Zero())

Increases the index by one to iterate through the cells of a submap. Increments either to the neighboring index to the right or to the start of the lower row. Returns false if end of iterations are reached.

Note: This function does not check if submap actually fits to the map. This needs to be checked before separately.

Parameters:
  • [in/out] – submapIndex the index in the submap that is incremented.

  • index[out] the index in the map that is incremented (corrected for the circular buffer).

  • submapTopLefIndex[in] the top left index of the submap.

  • submapBufferSize[in] the submap buffer size.

  • bufferSize[in] the map buffer size.

  • bufferStartIndex[in] the map buffer start index.

Returns:

true if successfully incremented indeces, false if end of iteration limits are reached.