16 CircleIterator::CircleIterator(
const CostMap& gridMap,
const Position& center,
const double radius)
26 Index submapStartIndex;
27 Index submapBufferSize;
54 return *(*internalIterator_);
59 ++(*internalIterator_);
78 double squareNorm = (position -
center_).array().square().sum();
83 Index& startIndex,
Size& bufferSize)
const 85 Position topLeft = center.array() + radius;
86 Position bottomRight = center.array() - radius;
92 bufferSize = endIndex - startIndex + Index::Ones();
const Length & getLength() const
const Size & getSize() const
double getResolution() const
Length mapLength_
Map information needed to get position from iterator.
const Index & operator*() const
bool getIndexFromPosition(Index &index, const Position &position, const Length &mapLength, const Position &mapPosition, const double &resolution, const Size &bufferSize, const Index &bufferStartIndex=Index::Zero())
CircleIterator & operator++()
double radiusSquare_
Square of the radius for efficiency.
void findSubmapParameters(const Position ¢er, const double radius, Index &startIndex, Size &bufferSize) const
std::shared_ptr< SubmapIterator > internalIterator_
Grid submap iterator.
bool getPosition(const Index &index, Position &position) const
Position center_
Position of the circle center;.
grid_map::Position Position
bool getPositionFromIndex(Position &position, const Index &index, const Length &mapLength, const Position &mapPosition, const double &resolution, const Size &bufferSize, const Index &bufferStartIndex=Index::Zero())
bool operator!=(const CircleIterator &other) const
const Index & getStartIndex() const
void boundPositionToRange(Position &position, const Length &mapLength, const Position &mapPosition)
CircleIterator & operator=(const CircleIterator &other)
double radius_
Radius of the circle.