MCPcopy Create free account
hub / github.com/ANYbotics/grid_map / SpiralIterator

Method SpiralIterator

grid_map_core/src/iterators/SpiralIterator.cpp:18–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16namespace grid_map {
17
18SpiralIterator::SpiralIterator(const grid_map::GridMap& gridMap, const Eigen::Vector2d& center,
19 const double radius)
20 : center_(center),
21 radius_(radius),
22 distance_(0)
23{
24 radiusSquare_ = radius_ * radius_;
25 mapLength_ = gridMap.getLength();
26 mapPosition_ = gridMap.getPosition();
27 resolution_ = gridMap.getResolution();
28 bufferSize_ = gridMap.getSize();
29 gridMap.getIndex(center_, indexCenter_);
30 nRings_ = std::ceil(radius_ / resolution_);
31 if (checkIfIndexInRange(indexCenter_, bufferSize_))
32 pointsRing_.push_back(indexCenter_);
33 else
34 while(pointsRing_.empty() && !isPastEnd())
35 generateRing();
36}
37
38SpiralIterator& SpiralIterator::operator =(const SpiralIterator& other)
39{

Callers

nothing calls this directly

Calls 4

checkIfIndexInRangeFunction · 0.85
getPositionMethod · 0.80
getIndexMethod · 0.80
getResolutionMethod · 0.45

Tested by

no test coverage detected