1 #ifndef SLAM_CTOR_CORE_GRID_MAP_H 2 #define SLAM_CTOR_CORE_GRID_MAP_H 16 static constexpr
int width = 1000;
17 static constexpr
int height = 1000;
25 GridMap(std::shared_ptr<GridCell> prototype,
28 params.meters_per_cell}
29 , _cell_prototype{prototype} {}
32 return _cell_prototype->clone();
43 auto const_this =
static_cast<const decltype(this)
>(
this);
44 auto &area =
const_cast<GridCell&
>((*const_this)[area_id]);
49 return (*
this)[area_id].occupancy().prob_occ;
55 auto const_this =
static_cast<const decltype(this)
>(
this);
56 auto &area =
const_cast<GridCell&
>((*const_this)[area_id]);
60 virtual const GridCell &operator[](
const Coord& coord)
const = 0;
64 return std::vector<char>();
void update(const Coord &area_id, const AreaOccupancyObservation &aoo) override
Updates area with a given observation.
std::unique_ptr< GridCell > new_cell() const
static constexpr GridMapParams gmp
std::shared_ptr< GridCell > cell_prototype() const
A base class for occupancy maps.
virtual std::vector< char > save_state() const
GridMap(std::shared_ptr< GridCell > prototype, const GridMapParams ¶ms=MapValues::gmp)
virtual void load_state(const std::vector< char > &)
std::shared_ptr< GridCell > _cell_prototype
double occupancy(const Coord &area_id) const override
Returns known information about the occupancy of a given area.
virtual void reset(const Coord &area_id, const GridCell &new_area)