spiral_iterator.hpp
Go to the documentation of this file.
1 
5 #pragma once
6 
7 #include <Eigen/Core>
8 
9 // unique_ptr
10 #include <memory>
11 #include <vector>
12 
13 #include "../cost_map.hpp"
14 
15 namespace cost_map {
16 
21 {
22 public:
23 
30  SpiralIterator(const cost_map::CostMap& gridMap, const Eigen::Vector2d& center, const double radius);
31 
38 
43  bool operator !=(const SpiralIterator& other) const;
44 
49  const Eigen::Array2i& operator *() const;
50 
56 
61  bool isPastEnd() const;
62 
67  double getCurrentRadius() const;
68 
69 private:
70 
75  bool isInside(const Index index) const;
76 
81  void generateRing();
82 
83  int signum(const int val) {
84  return (0 < val) - (val < 0);
85  }
86 
90 
91 
93  double radius_;
94 
96  double radiusSquare_;
97 
99  unsigned int nRings_;
100  unsigned int distance_;
101  std::vector<Index> pointsRing_;
102 
106  double resolution_;
108 };
109 
110 } /* namespace */
Position center_
Position of the circle center;.
SpiralIterator & operator=(const SpiralIterator &other)
std::vector< Index > pointsRing_
bool isInside(const Index index) const
Length mapLength_
Map information needed to get position from iterator.
bool operator!=(const SpiralIterator &other) const
grid_map::Size Size
Definition: common.hpp:46
const Eigen::Array2i & operator*() const
double radius_
Radius of the circle.
double radiusSquare_
Square of the radius for efficiency.
double getCurrentRadius() const
grid_map::Index Index
Definition: common.hpp:45
unsigned int nRings_
Number of rings into the circle is divided.
grid_map::Position Position
Definition: common.hpp:41
SpiralIterator & operator++()
grid_map::Length Length
Definition: common.hpp:47
int signum(const int val)
SpiralIterator(const cost_map::CostMap &gridMap, const Eigen::Vector2d &center, const double radius)


cost_map_core
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:03:41