Class SlidingWindowIterator

Inheritance Relationships

Base Type

Class Documentation

class SlidingWindowIterator : public grid_map::GridMapIterator

Iterator class to iterate trough the entire grid map with access to a layer’s data through a sliding window. Note: This iterator only works with maps with zero start index.

Public Types

enum class EdgeHandling

Values:

enumerator INSIDE
enumerator CROP
enumerator EMPTY
enumerator MEAN

Public Functions

SlidingWindowIterator(const GridMap &gridMap, const std::string &layer, const EdgeHandling &edgeHandling = EdgeHandling::CROP, const size_t windowSize = 3)

Constructor.

Parameters:
  • gridMap – the grid map to iterate on.

  • layer – the layer on which the data is accessed.

  • edgeHandling – the method to handle edges of the map.

  • windowSize – the size of the moving window in number of cells (has to be an odd number!).

explicit SlidingWindowIterator(const SlidingWindowIterator *other)

Copy constructor.

Parameters:

other – the object to copy.

void setWindowLength(const GridMap &gridMap, const double windowLength)

Set the side length of the moving window (in m).

Parameters:
  • gridMap – the grid map to iterate on.

  • windowLength – the side length of the window (in m).

virtual SlidingWindowIterator &operator++()

Increase the iterator to the next element.

Returns:

a reference to the updated iterator.

const Matrix getData() const

Return the data of the sliding window.

Returns:

the data of the sliding window.