AURobotServers  4
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
UProbGrid Class Reference

#include <uprobgrid.h>

Public Member Functions

double getCellSize ()
 
UImagegetGrid ()
 
bool * getNewIsObst ()
 
UPositiongetNewPoly ()
 
int getNewPolyCnt ()
 
UImagegetTempImg ()
 
bool makeProbGrid (const char *sourceName)
 
bool makeProbGrid2 (const char *sourceName)
 
void saveMatlab (const char *filename)
 
void setGrid (UImage *image)
 
bool setNewPolygon (UPose robPose, UTime poseTime)
 
void setTempImg (UImage *image)
 
 UProbGrid ()
 
 ~UProbGrid ()
 

Protected Attributes

int gcX
 
int gcY
 
UImagegrid
 
double gridCellSize
 
int newestPoly
 
UProbPoly polys [MAX_POLYGON_COUNT]
 
int polysCnt
 
UImagetempGrid
 

Private Member Functions

bool paintGrid (UImage *img, int zeroX, int zeroY, double pixelSize, UPixel gridRGB, UPixel zeroRGB)
 

Detailed Description

Grid solution to passable free aea in front of robot.

Author
Christian Andersen

Constructor & Destructor Documentation

UProbGrid::UProbGrid ( )

Constructor

References gcX, gcY, gridCellSize, newestPoly, and polysCnt.

UProbGrid::~UProbGrid ( )

Destructor

Member Function Documentation

double UProbGrid::getCellSize ( )
inline

Get cell size for grid in meters per pixel.

References gridCellSize, img, paintGrid(), and saveMatlab().

UImage* UProbGrid::getGrid ( )
inline

Set image used for grid probability

References grid.

bool * UProbGrid::getNewIsObst ( )

Get start of boolean list if obstacle markers

References UProbPoly::getIsObst(), newestPoly, polys, and polysCnt.

Referenced by getTempImg().

UPosition * UProbGrid::getNewPoly ( )

Get start pf polyon for the newest set

References UPolygon::getPoints(), newestPoly, polys, and polysCnt.

Referenced by getTempImg().

int UProbGrid::getNewPolyCnt ( )

Get number of vertices in polygon

References UPolygon::getPointsCnt(), newestPoly, polys, and polysCnt.

Referenced by getTempImg().

UImage* UProbGrid::getTempImg ( )
inline

Set image used for temporary painting

References getNewIsObst(), getNewPoly(), getNewPolyCnt(), makeProbGrid(), makeProbGrid2(), setNewPolygon(), and tempGrid.

bool UProbGrid::makeProbGrid ( const char *  sourceName)
bool UProbGrid::makeProbGrid2 ( const char *  sourceName)
bool UProbGrid::paintGrid ( UImage img,
int  zeroX,
int  zeroY,
double  pixelSize,
UPixel  gridRGB,
UPixel  zeroRGB 
)
private

Paint 1 meter grid in this image with zero at this pixel position and this pixel size.

References UImage::cvArr(), UPixel::cvRGB(), UImage::height(), roundi(), and UImage::width().

Referenced by getCellSize(), makeProbGrid(), and makeProbGrid2().

void UProbGrid::saveMatlab ( const char *  filename)

Save grid in matlab format. Filename is exclusive extension (.m) and is saved in default dataPath.

References dataPath, gcX, gcY, UImage::getLine(), grid, gridCellSize, UImage::height(), UPixel::p2, and UImage::width().

Referenced by getCellSize(), and makeProbGrid2().

void UProbGrid::setGrid ( UImage image)
inline

Set image used for grid probability

References grid.

Referenced by UFunctionCamPath::initializeFindPath().

bool UProbGrid::setNewPolygon ( UPose  robPose,
UTime  poseTime 
)

Set new polygon from most recent image

References MAX_POLYGON_COUNT, newestPoly, polys, polysCnt, and UProbPoly::setPoly().

Referenced by getTempImg().

void UProbGrid::setTempImg ( UImage image)
inline

Set image used for temporary painting

References tempGrid.

Referenced by UFunctionCamPath::initializeFindPath().

Member Data Documentation

int UProbGrid::gcX
protected

Grid centre in pixels (cells)

Referenced by makeProbGrid(), makeProbGrid2(), saveMatlab(), and UProbGrid().

int UProbGrid::gcY
protected
UImage* UProbGrid::grid
protected

Grid of probability

Referenced by getGrid(), makeProbGrid(), makeProbGrid2(), saveMatlab(), and setGrid().

double UProbGrid::gridCellSize
protected

Cell size for grid

Referenced by getCellSize(), makeProbGrid(), makeProbGrid2(), saveMatlab(), and UProbGrid().

int UProbGrid::newestPoly
protected
UProbPoly UProbGrid::polys[MAX_POLYGON_COUNT]
protected
int UProbGrid::polysCnt
protected
UImage* UProbGrid::tempGrid
protected

Temporary grid for polygon painting

Referenced by getTempImg(), makeProbGrid(), makeProbGrid2(), and setTempImg().


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