MipBaselib::Grid Class Reference

Grid reapresentation for robot's sorrounding. More...

#include <Grid.h>

Inheritance diagram for MipBaselib::Grid:

MipBaselib::ProbGrid

List of all members.

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, Decimal distForInvalid=0.3)
 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, Angle 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.
CellcentralCell ()
 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.
CellgetCell (int index)
 Returns the cell selected by its vector index.
CellgetCell (int i, int j)
 Returns the cell selected by its indexes.
CellgetCell (DubInt indexes)
 Returns the cell selected by its indexes.
CellgetCell (Position pos)
 Returns the cell selected by its position.
CellgetCellOnGlobal (DubInt indexes, int minI, int minJ)
 Returns the cell selected by its indexes.
CellgetCellOnGlobal (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].
Decimal _distForInvalid
 Distance to assign to the invalid rays which fill a scan of less that 2 Pi [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.


Detailed Description

Grid reapresentation for robot's sorrounding.

Author:
Antonio Franchi and Marco Barbalinardo - email:barba82@yahoo.it
Date:
2008/11/14
Todo:
privatize camps

Constructor & Destructor Documentation

MipBaselib::Grid::Grid (  ) 

Default constructor.

MipBaselib::Grid::Grid ( ExplorationParams  params,
Scan  currScan,
Pose  center 
)

Parametric constructor.

MipBaselib::Grid::Grid ( ExplorationParams  params,
Scan  currScan,
Pose  center,
Decimal  width,
Decimal  height,
Decimal  distForInvalid = 0.3 
)

Second parametric constructor.

MipBaselib::Grid::Grid ( const Grid g  ) 

Copy constructor.

MipBaselib::Grid::~Grid (  ) 

Destructor.


Member Function Documentation

Grid MipBaselib::Grid::operator= ( const Grid g  ) 

Operator =.

vector< Cell * > MipBaselib::Grid::findFrameCells ( int  frame  ) 

Returns the vector of pointer to the cells belonging to the specified frame.

vector< Cell * > MipBaselib::Grid::bresenham ( Cell startCell,
Cell stopCell 
)

Implements the Bresenham algorithm for line rasterization.

void MipBaselib::Grid::defineLSR (  ) 

Finds LSR cells and sets properly boards' cells' flags.Cell's indexes are stored in _lsr.

void MipBaselib::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 MipBaselib::Grid::defineFrontier (  ) 

Finds local frontier and sets properly boards' cells' flags. Frintier is organized in froniter arcs.

void MipBaselib::Grid::defineLRR (  ) 

Finds the LRR and LRR boundary and sets properly boards' cells' flags. Cell's indexes are stored in _lrr _lrrBound respectively.

unsigned int MipBaselib::Grid::compCol ( Decimal  wid,
Decimal  res 
)

Computes the number of columns in the grid.

Parameters:
wid Grid width in meters.
res Cells side size in meters.

unsigned int MipBaselib::Grid::compRow ( Decimal  hei,
Decimal  res 
)

Computes the number of rows in the grid.

Parameters:
hei Grid height in meters.
res Cells side size in meters.

void MipBaselib::Grid::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 MipBaselib::Grid::updateLSR (  ) 

Updates LSR cells and sets properly boards' cells' flags. Used after grid comparison for ExplorationGraph update.

void MipBaselib::Grid::updateFrontier (  ) 

Finds Updates frontier and sets properly boards' cells' flags. Used after grid comparison for ExplorationGraph update.

bool MipBaselib::Grid::initializeScan ( ExplorationParams  params,
Scan currScan 
)

Todo:
Comment.

void MipBaselib::Grid::setParams ( ExplorationParams  value  ) 

Sets _params camp.

void MipBaselib::Grid::setResolution ( Decimal  value  ) 

Sets board's resolution (equal to cell side size).

Parameters:
value Board's resolution to set.

void MipBaselib::Grid::setWidth ( Decimal  value  ) 

Sets board's width.

Parameters:
value Board's width to set.

void MipBaselib::Grid::setHeight ( Decimal  value  ) 

Sets board's height.

Parameters:
value Board's height to set.

void MipBaselib::Grid::setColumns ( int  value  ) 

Sets board's columns.

Parameters:
value Board's columns to set.

void MipBaselib::Grid::setRows ( int  value  ) 

Sets board's rows.

Parameters:
value Board's rows to set.

void MipBaselib::Grid::setCenter ( Pose  value  ) 

Sets board's center.

Parameters:
value Board's center to set.

void MipBaselib::Grid::setCentralCell ( Cell value  ) 

Sets board's central cell cell address.

Parameters:
value Board's center to set.

void MipBaselib::Grid::setLLC ( Position  value  ) 

Sets board's LLC.

Parameters:
value Board's Left Lower Corner to set.

void MipBaselib::Grid::setRLC ( Position  value  ) 

Sets board's RLC.

Parameters:
value Board's Right Lower Corner to set.

void MipBaselib::Grid::setLUC ( Position  value  ) 

Sets board's LUC.

Parameters:
value Board's Left Upper Corner to set.

void MipBaselib::Grid::setRUC ( Position  value  ) 

Sets board's RUC.

Parameters:
value Board's Right Upper Corner to .

Frontier MipBaselib::Grid::frontier (  ) 

Returns a vector of FrontierArc rapresenting the frontier of the grid.

LSRBound MipBaselib::Grid::lsrBound (  ) 

Returns boundary of LSR as a LSRBound (vector of DubInt).

LSR MipBaselib::Grid::lsr (  ) 

Returns LSR as a LSR (vector of DubInt).

LRR MipBaselib::Grid::lrr (  ) 

Returns LRR as a LRR (vector of DubInt).

void MipBaselib::Grid::getExpectedScan ( Scan expScan,
Pose  pose,
Decimal  range,
unsigned int  samples,
Angle  angWidth 
)

Computes the expected scan from pose based on contents of grid.

Parameters:
[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 MipBaselib::Grid::params (  ) 

Returns the Exploration parameters.

Decimal MipBaselib::Grid::resolution (  ) 

Returns board's resolution (equal to cell side size).

Decimal MipBaselib::Grid::width (  ) 

Returns board's width.

Decimal MipBaselib::Grid::height (  ) 

Returns board's height.

int MipBaselib::Grid::columns (  ) 

Returns board's columns.

int MipBaselib::Grid::rows (  ) 

Returns board's rows.

Pose MipBaselib::Grid::center (  ) 

Returns center cell coordinates.

Cell * MipBaselib::Grid::centralCell (  ) 

Returns a pointer to board's central cell.

Position MipBaselib::Grid::LLC (  ) 

Returns LLC cell coordinates.

Position MipBaselib::Grid::RLC (  ) 

Returns RLC cell coordinates.

Position MipBaselib::Grid::LUC (  ) 

Returns LUC cell coordinates.

Position MipBaselib::Grid::RUC (  ) 

Returns RUC cell coordinates.

Cell * MipBaselib::Grid::getCell ( int  index  ) 

Returns the cell selected by its vector index.

Cell * MipBaselib::Grid::getCell ( int  i,
int  j 
)

Returns the cell selected by its indexes.

Cell * MipBaselib::Grid::getCell ( DubInt  indexes  ) 

Returns the cell selected by its indexes.

Cell * MipBaselib::Grid::getCell ( Position  pos  ) 

Returns the cell selected by its position.

Cell * MipBaselib::Grid::getCellOnGlobal ( DubInt  indexes,
int  minI,
int  minJ 
)

Returns the cell selected by its indexes.

Cell * MipBaselib::Grid::getCellOnGlobal ( Position  pos,
int  minI,
int  minJ,
Position  globalCenter 
)

Returns the cell selected by its indexes.

string MipBaselib::Grid::print ( Cell  cell  ) 

Prints the charateristics of the specified cell (maybe better with Cell*).

void MipBaselib::Grid::log ( Cell  cell  ) 

Logs the charateristics of the specified cell in the file specified in _params(maybe better with Cell*).

string MipBaselib::Grid::print (  ) 

Prints the charateristics of the grid.

void MipBaselib::Grid::log (  ) 

Logs the charateristics of the grid.

Position MipBaselib::Grid::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 MipBaselib::Grid::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).


Member Data Documentation

Parameters for board initialization.

Scan associated to the grid.

Cells side size[m].

Grid width[m].

Grid height[m].

Distance to assign to the invalid rays which fill a scan of less that 2 Pi [m].

Number of grid columns (odd).

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.

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.


The documentation for this class was generated from the following files:

Generated on Mon Feb 20 07:01:11 2017 for MIP by  doxygen 1.5.6