#include <ellipse_iterator.hpp>
Public Member Functions | |
EllipseIterator (const CostMap &gridMap, const Position ¢er, const Length &length, const double rotation=0.0) | |
bool | isPastEnd () const |
bool | operator!= (const EllipseIterator &other) const |
const Index & | operator* () const |
EllipseIterator & | operator++ () |
EllipseIterator & | operator= (const EllipseIterator &other) |
Private Member Functions | |
void | findSubmapParameters (const Position ¢er, 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;. | |
std::shared_ptr< SubmapIterator > | internalIterator_ |
Grid submap iterator. // TODO Think of using unique_ptr instead. | |
Length | mapLength_ |
Map information needed to get position from iterator. | |
Position | mapPosition_ |
double | resolution_ |
Eigen::Array2d | semiAxisSquare_ |
Square length of the semi axis. | |
Eigen::Matrix2d | transformMatrix_ |
Sine and cosine values of the rotation angle as transformation matrix. |
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.
cost_map::EllipseIterator::EllipseIterator | ( | const CostMap & | gridMap, |
const Position & | center, | ||
const Length & | length, | ||
const double | rotation = 0.0 |
||
) |
Constructor.
gridMap | the grid map to iterate on. |
center | the position of the ellipse center. |
length | the length of the main axis. |
angle | the rotation angle of the ellipse (in [rad]). |
Definition at line 17 of file src/lib/iterators/ellipse_iterator.cpp.
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.
[in] | center | the position of the ellipse center. |
[in] | length | the length of the main axis. |
[in] | angle | the rotation angle of the ellipse (in [rad]). |
[out] | startIndex | the start index of the submap. |
[out] | bufferSize | the 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.
Definition at line 77 of file src/lib/iterators/ellipse_iterator.cpp.
bool cost_map::EllipseIterator::isPastEnd | ( | ) | const |
Indicates if iterator is past end.
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.
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.
Definition at line 55 of file src/lib/iterators/ellipse_iterator.cpp.
EllipseIterator & cost_map::EllipseIterator::operator++ | ( | ) |
Increase the iterator to the next element.
Definition at line 60 of file src/lib/iterators/ellipse_iterator.cpp.
EllipseIterator & cost_map::EllipseIterator::operator= | ( | const EllipseIterator & | other | ) |
Assignment operator.
iterator | the iterator to copy data from. |
Definition at line 36 of file src/lib/iterators/ellipse_iterator.cpp.
Size cost_map::EllipseIterator::bufferSize_ [private] |
Definition at line 99 of file ellipse_iterator.hpp.
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.
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.