| 16 | namespace grid_map { |
| 17 | |
| 18 | SpiralIterator::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 | |
| 38 | SpiralIterator& SpiralIterator::operator =(const SpiralIterator& other) |
| 39 | { |
nothing calls this directly
no test coverage detected