23 #include "occupancygrid.h" 154 if((
isProb(prob)) || (prob == -1.f)) {
155 for(
int x = 0; x <
width_; x++) {
156 for(
int y = 0; y <
height_; y++) {
171 if( (x >= 0) && (x <
width_) && (y >= 0) && (y <
height_) ) {
194 std::vector<Probability> column;
void fill(Probability prob)
Resets all occupancy probabilities.
float Probability
A probability type.
int get_width()
Get the width of the grid.
int get_height()
Get the height of the grid.
Probability & operator()(const int x, const int y)
Get the occupancy probability of a cell.
int get_cell_width()
Get the cell width (in cm)
Fawkes library namespace.
void set_cell_height(int cell_height)
Resets the cell height (in cm)
int get_cell_height()
Get the cell height (in cm)
Probability get_prob(int x, int y)
Get the occupancy probability of a cell.
int cell_height_
Cell height in cm.
int width_
Width of the grid in # cells.
bool isProb(Probability p)
Check if the probability value is valid.
virtual ~OccupancyGrid()
Destructor.
int cell_width_
Cell width in cm.
int height_
Height of the grid in # cells.
void set_width(int width)
Resets the width of the grid and constructs a new empty grid.
virtual void set_prob(int x, int y, Probability prob)
Reset the occupancy probability of a cell.
void set_height(int height)
Resets the height of the grid and constructs a new empty grid.
void init_grid()
Init a new empty grid with the predefined parameters */.
std::vector< std::vector< Probability > > occupancy_probs_
The occupancy probability of the cells in a 2D array.
OccupancyGrid(int width, int height, int cell_width=5, int cell_height=5)
Constructs an empty occupancy grid.
void set_cell_width(int cell_width)
Resets the cell width (in cm)