Function grid_map::getLinearIndexFromIndex

Function Documentation

size_t grid_map::getLinearIndexFromIndex(const Index &index, const Size &bufferSize, const bool rowMajor = false)

Returns the linear index (1-dim.) corresponding to the regular index (2-dim.) for either row- or column-major format. Note: Eigen is defaulting to column-major format.

Parameters:
  • index[in] the regular 2d index.

  • bufferSize[in] the map buffer size.

  • (optional)[in] rowMajor if the linear index is generated for row-major format.

Returns:

the linear 1d index.