EllipseIterator.hpp
Go to the documentation of this file.
1 /*
2  * EllipseIterator.hpp
3  *
4  * Created on: Dec 2, 2015
5  * Author: Péter Fankhauser
6  * Institute: ETH Zurich, ANYbotics
7  */
8 
9 #pragma once
10 
13 
14 #include <Eigen/Core>
15 
16 #include <memory>
17 
18 namespace grid_map {
19 
25 {
26 public:
27 
35  EllipseIterator(const GridMap& gridMap, const Position& center, const Length& length, const double rotation = 0.0);
36 
43 
48  bool operator !=(const EllipseIterator& other) const;
49 
54  const Index& operator *() const;
55 
61 
66  bool isPastEnd() const;
67 
72  const Size& getSubmapSize() const;
73 
74 private:
75 
80  bool isInside() const;
81 
90  void findSubmapParameters(const Position& center, const Length& length, const double rotation,
91  Index& startIndex, Size& bufferSize) const;
92 
95 
97  Eigen::Array2d semiAxisSquare_;
98 
100  Eigen::Matrix2d transformMatrix_;
101 
103  std::shared_ptr<SubmapIterator> internalIterator_;
104 
108  double resolution_;
111 
112  public:
113  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
114 };
115 
116 } /* namespace */
Eigen::Array2i Index
Definition: TypeDefs.hpp:22
Length mapLength_
Map information needed to get position from iterator.
void findSubmapParameters(const Position &center, const Length &length, const double rotation, Index &startIndex, Size &bufferSize) const
Eigen::Array2i Size
Definition: TypeDefs.hpp:23
EllipseIterator & operator=(const EllipseIterator &other)
Position center_
Position of the circle center;.
EllipseIterator & operator++()
const Index & operator*() const
Eigen::Matrix2d transformMatrix_
Sine and cosine values of the rotation angle as transformation matrix.
bool operator!=(const EllipseIterator &other) const
std::shared_ptr< SubmapIterator > internalIterator_
Grid submap iterator. // TODO Think of using unique_ptr instead.
Eigen::Vector2d Position
Definition: TypeDefs.hpp:18
EllipseIterator(const GridMap &gridMap, const Position &center, const Length &length, const double rotation=0.0)
Eigen::Array2d semiAxisSquare_
Square length of the semi axis.
const Size & getSubmapSize() const
Eigen::Array2d Length
Definition: TypeDefs.hpp:24


grid_map_core
Author(s): Péter Fankhauser
autogenerated on Sun Sep 13 2020 03:15:22