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

#include <ellipse_iterator.hpp>

Public Member Functions

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

Private Member Functions

void findSubmapParameters (const Position &center, const Length &length, const 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 20 of file ellipse_iterator.hpp.

Constructor & Destructor Documentation

cost_map::EllipseIterator::EllipseIterator ( const CostMap gridMap,
const Position center,
const Length length,
const 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 src/lib/iterators/ellipse_iterator.cpp.

Member Function Documentation

void cost_map::EllipseIterator::findSubmapParameters ( const Position center,
const Length length,
const 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 85 of file src/lib/iterators/ellipse_iterator.cpp.

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

Check if current index is inside the ellipse.

Returns
true if inside, false otherwise.

Definition at line 77 of file src/lib/iterators/ellipse_iterator.cpp.

bool cost_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 72 of file src/lib/iterators/ellipse_iterator.cpp.

bool cost_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 50 of file src/lib/iterators/ellipse_iterator.cpp.

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

Dereference the iterator with const.

Returns
the value to which the iterator is pointing.

Definition at line 55 of file src/lib/iterators/ellipse_iterator.cpp.

EllipseIterator & cost_map::EllipseIterator::operator++ ( )

Increase the iterator to the next element.

Returns
a reference to the updated iterator.

Definition at line 60 of file src/lib/iterators/ellipse_iterator.cpp.

EllipseIterator & cost_map::EllipseIterator::operator= ( const EllipseIterator other)

Assignment operator.

Parameters
iteratorthe iterator to copy data from.
Returns
a reference to *this.

Definition at line 36 of file src/lib/iterators/ellipse_iterator.cpp.

Member Data Documentation

Size cost_map::EllipseIterator::bufferSize_
private

Definition at line 99 of file ellipse_iterator.hpp.

Index cost_map::EllipseIterator::bufferStartIndex_
private

Definition at line 100 of file ellipse_iterator.hpp.

Position cost_map::EllipseIterator::center_
private

Position of the circle center;.

Definition at line 84 of file ellipse_iterator.hpp.

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

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

Definition at line 93 of file ellipse_iterator.hpp.

Length cost_map::EllipseIterator::mapLength_
private

Map information needed to get position from iterator.

Definition at line 96 of file ellipse_iterator.hpp.

Position cost_map::EllipseIterator::mapPosition_
private

Definition at line 97 of file ellipse_iterator.hpp.

double cost_map::EllipseIterator::resolution_
private

Definition at line 98 of file ellipse_iterator.hpp.

Eigen::Array2d cost_map::EllipseIterator::semiAxisSquare_
private

Square length of the semi axis.

Definition at line 87 of file ellipse_iterator.hpp.

Eigen::Matrix2d cost_map::EllipseIterator::transformMatrix_
private

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

Definition at line 90 of file ellipse_iterator.hpp.


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


cost_map_core
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:03:41