mock_grid_cell.h
Go to the documentation of this file.
1 #ifndef SLAM_CTOR_TESTS_MOCK_GRID_CELL_H_INCLUDED
2 #define SLAM_CTOR_TESTS_MOCK_GRID_CELL_H_INCLUDED
3 
4 #include "../../src/core/maps/grid_cell.h"
5 
6 class MockGridCell : public GridCell {
7 public:
8  static constexpr double Default_Occ_Prob = 0.5;
9 public:
10  MockGridCell(double occ_prob = Default_Occ_Prob)
11  : GridCell{Occupancy{occ_prob, 0}} {}
12 
13  std::unique_ptr<GridCell> clone() const override {
14  return std::make_unique<MockGridCell>(*this);
15  }
16 
17  void operator+=(const AreaOccupancyObservation &aoo) override {
18  _occupancy = aoo.occupancy;
19  }
20 
21  double discrepancy(const AreaOccupancyObservation &aoo) const override {
22  return std::abs(_occupancy - aoo.occupancy);
23  }
24 };
25 
26 // TODO: move to *.cpp file
27 constexpr double MockGridCell::Default_Occ_Prob;
28 
29 #endif
std::unique_ptr< GridCell > clone() const override
void operator+=(const AreaOccupancyObservation &aoo) override
double discrepancy(const AreaOccupancyObservation &aoo) const override
MockGridCell(double occ_prob=Default_Occ_Prob)
static constexpr double Default_Occ_Prob
Definition: mock_grid_cell.h:8
Occupancy _occupancy
Definition: grid_cell.h:47


slam_constructor
Author(s): JetBrains Research, OSLL team
autogenerated on Mon Jun 10 2019 15:08:25