1 #ifndef SLAM_CTOR_CORE_OCCUPANCY_OBSERVATION_PROBABILITY_H 2 #define SLAM_CTOR_CORE_OCCUPANCY_OBSERVATION_PROBABILITY_H 5 #include "../maps/grid_rasterization.h" 17 const GridMap &map)
const override {
30 const GridMap &map)
const override {
32 auto max_probability =
double{0};
35 while (area_ids.has_next()) {
36 auto area_id = area_ids.next();
37 double obs_prob = 1.0 - map[area_id].discrepancy(aoo);
38 assert(0 <= obs_prob);
39 max_probability = std::max(obs_prob, max_probability);
41 return max_probability;
50 const GridMap &map)
const override {
52 auto tot_probability =
double{0};
53 auto area_nm =
unsigned{0};
56 while (area_ids.has_next()) {
57 auto obs_prob = 1.0 - map[area_ids.next()].discrepancy(aoo);
58 assert(0 <= obs_prob);
59 tot_probability += obs_prob;
62 return area_nm ? tot_probability / area_nm : 0.5;
71 const GridMap &map)
const override {
73 double tot_probability = 0;
74 double tot_weight = 0;
77 while (area_ids.has_next()) {
78 auto area_id = area_ids.next();
79 auto obs_prob = 1.0 - map[area_id].discrepancy(aoo);
80 assert(0 <= obs_prob);
82 tot_probability += obs_prob * weight;
85 return tot_weight ? tot_probability / tot_weight : 0.5;
Coord world_to_cell(const Point2D &pt) const
Rectangle world_cell_bounds(const Coord &coord) const
double probability(const AreaOccupancyObservation &aoo, const LightWeightRectangle &area, const GridMap &map) const override
double probability(const AreaOccupancyObservation &aoo, const LightWeightRectangle &area, const GridMap &map) const override
double probability(const AreaOccupancyObservation &aoo, const LightWeightRectangle &area, const GridMap &map) const override
double probability(const AreaOccupancyObservation &aoo, const LightWeightRectangle &, const GridMap &map) const override