Namespaces | Classes | Typedefs | Enumerations | Functions
grid_map Namespace Reference

Namespaces

 bicubic
 
 bicubic_conv
 
 internal
 

Classes

class  BufferRegion
 
class  CircleIterator
 
struct  Clamp
 
union  Color
 
class  EllipseIterator
 
class  GridMap
 
class  GridMapIterator
 
class  LineIterator
 
class  Polygon
 
class  PolygonIterator
 
class  SlidingWindowIterator
 
class  SpiralIterator
 
class  SubmapGeometry
 
class  SubmapIterator
 

Typedefs

using DataType = Matrix::Scalar
 
using FunctionValueMatrix = Eigen::Matrix4d
 
using Index = Eigen::Array2i
 
using Length = Eigen::Array2d
 
using Matrix = Eigen::MatrixXf
 
using Position = Eigen::Vector2d
 
using Position3 = Eigen::Vector3d
 
using Size = Eigen::Array2i
 
using Time = uint64_t
 
using Vector = Eigen::Vector2d
 
using Vector3 = Eigen::Vector3d
 

Enumerations

enum  InterpolationMethods { InterpolationMethods::INTER_NEAREST, InterpolationMethods::INTER_LINEAR, InterpolationMethods::INTER_CUBIC_CONVOLUTION, InterpolationMethods::INTER_CUBIC }
 

Functions

template<typename M1 , typename M2 >
void assertEqual (const M1 &A, const M2 &B, std::string const &message="")
 
template<typename M1 >
void assertFinite (const M1 &A, std::string const &="")
 
template<typename M1 , typename M2 , typename T >
void assertNear (const M1 &A, const M2 &B, T tolerance, std::string const &message="")
 
unsigned int bindIndexToRange (unsigned int idReq, unsigned int nElem)
 
void boundIndexToRange (Index &index, const Size &bufferSize)
 
void boundIndexToRange (int &index, const int &bufferSize)
 
void boundPositionToRange (Position &position, const Length &mapLength, const Position &mapPosition)
 
bool checkIfIndexInRange (const Index &index, const Size &bufferSize)
 
bool checkIfPositionWithinMap (const Position &position, const Length &mapLength, const Position &mapPosition)
 
bool colorValueToVector (const unsigned long &colorValue, Eigen::Vector3i &colorVector)
 
bool colorValueToVector (const unsigned long &colorValue, Eigen::Vector3f &colorVector)
 
bool colorValueToVector (const float &colorValue, Eigen::Vector3f &colorVector)
 
bool colorVectorToValue (const Eigen::Vector3i &colorVector, unsigned long &colorValue)
 
void colorVectorToValue (const Eigen::Vector3i &colorVector, float &colorValue)
 
void colorVectorToValue (const Eigen::Vector3f &colorVector, float &colorValue)
 
bool compareRelative (double a, double b, double percentTolerance, double *percentError=nullptr)
 
template<typename M1 , typename M2 , typename T >
void expectNear (const M1 &A, const M2 &B, T tolerance, std::string const &message="")
 
Index getBufferIndexFromIndex (const Index &index, const Size &bufferSize, const Index &bufferStartIndex)
 
Eigen::Matrix2i getBufferOrderToMapFrameAlignment ()
 
bool getBufferRegionsForSubmap (std::vector< BufferRegion > &submapBufferRegions, const Index &submapIndex, const Size &submapBufferSize, const Size &bufferSize, const Index &bufferStartIndex=Index::Zero())
 
Index getIndexFromBufferIndex (const Index &bufferIndex, const Size &bufferSize, const Index &bufferStartIndex)
 
Index getIndexFromLinearIndex (size_t linearIndex, const Size &bufferSize, bool rowMajor=false)
 
bool getIndexFromPosition (Index &index, const Position &position, const Length &mapLength, const Position &mapPosition, const double &resolution, const Size &bufferSize, const Index &bufferStartIndex=Index::Zero())
 
bool getIndexShiftFromPositionShift (Index &indexShift, const Vector &positionShift, const double &resolution)
 
double getLayerValue (const Matrix &layerMat, unsigned int rowReq, unsigned int colReq)
 
double getLayerValue (const Matrix &layerMat, int rowReq, int colReq)
 
size_t getLinearIndexFromIndex (const Index &index, const Size &bufferSize, bool rowMajor=false)
 
bool getPositionFromIndex (Position &position, const Index &index, const Length &mapLength, const Position &mapPosition, const double &resolution, const Size &bufferSize, const Index &bufferStartIndex=Index::Zero())
 
void getPositionOfDataStructureOrigin (const Position &position, const Length &mapLength, Position &positionOfOrigin)
 
bool getPositionShiftFromIndexShift (Vector &positionShift, const Index &indexShift, const double &resolution)
 
bool getSubmapInformation (Index &submapTopLeftIndex, Size &submapBufferSize, Position &submapPosition, Length &submapLength, Index &requestedIndexInSubmap, const Position &requestedSubmapPosition, const Length &requestedSubmapLength, const Length &mapLength, const Position &mapPosition, const double &resolution, const Size &bufferSize, const Index &bufferStartIndex=Index::Zero())
 
Size getSubmapSizeFromCornerIndices (const Index &topLeftIndex, const Index &bottomRightIndex, const Size &bufferSize, const Index &bufferStartIndex)
 
bool incrementIndex (Index &index, const Size &bufferSize, const Index &bufferStartIndex=Index::Zero())
 
bool incrementIndexForSubmap (Index &submapIndex, Index &index, const Index &submapTopLeftIndex, const Size &submapBufferSize, const Size &bufferSize, const Index &bufferStartIndex=Index::Zero())
 
template<int N>
Eigen::Matrix< double, N, N > randomCovariance ()
 
Eigen::MatrixXd randomCovarianceXd (int N)
 
 TEST (GridMap, CopyConstructor)
 
 TEST (LineIterator, StartOutsideMap)
 
 TEST (PositionFromIndex, Simple)
 
 TEST (SubmapIterator, Simple)
 
 TEST (GridMap, CopyAssign)
 
 TEST (LineIterator, EndOutsideMap)
 
 TEST (PositionFromIndex, CircularBuffer)
 
 TEST (GridMap, Move)
 
 TEST (LineIterator, StartAndEndOutsideMap)
 
 TEST (IndexFromPosition, Simple)
 
 TEST (SubmapIterator, CircularBuffer)
 
 TEST (GridMap, Transform)
 
 TEST (LineIterator, StartAndEndOutsideMapWithoutIntersectingMap)
 
 TEST (LineIterator, MovedMap)
 
 TEST (IndexFromPosition, EdgeCases)
 
 TEST (GridMap, ClipToMap)
 
 TEST (IndexFromPosition, CircularBuffer)
 
 TEST (LineIterator, StartAndEndOutsideMovedMap)
 
 TEST (checkIfPositionWithinMap, Inside)
 
 TEST (GridMap, ClipToMap2)
 
 TEST (checkIfPositionWithinMap, Outside)
 
 TEST (checkIfPositionWithinMap, EdgeCases)
 
 TEST (SubmapIterator, InterleavedExecutionWithMove)
 
 TEST (getIndexShiftFromPositionShift, All)
 
 TEST (getPositionShiftFromIndexShift, All)
 
 TEST (checkIfIndexInRange, All)
 
 TEST (boundIndexToRange, All)
 
 TEST (wrapIndexToRange, All)
 
 TEST (AddDataFrom, ExtendMapAligned)
 
 TEST (boundPositionToRange, Simple)
 
 TEST (AddDataFrom, ExtendMapNotAligned)
 
 TEST (AddDataFrom, CopyData)
 
 TEST (boundPositionToRange, Position)
 
 TEST (ValueAtPosition, NearestNeighbor)
 
 TEST (ValueAtPosition, LinearInterpolated)
 
 TEST (getSubmapInformation, Simple)
 
 TEST (getSubmapInformation, Zero)
 
 TEST (getSubmapInformation, ExceedingBoundaries)
 
 TEST (getSubmapInformation, CircularBuffer)
 
 TEST (getSubmapInformation, Debug1)
 
 TEST (getSubmapInformation, Debug2)
 
 TEST (getBufferRegionsForSubmap, Trivial)
 
 TEST (getBufferRegionsForSubmap, Simple)
 
 TEST (getBufferRegionsForSubmap, CircularBuffer)
 
 TEST (checkIncrementIndex, Simple)
 
 TEST (checkIncrementIndex, CircularBuffer)
 
 TEST (checkIncrementIndexForSubmap, Simple)
 
 TEST (checkIncrementIndexForSubmap, CircularBuffer)
 
 TEST (getIndexFromLinearIndex, Simple)
 
void wrapIndexToRange (Index &index, const Size &bufferSize)
 
void wrapIndexToRange (int &index, int bufferSize)
 

Typedef Documentation

◆ DataType

using grid_map::DataType = typedef Matrix::Scalar

Definition at line 17 of file TypeDefs.hpp.

◆ FunctionValueMatrix

using grid_map::FunctionValueMatrix = typedef Eigen::Matrix4d

Definition at line 40 of file CubicInterpolation.hpp.

◆ Index

using grid_map::Index = typedef Eigen::Array2i

Definition at line 22 of file TypeDefs.hpp.

◆ Length

using grid_map::Length = typedef Eigen::Array2d

Definition at line 24 of file TypeDefs.hpp.

◆ Matrix

using grid_map::Matrix = typedef Eigen::MatrixXf

Definition at line 16 of file TypeDefs.hpp.

◆ Position

using grid_map::Position = typedef Eigen::Vector2d

Definition at line 18 of file TypeDefs.hpp.

◆ Position3

using grid_map::Position3 = typedef Eigen::Vector3d

Definition at line 20 of file TypeDefs.hpp.

◆ Size

using grid_map::Size = typedef Eigen::Array2i

Definition at line 23 of file TypeDefs.hpp.

◆ Time

using grid_map::Time = typedef uint64_t

Definition at line 25 of file TypeDefs.hpp.

◆ Vector

using grid_map::Vector = typedef Eigen::Vector2d

Definition at line 19 of file TypeDefs.hpp.

◆ Vector3

using grid_map::Vector3 = typedef Eigen::Vector3d

Definition at line 21 of file TypeDefs.hpp.

Enumeration Type Documentation

◆ InterpolationMethods

Enumerator
INTER_NEAREST 
INTER_LINEAR 
INTER_CUBIC_CONVOLUTION 
INTER_CUBIC 

Definition at line 39 of file TypeDefs.hpp.

Function Documentation

◆ assertEqual()

template<typename M1 , typename M2 >
void grid_map::assertEqual ( const M1 &  A,
const M2 &  B,
std::string const &  message = "" 
)

Definition at line 33 of file gtest_eigen.hpp.

◆ assertFinite()

template<typename M1 >
void grid_map::assertFinite ( const M1 &  A,
std::string const &  = "" 
)

Definition at line 99 of file gtest_eigen.hpp.

◆ assertNear()

template<typename M1 , typename M2 , typename T >
void grid_map::assertNear ( const M1 &  A,
const M2 &  B,
tolerance,
std::string const &  message = "" 
)

Definition at line 54 of file gtest_eigen.hpp.

◆ bindIndexToRange()

unsigned int grid_map::bindIndexToRange ( unsigned int  idReq,
unsigned int  nElem 
)

Takes the id requested, performs checks and returns an id that it is within the specified bounds.

Parameters
[in]idReq- input index .
[in]nElem- number of elements in the container
Returns
index that is within [0, nElem-1].

Definition at line 15 of file CubicInterpolation.cpp.

◆ boundIndexToRange() [1/2]

void grid_map::boundIndexToRange ( Index index,
const Size bufferSize 
)

Bounds an index that runs out of the range of the buffer. This means that an index that overflows is stopped at the last valid index. This is the 2d version of boundIndexToRange(int&, const int&).

Parameters

Definition at line 211 of file GridMapMath.cpp.

◆ boundIndexToRange() [2/2]

void grid_map::boundIndexToRange ( int &  index,
const int &  bufferSize 
)

Bounds an index that runs out of the range of the buffer. This means that an index that overflows is stopped at the last valid index.

Parameters

Definition at line 218 of file GridMapMath.cpp.

◆ boundPositionToRange()

void grid_map::boundPositionToRange ( Position position,
const Length mapLength,
const Position mapPosition 
)

Bound (cuts off) the position to lie inside the map. This means that an index that overflows is stopped at the last valid index.

Parameters

Definition at line 255 of file GridMapMath.cpp.

◆ checkIfIndexInRange()

bool grid_map::checkIfIndexInRange ( const Index index,
const Size bufferSize 
)

Checks if index is within range of the buffer.

Parameters
[in]indexto check.
[in]bufferSizethe size of the buffer.
Returns
true if index is within, and false if index is outside of the buffer.

Definition at line 206 of file GridMapMath.cpp.

◆ checkIfPositionWithinMap()

bool grid_map::checkIfPositionWithinMap ( const Position position,
const Length mapLength,
const Position mapPosition 
)

Checks if position is within the map boundaries.

Parameters
[in]positionthe position which is to be checked.
[in]mapLengththe length of the map.
[in]mapPositionthe position of the map.
Returns
true if position is within map, false otherwise.

Definition at line 162 of file GridMapMath.cpp.

◆ colorValueToVector() [1/3]

bool grid_map::colorValueToVector ( const unsigned long &  colorValue,
Eigen::Vector3i &  colorVector 
)

Transforms an int color value (concatenated RGB values) to an int color vector (RGB from 0-255).

Parameters
[in]colorValuethe concatenated RGB color value.
[out]colorVectorthe color vector in RGB from 0-255.
Returns
true if successful.

Definition at line 556 of file GridMapMath.cpp.

◆ colorValueToVector() [2/3]

bool grid_map::colorValueToVector ( const unsigned long &  colorValue,
Eigen::Vector3f &  colorVector 
)

Transforms an int color value (concatenated RGB values) to a float color vector (RGB from 0.0-1.0).

Parameters
[in]colorValuethe concatenated RGB color value.
[out]colorVectorthe color vector in RGB from 0.0-1.0.
Returns
true if successful.

Definition at line 564 of file GridMapMath.cpp.

◆ colorValueToVector() [3/3]

bool grid_map::colorValueToVector ( const float &  colorValue,
Eigen::Vector3f &  colorVector 
)

Transforms a float color value (concatenated 3 single-byte value) to a float color vector (RGB from 0.0-1.0).

Parameters
[in]colorValuethe concatenated RGB color value.
[out]colorVectorthe color vector in RGB from 0.0-1.0.
Returns
true if successful.

Definition at line 572 of file GridMapMath.cpp.

◆ colorVectorToValue() [1/3]

bool grid_map::colorVectorToValue ( const Eigen::Vector3i &  colorVector,
unsigned long &  colorValue 
)

Transforms an int color vector (RGB from 0-255) to a concatenated RGB int color.

Parameters
[in]colorVectorthe color vector in RGB from 0-255.
[out]colorValuethe concatenated RGB color value.
Returns
true if successful.

Definition at line 580 of file GridMapMath.cpp.

◆ colorVectorToValue() [2/3]

void grid_map::colorVectorToValue ( const Eigen::Vector3i &  colorVector,
float &  colorValue 
)

Transforms a color vector (RGB from 0-255) to a concatenated 3 single-byte float value.

Parameters
[in]colorVectorthe color vector in RGB from 0-255.
[out]colorValuethe concatenated RGB color value.

Definition at line 586 of file GridMapMath.cpp.

◆ colorVectorToValue() [3/3]

void grid_map::colorVectorToValue ( const Eigen::Vector3f &  colorVector,
float &  colorValue 
)

Transforms a color vector (RGB from 0.0-1.0) to a concatenated 3 single-byte float value.

Parameters
[in]colorVectorthe color vector in RGB from 0.0-1.0.
[out]colorValuethe concatenated RGB color value.

Definition at line 593 of file GridMapMath.cpp.

◆ compareRelative()

bool grid_map::compareRelative ( double  a,
double  b,
double  percentTolerance,
double *  percentError = nullptr 
)
inline

Definition at line 111 of file gtest_eigen.hpp.

◆ expectNear()

template<typename M1 , typename M2 , typename T >
void grid_map::expectNear ( const M1 &  A,
const M2 &  B,
tolerance,
std::string const &  message = "" 
)

Definition at line 78 of file gtest_eigen.hpp.

◆ getBufferIndexFromIndex()

Index grid_map::getBufferIndexFromIndex ( const Index index,
const Size bufferSize,
const Index bufferStartIndex 
)

Retrieve the index of the buffer from a unwrapped index (reverse from function above).

Parameters
indexthe unwrapped index.
bufferSizethe map buffer size.
bufferStartIndexthe map buffer start index.
Returns
the buffer index.

Definition at line 529 of file GridMapMath.cpp.

◆ getBufferOrderToMapFrameAlignment()

Eigen::Matrix2i grid_map::getBufferOrderToMapFrameAlignment ( )

Provides the alignment transformation from the buffer order (outer/inner storage) and the map frame (x/y-coordinate).

Returns
the alignment transformation.

Definition at line 282 of file GridMapMath.cpp.

◆ getBufferRegionsForSubmap()

bool grid_map::getBufferRegionsForSubmap ( std::vector< BufferRegion > &  submapBufferRegions,
const Index submapIndex,
const Size submapBufferSize,
const Size bufferSize,
const Index bufferStartIndex = Index::Zero() 
)

Computes the regions in the circular buffer that make up the data for a requested submap.

Parameters
[out]submapBufferRegionsthe list of buffer regions that make up the submap.
[in]submapIndexthe index (top-left) for the requested submap.
[in]submapBufferSizethe size of the requested submap.
[in]bufferSizethe buffer size of the map.
[in]bufferStartIndexthe index of the starting point of the circular buffer (optional).
Returns
true if successful, false if requested submap is not fully contained in the map.

Definition at line 351 of file GridMapMath.cpp.

◆ getIndexFromBufferIndex()

Index grid_map::getIndexFromBufferIndex ( const Index bufferIndex,
const Size bufferSize,
const Index bufferStartIndex 
)

Retrieve the index as unwrapped index, i.e., as the corresponding index of a grid map with no circular buffer offset.

Parameters
bufferIndexthe index in the circular buffer.
bufferSizethe map buffer size.
bufferStartIndexthe map buffer start index.
Returns
the unwrapped index.

Definition at line 518 of file GridMapMath.cpp.

◆ getIndexFromLinearIndex()

Index grid_map::getIndexFromLinearIndex ( size_t  linearIndex,
const Size bufferSize,
bool  rowMajor = false 
)

Returns the regular index (2-dim.) corresponding to the linear index (1-dim.) for a given buffer size.

Parameters
[in]linearIndexthe he linear 1d index.
[in]bufferSizethe map buffer size.
[in](optional)rowMajor if the linear index is generated for row-major format.
Returns
the regular 2d index.

Definition at line 548 of file GridMapMath.cpp.

◆ getIndexFromPosition()

bool grid_map::getIndexFromPosition ( Index index,
const Position position,
const Length mapLength,
const Position mapPosition,
const double &  resolution,
const Size bufferSize,
const Index bufferStartIndex = Index::Zero() 
)

Gets the index of the cell which contains a position in the map frame.

Parameters
[out]indexof the cell.
[in]positionthe position in the map frame.
[in]mapLengththe lengths in x and y direction.
[in]mapPositionthe position of the map.
[in]resolutionthe resolution of the map.
[in]bufferSizethe size of the buffer (optional).
[in]bufferStartIndexthe index of the starting point of the circular buffer (optional).
Returns
true if successful, false if position outside of map.

Definition at line 147 of file GridMapMath.cpp.

◆ getIndexShiftFromPositionShift()

bool grid_map::getIndexShiftFromPositionShift ( Index indexShift,
const Vector positionShift,
const double &  resolution 
)

Computes how many cells/indices the map is moved based on a position shift in the grid map frame. Use this function if you are moving the grid map and want to ensure that the cells match before and after.

Parameters
[out]indexShiftthe corresponding shift of the indices.
[in]positionShiftthe desired position shift.
[in]resolutionthe resolution of the map.
Returns
true if successful.

Definition at line 183 of file GridMapMath.cpp.

◆ getLayerValue() [1/2]

double grid_map::getLayerValue ( const Matrix layerMat,
unsigned int  rowReq,
unsigned int  colReq 
)

Definition at line 23 of file CubicInterpolation.cpp.

◆ getLayerValue() [2/2]

double grid_map::getLayerValue ( const Matrix layerMat,
int  rowReq,
int  colReq 
)

Extract the value of the specific layer at the row and column requested. If row and column are out of bounds they will be bound to range.

Parameters
[in]layerMat- matrix of the layer from where the data is extracted
[in]rowReq- row requested
[in]colReq- column requested
Returns
- value of the layer at rowReq and colReq

◆ getLinearIndexFromIndex()

size_t grid_map::getLinearIndexFromIndex ( const Index index,
const Size bufferSize,
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
[in]indexthe regular 2d index.
[in]bufferSizethe map buffer size.
[in](optional)rowMajor if the linear index is generated for row-major format.
Returns
the linear 1d index.

Definition at line 540 of file GridMapMath.cpp.

◆ getPositionFromIndex()

bool grid_map::getPositionFromIndex ( Position position,
const Index index,
const Length mapLength,
const Position mapPosition,
const double &  resolution,
const Size bufferSize,
const Index bufferStartIndex = Index::Zero() 
)

Gets the position of a cell specified by its index in the map frame.

Parameters
[out]positionthe position of the center of the cell in the map frame.
[in]indexof the cell.
[in]mapLengththe lengths in x and y direction.
[in]mapPositionthe position of the map.
[in]resolutionthe resolution of the map.
[in]bufferSizethe size of the buffer (optional).
[in]bufferStartIndexthe index of the starting point of the circular buffer (optional).
Returns
true if successful, false if index not within range of buffer.

Definition at line 130 of file GridMapMath.cpp.

◆ getPositionOfDataStructureOrigin()

void grid_map::getPositionOfDataStructureOrigin ( const Position position,
const Length mapLength,
Position positionOfOrigin 
)

Gets the position of the data structure origin.

Parameters
[in]positionthe position of the map.
[in]mapLengththe map length.
[out]positionOfOriginthe position of the data structure origin.

Definition at line 174 of file GridMapMath.cpp.

◆ getPositionShiftFromIndexShift()

bool grid_map::getPositionShiftFromIndexShift ( Vector positionShift,
const Index indexShift,
const double &  resolution 
)

Computes the corresponding position shift from a index shift. Use this function if you are moving the grid map and want to ensure that the cells match before and after.

Parameters
[out]positionShiftthe corresponding shift in position in the grid map frame.
[in]indexShiftthe desired shift of the indices.
[in]resolutionthe resolution of the map.
Returns
true if successful.

Definition at line 198 of file GridMapMath.cpp.

◆ getSubmapInformation()

bool grid_map::getSubmapInformation ( Index submapTopLeftIndex,
Size submapBufferSize,
Position submapPosition,
Length submapLength,
Index requestedIndexInSubmap,
const Position requestedSubmapPosition,
const Length requestedSubmapLength,
const Length mapLength,
const Position mapPosition,
const double &  resolution,
const Size bufferSize,
const Index bufferStartIndex = Index::Zero() 
)

Given a map and a desired submap (defined by position and size), this function computes various information about the submap. The returned submap might be smaller than the requested size as it respects the boundaries of the map.

Parameters
[out]submapTopLeftIndexthe top left index of the returned submap.
[out]submapBufferSizethe buffer size of the returned submap.
[out]submapPositionthe position of the submap (center) in the map frame.
[out]submapLengththe length of the submap.
[out]requestedIndexInSubmapthe index in the submap that corresponds to the requested position of the submap.
[in]requestedSubmapPositionthe requested submap position (center) in the map frame.
[in]requestedSubmapLengththe requested submap length.
[in]mapLengththe lengths in x and y direction.
[in]mapPositionthe position of the map.
[in]resolutionthe resolution of the map.
[in]bufferSizethe buffer size of the map.
[in]bufferStartIndexthe index of the starting point of the circular buffer (optional).
Returns
true if successful.

Definition at line 287 of file GridMapMath.cpp.

◆ getSubmapSizeFromCornerIndices()

Size grid_map::getSubmapSizeFromCornerIndices ( const Index topLeftIndex,
const Index bottomRightIndex,
const Size bufferSize,
const Index bufferStartIndex 
)

Computes the buffer size of a submap given a top left and a lower right index.

Parameters
topLeftIndexthe top left index in the map.
bottomRightIndexthe bottom right index in the map.
Returns
buffer size for the submap.

Definition at line 343 of file GridMapMath.cpp.

◆ incrementIndex()

bool grid_map::incrementIndex ( Index index,
const Size bufferSize,
const Index bufferStartIndex = Index::Zero() 
)

Increases the index by one to iterate through the map. 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.

Parameters

Definition at line 461 of file GridMapMath.cpp.

◆ incrementIndexForSubmap()

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

Definition at line 485 of file GridMapMath.cpp.

◆ randomCovariance()

template<int N>
Eigen::Matrix<double,N,N> grid_map::randomCovariance ( )

Definition at line 18 of file gtest_eigen.hpp.

◆ randomCovarianceXd()

Eigen::MatrixXd grid_map::randomCovarianceXd ( int  N)
inline

Definition at line 25 of file gtest_eigen.hpp.

◆ TEST() [1/49]

grid_map::TEST ( GridMap  ,
CopyConstructor   
)

Definition at line 16 of file GridMapTest.cpp.

◆ TEST() [2/49]

grid_map::TEST ( LineIterator  ,
StartOutsideMap   
)

Definition at line 17 of file LineIteratorTest.cpp.

◆ TEST() [3/49]

grid_map::TEST ( PositionFromIndex  ,
Simple   
)

Definition at line 24 of file GridMapMathTest.cpp.

◆ TEST() [4/49]

grid_map::TEST ( SubmapIterator  ,
Simple   
)

Definition at line 26 of file SubmapIteratorTest.cpp.

◆ TEST() [5/49]

grid_map::TEST ( GridMap  ,
CopyAssign   
)

Definition at line 33 of file GridMapTest.cpp.

◆ TEST() [6/49]

grid_map::TEST ( LineIterator  ,
EndOutsideMap   
)

Definition at line 42 of file LineIteratorTest.cpp.

◆ TEST() [7/49]

grid_map::TEST ( PositionFromIndex  ,
CircularBuffer   
)

Definition at line 51 of file GridMapMathTest.cpp.

◆ TEST() [8/49]

grid_map::TEST ( GridMap  ,
Move   
)

Definition at line 52 of file GridMapTest.cpp.

◆ TEST() [9/49]

grid_map::TEST ( LineIterator  ,
StartAndEndOutsideMap   
)

Definition at line 72 of file LineIteratorTest.cpp.

◆ TEST() [10/49]

grid_map::TEST ( IndexFromPosition  ,
Simple   
)

Definition at line 83 of file GridMapMathTest.cpp.

◆ TEST() [11/49]

grid_map::TEST ( SubmapIterator  ,
CircularBuffer   
)

Definition at line 88 of file SubmapIteratorTest.cpp.

◆ TEST() [12/49]

grid_map::TEST ( GridMap  ,
Transform   
)

Definition at line 91 of file GridMapTest.cpp.

◆ TEST() [13/49]

grid_map::TEST ( LineIterator  ,
StartAndEndOutsideMapWithoutIntersectingMap   
)

Definition at line 100 of file LineIteratorTest.cpp.

◆ TEST() [14/49]

grid_map::TEST ( LineIterator  ,
MovedMap   
)

Definition at line 108 of file LineIteratorTest.cpp.

◆ TEST() [15/49]

grid_map::TEST ( IndexFromPosition  ,
EdgeCases   
)

Definition at line 114 of file GridMapMathTest.cpp.

◆ TEST() [16/49]

grid_map::TEST ( GridMap  ,
ClipToMap   
)

Definition at line 131 of file GridMapTest.cpp.

◆ TEST() [17/49]

grid_map::TEST ( IndexFromPosition  ,
CircularBuffer   
)

Definition at line 137 of file GridMapMathTest.cpp.

◆ TEST() [18/49]

grid_map::TEST ( LineIterator  ,
StartAndEndOutsideMovedMap   
)

Definition at line 139 of file LineIteratorTest.cpp.

◆ TEST() [19/49]

grid_map::TEST ( checkIfPositionWithinMap  ,
Inside   
)

Definition at line 155 of file GridMapMathTest.cpp.

◆ TEST() [20/49]

grid_map::TEST ( GridMap  ,
ClipToMap2   
)

Definition at line 157 of file GridMapTest.cpp.

◆ TEST() [21/49]

grid_map::TEST ( checkIfPositionWithinMap  ,
Outside   
)

Definition at line 168 of file GridMapMathTest.cpp.

◆ TEST() [22/49]

grid_map::TEST ( checkIfPositionWithinMap  ,
EdgeCases   
)

Definition at line 180 of file GridMapMathTest.cpp.

◆ TEST() [23/49]

grid_map::TEST ( SubmapIterator  ,
InterleavedExecutionWithMove   
)

The submap should contain the same elements as before even after moving the underlying map.

                                                     +----------------------------+
                                                     |                            |
                                                     |                            |
         +----------------------------+              |                            |
         |0  0  0  0  0  0  0  0  0  0|              |      0  0  0  0  0  0  0  0|
         |     +----+                 |              |           +----+           |

Submap |1 1 |1 1| 1 1 1 1 1 1| | 1 1 |1 1| 1 1 1 1| +---—> | | | | | | | |2 2 |2 2| 2 2 2 2 2 2| | 2 2 |2 2| 2 2 2 2| | +-—+ | | +-—+ |

3 3 3 3 3 3 3 3 3 3Move 3 3 3 3 3 3 3 3
4 4 4 4 4 4 4 4 4 4+------—> 4 4 4 4 4 4 4 4
5 5 5 5 5 5 5 5 5 55 5 5 5 5 5 5 5
6 6 6 6 6 6 6 6 6 66 6 6 6 6 6 6 6
7 7 7 7 7 7 7 7 7 77 7 7 7 7 7 7 7

| | +-------------------------—+

8 8 8 8 8 8 8 8 8 8
9 9 9 9 9 9 9 9 9 9

+-------------------------—+

Definition at line 193 of file SubmapIteratorTest.cpp.

◆ TEST() [24/49]

grid_map::TEST ( getIndexShiftFromPositionShift  ,
All   
)

Definition at line 247 of file GridMapMathTest.cpp.

◆ TEST() [25/49]

grid_map::TEST ( getPositionShiftFromIndexShift  ,
All   
)

Definition at line 273 of file GridMapMathTest.cpp.

◆ TEST() [26/49]

grid_map::TEST ( checkIfIndexInRange  ,
All   
)

Definition at line 291 of file GridMapMathTest.cpp.

◆ TEST() [27/49]

grid_map::TEST ( boundIndexToRange  ,
All   
)

Definition at line 302 of file GridMapMathTest.cpp.

◆ TEST() [28/49]

grid_map::TEST ( wrapIndexToRange  ,
All   
)

Definition at line 335 of file GridMapMathTest.cpp.

◆ TEST() [29/49]

grid_map::TEST ( AddDataFrom  ,
ExtendMapAligned   
)

Definition at line 359 of file GridMapTest.cpp.

◆ TEST() [30/49]

grid_map::TEST ( boundPositionToRange  ,
Simple   
)

Definition at line 376 of file GridMapMathTest.cpp.

◆ TEST() [31/49]

grid_map::TEST ( AddDataFrom  ,
ExtendMapNotAligned   
)

Definition at line 386 of file GridMapTest.cpp.

◆ TEST() [32/49]

grid_map::TEST ( AddDataFrom  ,
CopyData   
)

Definition at line 419 of file GridMapTest.cpp.

◆ TEST() [33/49]

grid_map::TEST ( boundPositionToRange  ,
Position   
)

Definition at line 432 of file GridMapMathTest.cpp.

◆ TEST() [34/49]

grid_map::TEST ( ValueAtPosition  ,
NearestNeighbor   
)

Definition at line 448 of file GridMapTest.cpp.

◆ TEST() [35/49]

grid_map::TEST ( ValueAtPosition  ,
LinearInterpolated   
)

Definition at line 470 of file GridMapTest.cpp.

◆ TEST() [36/49]

grid_map::TEST ( getSubmapInformation  ,
Simple   
)

Definition at line 488 of file GridMapMathTest.cpp.

◆ TEST() [37/49]

grid_map::TEST ( getSubmapInformation  ,
Zero   
)

Definition at line 523 of file GridMapMathTest.cpp.

◆ TEST() [38/49]

grid_map::TEST ( getSubmapInformation  ,
ExceedingBoundaries   
)

Definition at line 559 of file GridMapMathTest.cpp.

◆ TEST() [39/49]

grid_map::TEST ( getSubmapInformation  ,
CircularBuffer   
)

Definition at line 612 of file GridMapMathTest.cpp.

◆ TEST() [40/49]

grid_map::TEST ( getSubmapInformation  ,
Debug1   
)

Definition at line 682 of file GridMapMathTest.cpp.

◆ TEST() [41/49]

grid_map::TEST ( getSubmapInformation  ,
Debug2   
)

Definition at line 711 of file GridMapMathTest.cpp.

◆ TEST() [42/49]

grid_map::TEST ( getBufferRegionsForSubmap  ,
Trivial   
)

Definition at line 740 of file GridMapMathTest.cpp.

◆ TEST() [43/49]

grid_map::TEST ( getBufferRegionsForSubmap  ,
Simple   
)

Definition at line 762 of file GridMapMathTest.cpp.

◆ TEST() [44/49]

grid_map::TEST ( getBufferRegionsForSubmap  ,
CircularBuffer   
)

Definition at line 778 of file GridMapMathTest.cpp.

◆ TEST() [45/49]

grid_map::TEST ( checkIncrementIndex  ,
Simple   
)

Definition at line 847 of file GridMapMathTest.cpp.

◆ TEST() [46/49]

grid_map::TEST ( checkIncrementIndex  ,
CircularBuffer   
)

Definition at line 883 of file GridMapMathTest.cpp.

◆ TEST() [47/49]

grid_map::TEST ( checkIncrementIndexForSubmap  ,
Simple   
)

Definition at line 938 of file GridMapMathTest.cpp.

◆ TEST() [48/49]

grid_map::TEST ( checkIncrementIndexForSubmap  ,
CircularBuffer   
)

Definition at line 983 of file GridMapMathTest.cpp.

◆ TEST() [49/49]

grid_map::TEST ( getIndexFromLinearIndex  ,
Simple   
)

Definition at line 1029 of file GridMapMathTest.cpp.

◆ wrapIndexToRange() [1/2]

void grid_map::wrapIndexToRange ( Index index,
const Size bufferSize 
)

Wraps an index that runs out of the range of the buffer back into allowed the region. This means that an index that overflows is reset to zero. This is the 2d version of wrapIndexToRange(int&, const int&).

Parameters

Definition at line 227 of file GridMapMath.cpp.

◆ wrapIndexToRange() [2/2]

void grid_map::wrapIndexToRange ( int &  index,
int  bufferSize 
)

Wraps an index that runs out of the range of the buffer back into allowed the region. This means that an index that overflows is reset to zero.

Parameters

Definition at line 234 of file GridMapMath.cpp.



grid_map_core
Author(s): Péter Fankhauser
autogenerated on Wed Jul 5 2023 02:23:35