line_iterator.hpp
Go to the documentation of this file.
1 
5 #pragma once
6 
7 #include <Eigen/Core>
8 #include "../iterators/submap_iterator.hpp"
9 #include "../cost_map.hpp"
10 
11 namespace cost_map {
12 
18 {
19 public:
20 
27  LineIterator(const cost_map::CostMap& gridMap, const Position& start, const Position& end);
28 
35  LineIterator(const cost_map::CostMap& gridMap, const Index& start, const Index& end);
36 
42  LineIterator& operator =(const LineIterator& other);
43 
48  bool operator !=(const LineIterator& other) const;
49 
54  const Index& operator *() const;
55 
61 
66  bool isPastEnd() const;
67 
68 private:
76  bool initialize(const cost_map::CostMap& cost_map, const Index& start, const Index& end);
77 
86  bool getIndexLimitedToMapRange(const cost_map::CostMap& cost_map, const Position& start,
87  const Position& end, Index& index);
88 
93 
96 
99 
102 
104  unsigned int iCell_;
105 
107  unsigned int nCells_;
108 
112 
116  double resolution_;
119 };
120 
121 } /* namespace */
bool operator!=(const LineIterator &other) const
Length mapLength_
Map information needed to get position from iterator.
LineIterator & operator=(const LineIterator &other)
Index start_
Starting index of the line.
Index index_
Current index.
bool initialize(const cost_map::CostMap &cost_map, const Index &start, const Index &end)
grid_map::Size Size
Definition: common.hpp:46
Index end_
Ending index of the line.
Size increment1_
Helper variables for Bresenham Line Drawing algorithm.
LineIterator(const cost_map::CostMap &gridMap, const Position &start, const Position &end)
bool getIndexLimitedToMapRange(const cost_map::CostMap &cost_map, const Position &start, const Position &end, Index &index)
grid_map::Index Index
Definition: common.hpp:45
grid_map::Position Position
Definition: common.hpp:41
unsigned int nCells_
Number of cells in the line.
unsigned int iCell_
Current cell number.
grid_map::Length Length
Definition: common.hpp:47


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