#include <Grid.h>
Public Member Functions | |
| Grid () | |
| Default constructor. | |
| Grid (ExplorationParams params, Scan currScan, Pose center) | |
| Parametric constructor. | |
| Grid (ExplorationParams params, Scan currScan, Pose center, Decimal width, Decimal height) | |
| Second parametric constructor. | |
| Grid (const Grid &g) | |
| Copy constructor. | |
| Grid | operator= (const Grid &g) |
| Operator =. | |
| ~Grid () | |
| Destructor. | |
| vector< Cell * > | findFrameCells (int frame) |
| Returns the vector of pointer to the cells belonging to the specified frame. | |
| vector< Cell * > | bresenham (Cell *startCell, Cell *stopCell) |
| Implements the Bresenham algorithm for line rasterization. | |
| void | defineLSR () |
| Finds LSR cells and sets properly boards' cells' flags.Cell's indexes are stored in _lsr. | |
| void | defineLSRBoundary (int iMinArcSize=3, int iMinRadialSize=1, bool bIncludeObstacleEndPoints=false) |
| Computes the celles belonging to LSR boundary (frontier and obstacles), and sets properly their flags.Cell's indexes are stored in _lsrBound. | |
| void | defineFrontier () |
| Finds local frontier and sets properly boards' cells' flags. Frintier is organized in froniter arcs. | |
| void | defineLRR () |
| Finds the LRR and LRR boundary and sets properly boards' cells' flags. Cell's indexes are stored in _lrr _lrrBound respectively. | |
| unsigned int | compCol (Decimal wid, Decimal res) |
| Computes the number of columns in the grid. | |
| unsigned int | compRow (Decimal hei, Decimal res) |
| Computes the number of rows in the grid. | |
| void | defineBoard (int iMinArcSize=3, int iMinRadialSize=1, bool bIncludeObstacleEndPoints=false) |
| Constructs the matricial rapresentation of the grid. Sets the fields of the cells composing the board and calls the functions for definition of LSR, LSR boundary, LRR, LRR boundary, Frontier. | |
| void | updateLSR () |
| Updates LSR cells and sets properly boards' cells' flags. Used after grid comparison for ExplorationGraph update. | |
| void | updateFrontier () |
| Finds Updates frontier and sets properly boards' cells' flags. Used after grid comparison for ExplorationGraph update. | |
| bool | initializeScan (ExplorationParams params, Scan &currScan) |
| void | setParams (ExplorationParams value) |
| Sets _params camp. | |
| void | setResolution (Decimal value) |
| Sets board's resolution (equal to cell side size). | |
| void | setWidth (Decimal value) |
| Sets board's width. | |
| void | setHeight (Decimal value) |
| Sets board's height. | |
| void | setColumns (int value) |
| Sets board's columns. | |
| void | setRows (int value) |
| Sets board's rows. | |
| void | setCenter (Pose value) |
| Sets board's center. | |
| void | setCentralCell (Cell *value) |
| Sets board's central cell cell address. | |
| void | setLLC (Position value) |
| Sets board's LLC. | |
| void | setRLC (Position value) |
| Sets board's RLC. | |
| void | setLUC (Position value) |
| Sets board's LUC. | |
| void | setRUC (Position value) |
| Sets board's RUC. | |
| Frontier | frontier () |
| Returns a vector of FrontierArc rapresenting the frontier of the grid. | |
| LSRBound | lsrBound () |
| Returns boundary of LSR as a LSRBound (vector of DubInt). | |
| LSR | lsr () |
| Returns LSR as a LSR (vector of DubInt). | |
| LRR | lrr () |
| Returns LRR as a LRR (vector of DubInt). | |
| void | getExpectedScan (Scan &expScan, Pose pose, Decimal range, unsigned int samples, Ang2Pi angWidth) |
| Computes the expected scan from pose based on contents of grid. | |
| ExplorationParams | params () |
| Returns the Exploration parameters. | |
| Decimal | resolution () |
| Returns board's resolution (equal to cell side size). | |
| Decimal | width () |
| Returns board's width. | |
| Decimal | height () |
| Returns board's height. | |
| int | columns () |
| Returns board's columns. | |
| int | rows () |
| Returns board's rows. | |
| Pose | center () |
| Returns center cell coordinates. | |
| Cell * | centralCell () |
| Returns a pointer to board's central cell. | |
| Position | LLC () |
| Returns LLC cell coordinates. | |
| Position | RLC () |
| Returns RLC cell coordinates. | |
| Position | LUC () |
| Returns LUC cell coordinates. | |
| Position | RUC () |
| Returns RUC cell coordinates. | |
| Cell * | getCell (int index) |
| Returns the cell selected by its vector index. | |
| Cell * | getCell (int i, int j) |
| Returns the cell selected by its indexes. | |
| Cell * | getCell (DubInt indexes) |
| Returns the cell selected by its indexes. | |
| Cell * | getCell (Position pos) |
| Returns the cell selected by its position. | |
| Cell * | getCellOnGlobal (DubInt indexes, int minI, int minJ) |
| Returns the cell selected by its indexes. | |
| Cell * | getCellOnGlobal (Position pos, int minI, int minJ, Position globalCenter) |
| Returns the cell selected by its indexes. | |
| string | print (Cell cell) |
| Prints the charateristics of the specified cell (maybe better with Cell*). | |
| void | log (Cell cell) |
| Logs the charateristics of the specified cell in the file specified in _params(maybe better with Cell*). | |
| string | print () |
| Prints the charateristics of the grid. | |
| void | log () |
| Logs the charateristics of the grid. | |
| Position | alligne (Position pos) |
| Returns the Position of the cell corresponding to generic Position pos. Used to alligne the centers of different grid (ExplorationGraph update). | |
| void | addScan (Scan &scan, Pose scanPose) |
| Returns the Position of the cell corresponding to generic Position pos. Used to alligne the centers of different grid (ExplorationGraph update). | |
Public Attributes | |
| ExplorationParams | _params |
| Parameters for board initialization. | |
| Scan | _currScan |
| Scan associated to the grid. | |
| Decimal | _resolution |
| Cells side size[m]. | |
| Decimal | _width |
| Grid width[m]. | |
| Decimal | _height |
| Grid height[m]. | |
| unsigned int | _columns |
| Number of grid columns (odd). | |
| unsigned int | _rows |
| Number of grid rows (odd). | |
| Pose | _center |
| Center cell pose w.r.t. the absolute frame. | |
| Cell * | _centralCell |
| Pointer to the central cell of the board (current position). | |
| Position | _LLC |
| Left Lower Corner cell coordinates w.r.t. the absolute frame. | |
| Position | _RLC |
| Right Lower Corner cell coordinates w.r.t. the absolute frame. | |
| Position | _LUC |
| Left Upper Corner cell coordinates w.r.t. the absolute frame. | |
| Position | _RUC |
| Right Upper Corner cell coordinates w.r.t. the absolute frame. | |
| vector< Cell > | _board |
| Matricial rapresentation of the grid. | |
| LSR | _lsr |
| Vector containing the indexes of the cells belonging to LSR. | |
| LSRBound | _lsrBound |
| Vector containing the indexes of the cells belonging to LSR boundary. | |
| LRR | _lrr |
| Vector containing the indexes of the cells belonging to LRR. | |
| LRRBound | _lrrBound |
| Vector containing the indexes of the cells belonging to LRR boundary. | |
| Frontier | _frontier |
| Vector containing the indexes of the cells belonging to Frontier. | |
| LSRBound | _originalFront |
| Vector containing the indexes of the cells belonging to Frontier after updating. | |
| LSRBound | _tempBound |
| Vector containing the indexes of the cells belonging to LSR boundary before updating. | |
| Grid::Grid | ( | ) |
Default constructor.
| Grid::Grid | ( | ExplorationParams | params, | |
| Scan | currScan, | |||
| Pose | center | |||
| ) |
Parametric constructor.
| Grid::Grid | ( | ExplorationParams | params, | |
| Scan | currScan, | |||
| Pose | center, | |||
| Decimal | width, | |||
| Decimal | height | |||
| ) |
Second parametric constructor.
| Grid::Grid | ( | const Grid & | g | ) |
Copy constructor.
| Grid::~Grid | ( | ) |
Destructor.
| vector< Cell * > Grid::findFrameCells | ( | int | frame | ) |
Returns the vector of pointer to the cells belonging to the specified frame.
Implements the Bresenham algorithm for line rasterization.
| void Grid::defineLSR | ( | ) |
Finds LSR cells and sets properly boards' cells' flags.Cell's indexes are stored in _lsr.
| void Grid::defineLSRBoundary | ( | int | iMinArcSize = 3, |
|
| int | iMinRadialSize = 1, |
|||
| bool | bIncludeObstacleEndPoints = false | |||
| ) |
Computes the celles belonging to LSR boundary (frontier and obstacles), and sets properly their flags.Cell's indexes are stored in _lsrBound.
valid ||
| void Grid::defineFrontier | ( | ) |
Finds local frontier and sets properly boards' cells' flags. Frintier is organized in froniter arcs.
| void Grid::defineLRR | ( | ) |
Computes the number of columns in the grid.
| wid | Grid width in meters. | |
| res | Cells side size in meters. |
Computes the number of rows in the grid.
| hei | Grid height in meters. | |
| res | Cells side size in meters. |
| void Grid::defineBoard | ( | int | iMinArcSize = 3, |
|
| int | iMinRadialSize = 1, |
|||
| bool | bIncludeObstacleEndPoints = false | |||
| ) |
| void Grid::updateLSR | ( | ) |
Updates LSR cells and sets properly boards' cells' flags. Used after grid comparison for ExplorationGraph update.
| void Grid::updateFrontier | ( | ) |
Finds Updates frontier and sets properly boards' cells' flags. Used after grid comparison for ExplorationGraph update.
| bool Grid::initializeScan | ( | ExplorationParams | params, | |
| Scan & | currScan | |||
| ) |
| void Grid::setParams | ( | ExplorationParams | value | ) |
Sets _params camp.
| void Grid::setResolution | ( | Decimal | value | ) |
Sets board's resolution (equal to cell side size).
| value | Board's resolution to set. |
| void Grid::setWidth | ( | Decimal | value | ) |
Sets board's width.
| value | Board's width to set. |
| void Grid::setHeight | ( | Decimal | value | ) |
Sets board's height.
| value | Board's height to set. |
| void Grid::setColumns | ( | int | value | ) |
Sets board's columns.
| value | Board's columns to set. |
| void Grid::setRows | ( | int | value | ) |
Sets board's rows.
| value | Board's rows to set. |
| void Grid::setCenter | ( | Pose | value | ) |
Sets board's center.
| value | Board's center to set. |
| void Grid::setCentralCell | ( | Cell * | value | ) |
Sets board's central cell cell address.
| value | Board's center to set. |
| void Grid::setLLC | ( | Position | value | ) |
Sets board's LLC.
| value | Board's Left Lower Corner to set. |
| void Grid::setRLC | ( | Position | value | ) |
Sets board's RLC.
| value | Board's Right Lower Corner to set. |
| void Grid::setLUC | ( | Position | value | ) |
Sets board's LUC.
| value | Board's Left Upper Corner to set. |
| void Grid::setRUC | ( | Position | value | ) |
Sets board's RUC.
| value | Board's Right Upper Corner to . |
| Frontier Grid::frontier | ( | ) |
Returns a vector of FrontierArc rapresenting the frontier of the grid.
| void Grid::getExpectedScan | ( | Scan & | expScan, | |
| Pose | pose, | |||
| Decimal | range, | |||
| unsigned int | samples, | |||
| Ang2Pi | angWidth | |||
| ) |
Computes the expected scan from pose based on contents of grid.
| [out] | &expScan | The expected scan from pose based on contents of grid. |
| [in] | pose | Pose of scan to take. |
| [in] | range | Max LinRange of the scan to take. |
| [in] | samples | Number of rays of the scan to take. |
| [in] | angWidth | Angular witdh of the scan to take. |
| ExplorationParams Grid::params | ( | ) |
Returns the Exploration parameters.
| Decimal Grid::resolution | ( | ) |
Returns board's resolution (equal to cell side size).
| Decimal Grid::width | ( | ) |
Returns board's width.
| Decimal Grid::height | ( | ) |
Returns board's height.
| int Grid::columns | ( | ) |
Returns board's columns.
| int Grid::rows | ( | ) |
Returns board's rows.
| Pose Grid::center | ( | ) |
Returns center cell coordinates.
| Cell * Grid::centralCell | ( | ) |
Returns a pointer to board's central cell.
| Position Grid::LLC | ( | ) |
Returns LLC cell coordinates.
| Position Grid::RLC | ( | ) |
Returns RLC cell coordinates.
| Position Grid::LUC | ( | ) |
Returns LUC cell coordinates.
| Position Grid::RUC | ( | ) |
Returns RUC cell coordinates.
| Cell * Grid::getCell | ( | int | index | ) |
Returns the cell selected by its vector index.
| Cell * Grid::getCell | ( | int | i, | |
| int | j | |||
| ) |
Returns the cell selected by its indexes.
Returns the cell selected by its indexes.
Returns the cell selected by its indexes.
| string Grid::print | ( | Cell | cell | ) |
Prints the charateristics of the specified cell (maybe better with Cell*).
| void Grid::log | ( | Cell | cell | ) |
Logs the charateristics of the specified cell in the file specified in _params(maybe better with Cell*).
| string Grid::print | ( | ) |
Prints the charateristics of the grid.
| void Grid::log | ( | ) |
Logs the charateristics of the grid.
Returns the Position of the cell corresponding to generic Position pos. Used to alligne the centers of different grid (ExplorationGraph update).
Returns the Position of the cell corresponding to generic Position pos. Used to alligne the centers of different grid (ExplorationGraph update).
Parameters for board initialization.
Scan associated to the grid.
Cells side size[m].
Grid width[m].
Grid height[m].
| unsigned int Grid::_columns |
Number of grid columns (odd).
| unsigned int Grid::_rows |
Number of grid rows (odd).
Center cell pose w.r.t. the absolute frame.
Pointer to the central cell of the board (current position).
Left Lower Corner cell coordinates w.r.t. the absolute frame.
Right Lower Corner cell coordinates w.r.t. the absolute frame.
Left Upper Corner cell coordinates w.r.t. the absolute frame.
Right Upper Corner cell coordinates w.r.t. the absolute frame.
| vector<Cell> Grid::_board |
Matricial rapresentation of the grid.
Vector containing the indexes of the cells belonging to LSR.
Vector containing the indexes of the cells belonging to LSR boundary.
Vector containing the indexes of the cells belonging to LRR.
Vector containing the indexes of the cells belonging to LRR boundary.
Vector containing the indexes of the cells belonging to Frontier.
Vector containing the indexes of the cells belonging to Frontier after updating.
Vector containing the indexes of the cells belonging to LSR boundary before updating.
1.5.6