cell_occupancy_estimator.h
Go to the documentation of this file.
1 
7 #ifndef _CELL_OCCUPANCY_ESTIMATOR_H
8 #define _CELL_OCCUPANCY_ESTIMATOR_H
9 
10 #include "../geometry_utils.h"
11 
16 struct Occupancy {
17  double prob_occ;
19  double x, y;
20 
26  Occupancy(double prob, double quality) :
27  prob_occ(prob), estimation_quality(quality) {}
28 
36  Occupancy(double prob, double quality, double curr_x, double curr_y) :
37  prob_occ(prob), estimation_quality(quality), x(curr_x), y(curr_y) {}
38 
39  bool operator==(const Occupancy &that) {
40  return EQ_DOUBLE(prob_occ, that.prob_occ) &&
41  EQ_DOUBLE(estimation_quality, that.estimation_quality);
42  }
43 };
47 struct Beam {
48  double x_st, y_st;
49  double x_end, y_end;
50 };
51 
57 public:
58 
64  CellOccupancyEstimator(double base_occ_prob, double base_empty_prob):
65  _base_occ_prob(base_occ_prob), _base_empty_prob(base_empty_prob) {}
66 
74  virtual Occupancy estimate_occupancy(const Beam &beam,
75  const Rectangle &cell_bnds,
76  bool is_occ) = 0;
77 protected:
78 
80  double base_occ_prob() { return _base_occ_prob; }
81 
83  double base_empty_prob() { return _base_empty_prob; }
84 private:
85  double _base_occ_prob, _base_empty_prob;
86 };
87 
88 #endif
Occupancy(double prob, double quality, double curr_x, double curr_y)
double y
The estimated obstacle center.
double base_empty_prob()
Returns the probability of being empty.
#define EQ_DOUBLE(a, b)
Occupancy(double prob, double quality)
CellOccupancyEstimator(double base_occ_prob, double base_empty_prob)
double y_end
Coordinates where the beam reaches an obstacle.
bool operator==(const Occupancy &that)
Defines an axis-aligned rectangle.
double base_occ_prob()
Returns the probability of being occupied.
double y_st
Coordinates of a start of the beam.


tiny_slam
Author(s):
autogenerated on Mon Jun 10 2019 15:30:57