filters.hpp
Go to the documentation of this file.
1 
8 #pragma once
9 
10 #include <filters/filter_base.h>
12 
14 {
30  /*
31  * This filter finds all obstacles that are in the current map
32  * and adds cost buffers around them. Users need to specify the layer to
33  * operate on and the inflation size for space around obstacles.
34  */
35  class Inflation : public filters::FilterBase<grid_map::GridMap>
36  {
37  public:
38  Inflation();
39 
40  virtual ~Inflation();
41 
42  virtual bool configure();
43 
44  virtual bool update(const grid_map::GridMap &_mapIn, grid_map::GridMap &_mapOut);
45 
46  private:
47  std::string layer_;
49  };
50 
55  class OutlierRemoval : public filters::FilterBase<grid_map::GridMap>
56  {
57  public:
59 
60  virtual ~OutlierRemoval();
61 
62  virtual bool configure();
63 
64  virtual bool update(const grid_map::GridMap &_mapIn, grid_map::GridMap &_mapOut);
65 
75  bool IsOutlierPoint(grid_map::GridMap &, const grid_map::Index &);
76 
77  private:
78  std::string layer_;
79  };
80 
86  class RayTrace2d : public filters::FilterBase<grid_map::GridMap>
87  {
88  public:
89  RayTrace2d();
90 
91  virtual ~RayTrace2d();
92 
93  virtual bool configure();
94 
95  virtual bool update(const grid_map::GridMap &_mapIn, grid_map::GridMap &_mapOut);
96 
97  bool trace(grid_map::GridMap &_map, const grid_map::Index &start, const grid_map::Index &end);
98 
99  private:
100  std::string nongroundLayer_;
101  std::string groundLayer_;
103  std::string mode_;
104  };
105 
106 
107  class BayesUpdate: public filters::FilterBase<grid_map::GridMap>
108  {
109  public:
110  BayesUpdate();
111 
112  virtual ~BayesUpdate();
113 
114  virtual bool configure();
115 
116  virtual bool update(const grid_map::GridMap &_mapIn, grid_map::GridMap &_mapOut);
117 
118  double dynamicSenseOccGivenOcc(int numHits);
119  double dynamicSenseOccGivenEmp(int numHits);
120 
121  private:
122  std::string probabilityLayerStr_;
123  std::string historyLayerPrefix_;
125 
126  double startingProb_{0.5};
127  double probSenseEmpGivenOcc_{0.4};
128  double probSenseEmpGivenEmp_{0.8};
129  double probSenseOccGivenOccRate_{0.1};
130  double probSenseOccGivenOccOffset_{0.3};
131  double probSenseOccGivenEmpRate_{-0.1};
132  double probSenseOccGivenEmpOffset_{0.3};
133  };
134 
135  class ThresholdFilter: public filters::FilterBase<grid_map::GridMap>
136  {
137  public:
138  ThresholdFilter();
139 
140  virtual ~ThresholdFilter();
141 
142  virtual bool configure();
143 
144  virtual bool update(const grid_map::GridMap &_mapIn, grid_map::GridMap &_mapOut);
145 
146  private:
147  std::string valueLayerStr_;
148  std::string outputLayerStr_;
149  float threshold_;
151  };
152 } // namespace mitre_fast_layered_map
Eigen::Array2i Index
double inflationSideLen_m_
Determines length of side of square to inflate around an obstacle.
Definition: filters.hpp:48
virtual bool update(const grid_map::GridMap &_mapIn, grid_map::GridMap &_mapOut)
Definition: inflation.cpp:42
std::string historyLayerPrefix_
Prefix for historys layers. Should follow prefix + (int) i standard.
Definition: filters.hpp:123
std::string layer_
Layer of grid map to perform outlier removal on.
Definition: filters.hpp:78
std::string probabilityLayerStr_
Layer that holds accumulated probability until now.
Definition: filters.hpp:122
std::string layer_
Layer of grid map to perform outlier removal on.
Definition: filters.hpp:47
int historyCount_
Num history layers use.
Definition: filters.hpp:124
std::string mode_
Production or testing. If testing mode will throw errors if calculations break bounds.
Definition: filters.hpp:103
std::string nongroundLayer_
blocking rays
Definition: filters.hpp:100


mitre_fast_layered_map
Author(s):
autogenerated on Thu Mar 11 2021 03:06:49