Fawkes API
Fawkes Development Version
|
#include <>>
Public Member Functions | |
OccupancyGrid (int width, int height, int cell_width=5, int cell_height=5) | |
Constructs an empty occupancy grid. More... | |
virtual | ~OccupancyGrid () |
Destructor. More... | |
int | get_cell_width () |
Get the cell width (in cm) More... | |
int | get_cell_height () |
Get the cell height (in cm) More... | |
int | get_width () |
Get the width of the grid. More... | |
int | get_height () |
Get the height of the grid. More... | |
void | set_cell_width (int cell_width) |
Resets the cell width (in cm) More... | |
void | set_cell_height (int cell_height) |
Resets the cell height (in cm) More... | |
void | set_width (int width) |
Resets the width of the grid and constructs a new empty grid. More... | |
void | set_height (int height) |
Resets the height of the grid and constructs a new empty grid. More... | |
virtual void | set_prob (int x, int y, Probability prob) |
Reset the occupancy probability of a cell. More... | |
void | fill (Probability prob) |
Resets all occupancy probabilities. More... | |
Probability | get_prob (int x, int y) |
Get the occupancy probability of a cell. More... | |
Probability & | operator() (const int x, const int y) |
Get the occupancy probability of a cell. More... | |
void | init_grid () |
Init a new empty grid with the predefined parameters */. More... | |
Public Attributes | |
std::vector< std::vector< Probability > > | occupancy_probs_ |
The occupancy probability of the cells in a 2D array. More... | |
Protected Attributes | |
int | cell_width_ |
Cell width in cm. More... | |
int | cell_height_ |
Cell height in cm. More... | |
int | width_ |
Width of the grid in # cells. More... | |
int | height_ |
Height of the grid in # cells. More... | |
Occupancy Grid class for general use. Many derivated classes exist, which are usually used instead of this general class. Note: the coord system is assumed to map x onto width an y onto height, with x being the first coordinate !
Definition at line 41 of file occupancygrid.h.
fawkes::OccupancyGrid::OccupancyGrid | ( | int | width, |
int | height, | ||
int | cell_width = 5 , |
||
int | cell_height = 5 |
||
) |
Constructs an empty occupancy grid.
width | the width of the grid in # of cells |
height | the height of the cells in # of cells |
cell_width | the cell width in cm |
cell_height | the cell height in cm |
Definition at line 47 of file occupancygrid.cpp.
|
virtual |
void fawkes::OccupancyGrid::fill | ( | Probability | prob | ) |
Resets all occupancy probabilities.
prob | the occupancy probability the grid will become filled with |
Definition at line 153 of file occupancygrid.cpp.
int fawkes::OccupancyGrid::get_cell_height | ( | ) |
Get the cell height (in cm)
Get the cell height.
Definition at line 76 of file occupancygrid.cpp.
References width_.
int fawkes::OccupancyGrid::get_cell_width | ( | ) |
Get the cell width (in cm)
Get the cell width.
Definition at line 67 of file occupancygrid.cpp.
References cell_height_.
int fawkes::OccupancyGrid::get_height | ( | ) |
Get the height of the grid.
Definition at line 94 of file occupancygrid.cpp.
References cell_width_.
Referenced by fawkes::AStarColli::AStarColli().
Probability fawkes::OccupancyGrid::get_prob | ( | int | x, |
int | y | ||
) |
Get the occupancy probability of a cell.
x | the x-position of the cell |
y | the y-position of the cell |
Definition at line 170 of file occupancygrid.cpp.
Referenced by fawkes::AStarColli::remove_target_from_obstacle().
int fawkes::OccupancyGrid::get_width | ( | ) |
Get the width of the grid.
Definition at line 85 of file occupancygrid.cpp.
References height_.
Referenced by fawkes::AStarColli::AStarColli().
void fawkes::OccupancyGrid::init_grid | ( | ) |
Init a new empty grid with the predefined parameters */.
Init a new empty grid with the predefined parameters.
Definition at line 192 of file occupancygrid.cpp.
Referenced by fawkes::LaserOccupancyGrid::LaserOccupancyGrid(), set_cell_height(), and set_width().
Probability & fawkes::OccupancyGrid::operator() | ( | const int | x, |
const int | y | ||
) |
Get the occupancy probability of a cell.
Operator (), get occupancy probability of a cell.
x | the x-position of the cell |
y | the y-position of the cell |
Definition at line 185 of file occupancygrid.cpp.
References height_, occupancy_probs_, and width_.
void fawkes::OccupancyGrid::set_cell_height | ( | int | height | ) |
Resets the cell height (in cm)
Resets the cell height.
height | the height of the cells in cm |
Definition at line 112 of file occupancygrid.cpp.
References init_grid(), and width_.
void fawkes::OccupancyGrid::set_cell_width | ( | int | width | ) |
Resets the cell width (in cm)
Resets the cell width.
width | the width of the cells in cm |
Definition at line 103 of file occupancygrid.cpp.
References cell_height_.
void fawkes::OccupancyGrid::set_height | ( | int | height | ) |
Resets the height of the grid and constructs a new empty grid.
height | the height of the grid in # of cells |
Definition at line 131 of file occupancygrid.cpp.
References height_, fawkes::isProb(), occupancy_probs_, and width_.
|
virtual |
Reset the occupancy probability of a cell.
x | the x-position of the cell |
y | the y-position of the cell |
prob | the occupancy probability of cell (x,y) |
Definition at line 143 of file occupancygrid.cpp.
References height_, fawkes::isProb(), occupancy_probs_, and width_.
void fawkes::OccupancyGrid::set_width | ( | int | width | ) |
Resets the width of the grid and constructs a new empty grid.
width | the cell width in cm |
Definition at line 121 of file occupancygrid.cpp.
References height_, and init_grid().
|
protected |
Cell height in cm.
Definition at line 91 of file occupancygrid.h.
Referenced by fawkes::LaserOccupancyGrid::get_cell_costs(), get_cell_width(), fawkes::LaserOccupancyGrid::get_laser_position(), and set_cell_width().
|
protected |
Cell width in cm.
Definition at line 90 of file occupancygrid.h.
Referenced by fawkes::LaserOccupancyGrid::get_cell_costs(), get_height(), fawkes::LaserOccupancyGrid::get_laser_position(), and ~OccupancyGrid().
|
protected |
Height of the grid in # cells.
Definition at line 93 of file occupancygrid.h.
Referenced by get_width(), operator()(), set_height(), set_prob(), and set_width().
std::vector<std::vector<Probability> > fawkes::OccupancyGrid::occupancy_probs_ |
The occupancy probability of the cells in a 2D array.
Definition at line 87 of file occupancygrid.h.
Referenced by operator()(), set_height(), and set_prob().
|
protected |
Width of the grid in # cells.
Definition at line 92 of file occupancygrid.h.
Referenced by fawkes::LaserOccupancyGrid::get_cell_costs(), get_cell_height(), operator()(), set_cell_height(), set_height(), and set_prob().