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

#include <EllipseIterator.hpp>

Public Member Functions

 EllipseIterator (const GridMap &gridMap, const Position &center, const Length &length, double rotation=0.0)
 
const SizegetSubmapSize () const
 
bool isPastEnd () const
 
bool operator!= (const EllipseIterator &other) const
 
const Indexoperator* () const
 
EllipseIteratoroperator++ ()
 

Private Member Functions

void findSubmapParameters (const Position &center, const Length &length, double rotation, Index &startIndex, Size &bufferSize) const
 
bool isInside () const
 

Private Attributes

Size bufferSize_
 
Index bufferStartIndex_
 
Position center_
 Position of the circle center;. More...
 
std::shared_ptr< SubmapIteratorinternalIterator_
 Grid submap iterator. // TODO Think of using unique_ptr instead. More...
 
Length mapLength_
 Map information needed to get position from iterator. More...
 
Position mapPosition_
 
double resolution_
 
Eigen::Array2d semiAxisSquare_
 Square length of the semi axis. More...
 
Eigen::Matrix2d transformMatrix_
 Sine and cosine values of the rotation angle as transformation matrix. More...
 

Detailed Description

Iterator class to iterate through a ellipsoid area of the map. The main axis of the ellipse are aligned with the map frame.

Definition at line 24 of file EllipseIterator.hpp.

Constructor & Destructor Documentation

◆ EllipseIterator()

grid_map::EllipseIterator::EllipseIterator ( const GridMap gridMap,
const Position center,
const Length length,
double  rotation = 0.0 
)

Constructor.

Parameters
gridMapthe grid map to iterate on.
centerthe position of the ellipse center.
lengththe length of the main axis.
anglethe rotation angle of the ellipse (in [rad]).

Definition at line 17 of file EllipseIterator.cpp.

Member Function Documentation

◆ findSubmapParameters()

void grid_map::EllipseIterator::findSubmapParameters ( const Position center,
const Length length,
double  rotation,
Index startIndex,
Size bufferSize 
) const
private

Finds the submap that fully contains the ellipse and returns the parameters.

Parameters
[in]centerthe position of the ellipse center.
[in]lengththe length of the main axis.
[in]anglethe rotation angle of the ellipse (in [rad]).
[out]startIndexthe start index of the submap.
[out]bufferSizethe buffer size of the submap.

Definition at line 82 of file EllipseIterator.cpp.

◆ getSubmapSize()

const Size & grid_map::EllipseIterator::getSubmapSize ( ) const

Returns the size of the submap covered by the iterator.

Returns
the size of the submap covered by the iterator.

Definition at line 69 of file EllipseIterator.cpp.

◆ isInside()

bool grid_map::EllipseIterator::isInside ( ) const
private

Check if current index is inside the ellipse.

Returns
true if inside, false otherwise.

Definition at line 74 of file EllipseIterator.cpp.

◆ isPastEnd()

bool grid_map::EllipseIterator::isPastEnd ( ) const

Indicates if iterator is past end.

Returns
true if iterator is out of scope, false if end has not been reached.

Definition at line 64 of file EllipseIterator.cpp.

◆ operator!=()

bool grid_map::EllipseIterator::operator!= ( const EllipseIterator other) const

Compare to another iterator.

Returns
whether the current iterator points to a different address than the other one.

Definition at line 38 of file EllipseIterator.cpp.

◆ operator*()

const Eigen::Array2i & grid_map::EllipseIterator::operator* ( ) const

Dereference the iterator with const.

Returns
the value to which the iterator is pointing.

Definition at line 43 of file EllipseIterator.cpp.

◆ operator++()

EllipseIterator & grid_map::EllipseIterator::operator++ ( )

Increase the iterator to the next element.

Returns
a reference to the updated iterator.

Definition at line 48 of file EllipseIterator.cpp.

Member Data Documentation

◆ bufferSize_

Size grid_map::EllipseIterator::bufferSize_
private

Definition at line 102 of file EllipseIterator.hpp.

◆ bufferStartIndex_

Index grid_map::EllipseIterator::bufferStartIndex_
private

Definition at line 103 of file EllipseIterator.hpp.

◆ center_

Position grid_map::EllipseIterator::center_
private

Position of the circle center;.

Definition at line 87 of file EllipseIterator.hpp.

◆ internalIterator_

std::shared_ptr<SubmapIterator> grid_map::EllipseIterator::internalIterator_
private

Grid submap iterator. // TODO Think of using unique_ptr instead.

Definition at line 96 of file EllipseIterator.hpp.

◆ mapLength_

Length grid_map::EllipseIterator::mapLength_
private

Map information needed to get position from iterator.

Definition at line 99 of file EllipseIterator.hpp.

◆ mapPosition_

Position grid_map::EllipseIterator::mapPosition_
private

Definition at line 100 of file EllipseIterator.hpp.

◆ resolution_

double grid_map::EllipseIterator::resolution_
private

Definition at line 101 of file EllipseIterator.hpp.

◆ semiAxisSquare_

Eigen::Array2d grid_map::EllipseIterator::semiAxisSquare_
private

Square length of the semi axis.

Definition at line 90 of file EllipseIterator.hpp.

◆ transformMatrix_

Eigen::Matrix2d grid_map::EllipseIterator::transformMatrix_
private

Sine and cosine values of the rotation angle as transformation matrix.

Definition at line 93 of file EllipseIterator.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