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 39 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 45 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 151 of file occupancygrid.cpp.
References occupancy_probs_.
int fawkes::OccupancyGrid::get_cell_height | ( | ) |
Get the cell height (in cm)
Get the cell height.
Definition at line 74 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 65 of file occupancygrid.cpp.
References cell_height_.
int fawkes::OccupancyGrid::get_height | ( | ) |
Get the height of the grid.
Definition at line 92 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 168 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 83 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 190 of file occupancygrid.cpp.
Referenced by fawkes::LaserOccupancyGrid::LaserOccupancyGrid(), and set_cell_height().
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 183 of file occupancygrid.cpp.
References occupancy_probs_.
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 110 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 101 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 129 of file occupancygrid.cpp.
|
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 141 of file occupancygrid.cpp.
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 119 of file occupancygrid.cpp.
|
protected |
Cell height in cm.
Definition at line 89 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 88 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 91 of file occupancygrid.h.
Referenced by get_width().
std::vector<std::vector<Probability> > fawkes::OccupancyGrid::occupancy_probs_ |
The occupancy probability of the cells in a 2D array.
Definition at line 85 of file occupancygrid.h.
Referenced by fill(), and operator()().
|
protected |
Width of the grid in # cells.
Definition at line 90 of file occupancygrid.h.
Referenced by fawkes::LaserOccupancyGrid::get_cell_costs(), get_cell_height(), and set_cell_height().