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  size_t windowSize = 3);
45 
50  explicit SlidingWindowIterator(const SlidingWindowIterator* other);
51 
57  void setWindowLength(const GridMap& gridMap, double windowLength);
58 
64 
69  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_{0};
89 
90  public:
91  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
92 };
93 
94 } // namespace grid_map
95 
const EdgeHandling edgeHandling_
Edge handling method.
bool dataInsideMap() const
Check if data for current index is fully inside map.
size_t windowSize_
Size of the sliding window.
size_t windowMargin_
Size of the border of the window around the center cell.
void setWindowLength(const GridMap &gridMap, double windowLength)
Eigen::MatrixXf Matrix
Definition: TypeDefs.hpp:16
void setup(const GridMap &gridMap)
Setup members.
SlidingWindowIterator & operator++() override
SlidingWindowIterator(const GridMap &gridMap, const std::string &layer, const EdgeHandling &edgeHandling=EdgeHandling::CROP, size_t windowSize=3)


grid_map_core
Author(s): Péter Fankhauser
autogenerated on Wed Jul 5 2023 02:23:35