Go to the documentation of this file.00001
00007 #ifndef _CELL_OCCUPANCY_ESTIMATOR_H
00008 #define _CELL_OCCUPANCY_ESTIMATOR_H
00009
00010 #include "../geometry_utils.h"
00011
00016 struct Occupancy {
00017 double prob_occ;
00018 double estimation_quality;
00019 double x, y;
00020
00026 Occupancy(double prob, double quality) :
00027 prob_occ(prob), estimation_quality(quality) {}
00028
00036 Occupancy(double prob, double quality, double curr_x, double curr_y) :
00037 prob_occ(prob), estimation_quality(quality), x(curr_x), y(curr_y) {}
00038
00039 bool operator==(const Occupancy &that) {
00040 return EQ_DOUBLE(prob_occ, that.prob_occ) &&
00041 EQ_DOUBLE(estimation_quality, that.estimation_quality);
00042 }
00043 };
00047 struct Beam {
00048 double x_st, y_st;
00049 double x_end, y_end;
00050 };
00051
00056 class CellOccupancyEstimator {
00057 public:
00058
00064 CellOccupancyEstimator(double base_occ_prob, double base_empty_prob):
00065 _base_occ_prob(base_occ_prob), _base_empty_prob(base_empty_prob) {}
00066
00074 virtual Occupancy estimate_occupancy(const Beam &beam,
00075 const Rectangle &cell_bnds,
00076 bool is_occ) = 0;
00077 protected:
00078
00080 double base_occ_prob() { return _base_occ_prob; }
00081
00083 double base_empty_prob() { return _base_empty_prob; }
00084 private:
00085 double _base_occ_prob, _base_empty_prob;
00086 };
00087
00088 #endif