1#ifndef BITSIM_PLANNING_PROBABILITY_GRID_H
2#define BITSIM_PLANNING_PROBABILITY_GRID_H
35 using Point = std::array<real_t, 2>;
60 const Parameters ¶meters);
95 void integrate_scan(
const std::array<real_t, 3> &pose,
const std::vector<real_t> &bearings,
96 const std::vector<real_t> &ranges,
real_t max_range);
104 bool unknown_is_occupied =
true)
const;
107 std::size_t index_(
const GridCell &c)
const noexcept;
119 std::vector<real_t> log_odds_;
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
A rectangle of the plane cut into square cells, each free or occupied.
Definition occupancy_grid.h:43
void integrate_beam(const Point &origin, const Point &endpoint, bool hit)
Fold one range beam into the map: the cells from origin to endpoint are made more likely free,...
Definition probability_grid.cpp:89
uint_t n_cols() const noexcept
Definition probability_grid.h:62
real_t cell_size() const noexcept
Definition probability_grid.h:64
GridCell to_cell(real_t x, real_t y) const noexcept
Definition probability_grid.cpp:53
std::array< real_t, 2 > Point
Definition probability_grid.h:35
std::array< real_t, 2 > to_world(const GridCell &c) const noexcept
Definition probability_grid.cpp:59
bool in_bounds(const GridCell &c) const noexcept
Definition probability_grid.cpp:42
real_t probability(const GridCell &c) const noexcept
The probability that the cell is occupied, 0.5 for an unknown or out-of-bounds cell.
Definition probability_grid.cpp:64
void integrate_scan(const std::array< real_t, 3 > &pose, const std::vector< real_t > &bearings, const std::vector< real_t > &ranges, real_t max_range)
Fold a whole scan taken at pose (x, y, heading): beam i is cast along heading + bearings[i] and measu...
Definition probability_grid.cpp:133
bool is_known(const GridCell &c) const noexcept
Whether any beam has touched the cell. An untouched cell keeps the 0.5 prior.
Definition probability_grid.cpp:74
uint_t n_rows() const noexcept
Definition probability_grid.h:63
OccupancyGrid to_occupancy_grid(real_t occupied_threshold=0.5, bool unknown_is_occupied=true) const
The map as an OccupancyGrid for a planner: a cell is occupied if its probability is at least occupied...
Definition probability_grid.cpp:151
ProbabilityGrid(uint_t n_cols, uint_t n_rows, real_t cell_size, real_t x0=0.0, real_t y0=0.0)
Definition probability_grid.cpp:17
Definition a_star_search.cpp:8
Definition dc_motor_backend_base.h:9
std::size_t uint_t
uint_t
Definition bitsim_types.h:40
double real_t
real_t
Definition bitsim_types.h:20
A cell of an OccupancyGrid: its column, along x, and row, along y.
Definition occupancy_grid.h:21
The inverse sensor model: how strongly one beam moves a cell's probability.
Definition probability_grid.h:39
real_t p_max
Definition probability_grid.h:43
real_t p_min
the probability is clamped to [p_min, p_max]
Definition probability_grid.h:42
real_t p_miss
a cell a beam passes through is this likely occupied (< 0.5)
Definition probability_grid.h:41
real_t p_hit
a cell a beam ends on is this likely occupied
Definition probability_grid.h:40