Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
grid_map::SlidingWindowIterator Class Reference

#include <SlidingWindowIterator.hpp>

Inheritance diagram for grid_map::SlidingWindowIterator:
Inheritance graph
[legend]

Public Types

enum  EdgeHandling { EdgeHandling::INSIDE, EdgeHandling::CROP, EdgeHandling::EMPTY, EdgeHandling::MEAN }
 

Public Member Functions

Matrix getData () const
 
SlidingWindowIteratoroperator++ () override
 
void setWindowLength (const GridMap &gridMap, double windowLength)
 
 SlidingWindowIterator (const GridMap &gridMap, const std::string &layer, const EdgeHandling &edgeHandling=EdgeHandling::CROP, size_t windowSize=3)
 
 SlidingWindowIterator (const SlidingWindowIterator *other)
 
- Public Member Functions inherited from grid_map::GridMapIterator
GridMapIterator end () const
 
const size_t & getLinearIndex () const
 
Index getUnwrappedIndex () const
 
 GridMapIterator (const grid_map::GridMap &gridMap)
 
 GridMapIterator (const GridMapIterator *other)
 
bool isPastEnd () const
 
bool operator!= (const GridMapIterator &other) const
 
Index operator* () const
 

Private Member Functions

bool dataInsideMap () const
 Check if data for current index is fully inside map. More...
 
void setup (const GridMap &gridMap)
 Setup members. More...
 

Private Attributes

const Matrixdata_
 Data. More...
 
const EdgeHandling edgeHandling_
 Edge handling method. More...
 
size_t windowMargin_ {0}
 Size of the border of the window around the center cell. More...
 
size_t windowSize_
 Size of the sliding window. More...
 

Additional Inherited Members

- Protected Attributes inherited from grid_map::GridMapIterator
bool isPastEnd_
 Is iterator out of scope. More...
 
size_t linearIndex_
 Linear index. More...
 
size_t linearSize_
 Linear size of the data. More...
 
Size size_
 Size of the buffer. More...
 
Index startIndex_
 Start index of the circular buffer. More...
 

Detailed Description

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.

Definition at line 24 of file SlidingWindowIterator.hpp.

Member Enumeration Documentation

◆ EdgeHandling

Enumerator
INSIDE 
CROP 
EMPTY 
MEAN 

Definition at line 28 of file SlidingWindowIterator.hpp.

Constructor & Destructor Documentation

◆ SlidingWindowIterator() [1/2]

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

Constructor.

Parameters
gridMapthe grid map to iterate on.
layerthe layer on which the data is accessed.
edgeHandlingthe method to handle edges of the map.
windowSizethe size of the moving window in number of cells (has to be an odd number!).

Definition at line 16 of file SlidingWindowIterator.cpp.

◆ SlidingWindowIterator() [2/2]

grid_map::SlidingWindowIterator::SlidingWindowIterator ( const SlidingWindowIterator other)
explicit

Copy constructor.

Parameters
otherthe object to copy.

Definition at line 26 of file SlidingWindowIterator.cpp.

Member Function Documentation

◆ dataInsideMap()

bool grid_map::SlidingWindowIterator::dataInsideMap ( ) const
private

Check if data for current index is fully inside map.

Definition at line 108 of file SlidingWindowIterator.cpp.

◆ getData()

Matrix grid_map::SlidingWindowIterator::getData ( ) const

Return the data of the sliding window.

Returns
the data of the sliding window.

Definition at line 59 of file SlidingWindowIterator.cpp.

◆ operator++()

SlidingWindowIterator & grid_map::SlidingWindowIterator::operator++ ( )
overridevirtual

Increase the iterator to the next element.

Returns
a reference to the updated iterator.

Reimplemented from grid_map::GridMapIterator.

Definition at line 44 of file SlidingWindowIterator.cpp.

◆ setup()

void grid_map::SlidingWindowIterator::setup ( const GridMap gridMap)
private

Setup members.

Definition at line 91 of file SlidingWindowIterator.cpp.

◆ setWindowLength()

void grid_map::SlidingWindowIterator::setWindowLength ( const GridMap gridMap,
double  windowLength 
)

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

Parameters
gridMapthe grid map to iterate on.
windowLengththe side length of the window (in m).

Definition at line 35 of file SlidingWindowIterator.cpp.

Member Data Documentation

◆ data_

const Matrix& grid_map::SlidingWindowIterator::data_
private

Data.

Definition at line 82 of file SlidingWindowIterator.hpp.

◆ edgeHandling_

const EdgeHandling grid_map::SlidingWindowIterator::edgeHandling_
private

Edge handling method.

Definition at line 79 of file SlidingWindowIterator.hpp.

◆ windowMargin_

size_t grid_map::SlidingWindowIterator::windowMargin_ {0}
private

Size of the border of the window around the center cell.

Definition at line 88 of file SlidingWindowIterator.hpp.

◆ windowSize_

size_t grid_map::SlidingWindowIterator::windowSize_
private

Size of the sliding window.

Definition at line 85 of file SlidingWindowIterator.hpp.


The documentation for this class was generated from the following files:


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