20 : center_(std::move(center)),
66 Eigen::Vector2d position;
68 double squareNorm = (position -
center_).array().square().sum();
90 normal.x() = -
signum(point.y());
91 normal.y() =
signum(point.x());
92 if (normal.x() != 0 &&
static_cast<unsigned int>(
Vector(point.x() + normal.x(), point.y()).norm()) ==
distance_) {
93 point.x() += normal.x();
94 }
else if (normal.y() != 0 &&
static_cast<unsigned int>(
Vector(point.x(), point.y() + normal.y()).norm()) ==
distance_) {
95 point.y() += normal.y();
97 point.x() += normal.x();
98 point.y() += normal.y();
100 }
while (static_cast<unsigned int>(point.x()) !=
distance_ || point.y() != 0);
static int signum(const int val)
const Size & getSize() const
Length mapLength_
Map information needed to get position from iterator.
double getResolution() const
std::vector< Index > pointsRing_
unsigned int nRings_
Number of rings into the circle is divided.
double radius_
Radius of the circle.
const Eigen::Array2i & operator*() const
bool isInside(const Index &index) const
double radiusSquare_
Square of the radius for efficiency.
bool checkIfIndexInRange(const Index &index, const Size &bufferSize)
bool operator!=(const SpiralIterator &other) const
bool getPositionFromIndex(Position &position, const Index &index, const Length &mapLength, const Position &mapPosition, const double &resolution, const Size &bufferSize, const Index &bufferStartIndex=Index::Zero())
SpiralIterator & operator++()
double getCurrentRadius() const
bool getIndex(const Position &position, Index &index) const
bool getPosition(const Index &index, Position &position) const
SpiralIterator(const grid_map::GridMap &gridMap, Eigen::Vector2d center, double radius)
const Length & getLength() const
Position center_
Position of the circle center;.