SlidingWindowIterator.hpp
Go to the documentation of this file.
1 /*
2  * SlidingWindowIterator.hpp
3  *
4  * Created on: Aug 17, 2017
5  * Author: Péter Fankhauser
6  * Institute: ETH Zurich, ANYbotics
7  */
8 
9 #pragma once
10 
12 
14 
15 #include <Eigen/Core>
16 
17 namespace grid_map {
18 
25 {
26 public:
27 
28  enum class EdgeHandling {
29  INSIDE, // Only visit indices that are surrounded by a full window.
30  CROP, // Crop data matrix with missing cells at edges.
31  EMPTY, // Fill in missing edges with empty cells (NAN-value).
32  MEAN // Fill in missing edges with MEAN of valid values.
33  };
34 
42  SlidingWindowIterator(const GridMap& gridMap, const std::string& layer,
43  const EdgeHandling& edgeHandling = EdgeHandling::CROP,
44  const size_t windowSize = 3);
45 
51 
57  void setWindowLength(const GridMap& gridMap, const double windowLength);
58 
64 
69  const Matrix getData() const;
70 
71 private:
73  void setup(const GridMap& gridMap);
74 
76  bool dataInsideMap() const;
77 
80 
82  const Matrix& data_;
83 
85  size_t windowSize_;
86 
88  size_t windowMargin_;
89 
90  public:
91  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
92 };
93 
94 } /* namespace */
bool dataInsideMap() const
Check if data for current index is fully inside map.
const EdgeHandling edgeHandling_
Edge handling method.
size_t windowSize_
Size of the sliding window.
size_t windowMargin_
Size of the border of the window around the center cell.
Eigen::MatrixXf Matrix
Definition: TypeDefs.hpp:16
SlidingWindowIterator(const GridMap &gridMap, const std::string &layer, const EdgeHandling &edgeHandling=EdgeHandling::CROP, const size_t windowSize=3)
SlidingWindowIterator & operator++()
void setup(const GridMap &gridMap)
Setup members.
void setWindowLength(const GridMap &gridMap, const double windowLength)


grid_map_core
Author(s): Péter Fankhauser
autogenerated on Tue Jun 25 2019 20:02:08