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

#include <ulaserdataset.h>

Public Member Functions

void clear ()
 
int findEdgeObstacles (FILE *logo, UResPassable *resp)
 
double get2DDistToCross (U2Dline line, UPose fromPose, bool *behind)
 
U2Dline get2DLine ()
 
double getCenter ()
 
virtual UPosition getCenterPos ()
 
bool getCenterValid ()
 
virtual UTime getDetectTime ()
 
double getFitVariance ()
 
int getLeft ()
 
ULaserObstgetLeftObst ()
 
UPosition getLeftPos ()
 
UPosition getLeftPos ()
 
UPosition getLeftSide ()
 
int getRight ()
 
ULaserObstgetRightObst ()
 
UPosition getRightPos ()
 
UPosition getRightPos ()
 
UPosition getRightSide ()
 
ULaserScangetScan ()
 
ULineSegmentgetSegment ()
 
double getTilt ()
 
UPosition getTop ()
 
double getTopHeight (double laserTile)
 
UPosition getTopPos ()
 
virtual double getVarMin ()
 
virtual double getVarMin2 ()
 
double getWidth ()
 
double getYWidth ()
 
bool isTopValid ()
 
ULineSegmentmakeBestFit ()
 
void moveToMap (UPose *odoPose)
 
void print (const char *preString)
 
void print (const char *preString, char *buff, const int buffCnt)
 
void setCenter (double segmentCenter, bool valid)
 
bool setFromTag (USmlTag *tag)
 
void setInterval (int right, int left, ULaserScan *sourceScan, double varMin, double varMin2)
 
 ULaserPi ()
 
 ULaserPi ()
 
virtual ~ULaserPi ()
 
 ~ULaserPi ()
 

Private Attributes

double centerPosition
 
bool centerValid
 
int left
 
double leftAngle
 
UPosition leftPos
 
UPosition leftSide
 
int linksCnt
 
ULaserObst obstLeft
 
ULaserObst obstRight
 
int right
 
double rightAngle
 
UPosition rightPos
 
UPosition rightSide
 
ULaserScanscan
 
ULineSegment segment
 
double tilt
 
UPosition topPos
 
double variance
 
double varianceMin
 
double varianceMin2
 
double yw
 

Detailed Description

class to hold a passable interval position in a laserscan.

Specification of one passable interval in a series of laser scan values. Number of first and last point is stored only.

Constructor & Destructor Documentation

ULaserPi::ULaserPi ( )

Constructor

ULaserPi::~ULaserPi ( )

Destructor

ULaserPi::ULaserPi ( )

Constructor

virtual ULaserPi::~ULaserPi ( )
virtual

Destructor

Member Function Documentation

void ULaserPi::clear ( void  )

Clear and set positions to 0.0

int ULaserPi::findEdgeObstacles ( FILE *  logo,
UResPassable resp 
)

Find edge obstacles (left and right) for this passable interval. Further needs acces to opther passable intervals. Returns number of obstacles found.

References ULaserObst::findEdgeObstacle(), UResPassable::findPi(), ULaserObst::getLeftIndex(), ULaserScan::getQ(), ULaserObst::getRightIndex(), left, obstLeft, obstRight, PQ_OBST, PQ_ROUGH, right, scan, and ULaserScan::setQ().

Referenced by getTilt().

double ULaserPi::get2DDistToCross ( U2Dline  line,
UPose  fromPose,
bool *  behind 
)

Get the distance to the crossing (in 2D x,y only) between this passable interval and this 'line', as seen from the provided 'fromPose'. If the found crossing is behind the pose, then behind is true. If the lines are parallel 0.0 is returned and 'behind' is (brobably) false. Else the distance is returned. 'behind' may be NULL, if no need

References get2DLine(), U2Dline::getCrossing(), UPose::getMapToPose(), UPosition::set(), UPosition::x, and UPosition::y.

Referenced by getTilt().

U2Dline ULaserPi::get2DLine ( )

Get passable line as a 2D line

References ULine::pos, segment, U2Dline::setPV(), ULine::vec, UPosition::x, and UPosition::y.

Referenced by get2DDistToCross(), and getRightObst().

double ULaserPi::getCenter ( )
inline

Get distance to centerPosition from segment origin

References centerPosition.

Referenced by UFunctionPassable::handlePass().

UPosition ULaserPi::getCenterPos ( )
virtual

Get center position of found road. Center position should be highest point. This is the measured position and not on the fitted line

References centerPosition, ULine::getPositionOnLine(), and segment.

Referenced by getTopHeight(), getVarMin2(), and UResRoadLine::update().

bool ULaserPi::getCenterValid ( )
inline

Get valid flag for center position, center position is not valid if the segment is too flat. In this case the center position is set to half line width.

References centerValid, and getTop().

Referenced by UFunctionPassable::handlePass().

UTime ULaserPi::getDetectTime ( )
virtual

Get detect time

References scan, and ULaserScan::time.

Referenced by getScan().

double ULaserPi::getFitVariance ( )
inline

Get fit variance

References variance.

Referenced by UResPassable::findTopOfRoad(), and UFunctionPassable::handlePass().

int ULaserPi::getLeft ( )
inline
ULaserObst* ULaserPi::getLeftObst ( )
inline

Get pointer to left obstacle structure

References obstLeft.

UPosition ULaserPi::getLeftPos ( )

Get left position - not smoothed to best fit line.

UPosition ULaserPi::getLeftPos ( )
inline
UPosition ULaserPi::getLeftSide ( )
inline

Get left side of road (half robot distance from edge)

Referenced by UClientFuncLaserGui::paintPis().

int ULaserPi::getRight ( )
inline
ULaserObst* ULaserPi::getRightObst ( )
inline

Get pointer to right obstacle structure

References get2DLine(), and obstRight.

UPosition ULaserPi::getRightPos ( )

Get right position - not smoothed to best fit line.

UPosition ULaserPi::getRightPos ( )
inline
UPosition ULaserPi::getRightSide ( )
inline

Get right side of road (half robot distance from edge)

Referenced by UClientFuncLaserGui::paintPis().

ULaserScan* ULaserPi::getScan ( )
inline

Get scan (parent) of this passable interval

References getDetectTime(), and scan.

ULineSegment* ULaserPi::getSegment ( )
inline
double ULaserPi::getTilt ( )
inline
UPosition ULaserPi::getTop ( )

Get position this distance from right edge

References centerPosition, ULine::getPositionOnLine(), and segment.

Referenced by getCenterValid(), and getTopHeight().

double ULaserPi::getTopHeight ( double  laserTile)

Get height of top position relative to best-fit line. This is calculated from the distance to the robot and the tilt of the laser-plane.

References UPosition::dist(), getCenterPos(), and getTop().

Referenced by getTilt().

UPosition ULaserPi::getTopPos ( )
inline

Get top position

Referenced by UClientFuncLaserGui::paintPis().

virtual double ULaserPi::getVarMin ( )
inlinevirtual

Get minimum half-robot-width variance in interval with min limit

References varianceMin.

Referenced by UResPassable::combineNearIntervals().

virtual double ULaserPi::getVarMin2 ( )
inlinevirtual

Get minimum half-robot-width variance in interval, no min limit

References getCenterPos(), getLeftPos(), getRightPos(), and varianceMin2.

Referenced by UResPassable::combineNearIntervals(), and UFunctionPassable::handlePass().

double ULaserPi::getWidth ( )
inline

Get segment euclidian width - straight line distance.

References ULineSegment::length, and segment.

double ULaserPi::getYWidth ( )
inline

Get segment width perpendicular to robot. When robot follows road this is an estimate of road width

References yw.

bool ULaserPi::isTopValid ( )
inline

Is top (center) position valid

References centerValid.

ULineSegment* ULaserPi::makeBestFit ( )

Calculate best-fit line

Referenced by getTilt().

void ULaserPi::moveToMap ( UPose odoPose)

Move fitted line segment to map coordinates from this robot pose

References ULineSegment::getOtherEnd(), UPose::getPoseToMap(), ULaserObst::isValid(), ULaserObst::moveToMap(), obstLeft, obstRight, ULine::pos, segment, and ULineSegment::setFromPoints().

Referenced by getTilt().

void ULaserPi::print ( const char *  preString)

Print status for passable interval - i.e. scannumber left and right extreme and such

Referenced by getTilt(), and UResPassable::print().

void ULaserPi::print ( const char *  preString,
char *  buff,
const int  buffCnt 
)

Print status to this string

References getLeftPos(), getRightPos(), ULaserScan::getSerial(), scan, UPosition::x, and UPosition::y.

void ULaserPi::setCenter ( double  segmentCenter,
bool  valid 
)

Set center position (parameter on line segment, i.e distance from right edge) and validity

References centerPosition, centerValid, getLeftPos(), ULaserScan::getPos(), getRightPos(), left, right, and scan.

Referenced by UResPassable::findTopOfRoad().

bool ULaserPi::setFromTag ( USmlTag tag)

Set passable interval from tag

References ULaserData::clear(), USmlTagIn::getNextAttribute(), and MAX_SML_NAME_LENGTH.

Referenced by UClientFuncLaser::handleLaserScan().

void ULaserPi::setInterval ( int  right,
int  left,
ULaserScan sourceScan,
double  varMin,
double  varMin2 
)

Member Data Documentation

double ULaserPi::centerPosition
private

Distance from right (reference) end of segment to top of road (center position).

Referenced by getCenter(), getCenterPos(), getTop(), and setCenter().

bool ULaserPi::centerValid
private

Is top position valid - i.e. is a significant top found

Referenced by getCenterValid(), isTopValid(), and setCenter().

int ULaserPi::left
private

Left extreme of passable interval

Referenced by findEdgeObstacles(), getLeft(), setCenter(), and setInterval().

double ULaserPi::leftAngle
private

Left angle of interval

UPosition ULaserPi::leftPos
private

3D Position of left edge of interval

UPosition ULaserPi::leftSide
private

Right side (half robot distance)

int ULaserPi::linksCnt
private

Number of links from this passable interval to other passable intervals in previous scan

ULaserObst ULaserPi::obstLeft
private

Obstacle to the left

Referenced by findEdgeObstacles(), getLeftObst(), and moveToMap().

ULaserObst ULaserPi::obstRight
private

Obstacle to the right

Referenced by findEdgeObstacles(), getRightObst(), and moveToMap().

int ULaserPi::right
private

Right extreme of passable interval

Referenced by findEdgeObstacles(), getRight(), setCenter(), and setInterval().

double ULaserPi::rightAngle
private

Right angle of interval

UPosition ULaserPi::rightPos
private

3D position of right edge of interval

UPosition ULaserPi::rightSide
private

Left side (half robot distance)

ULaserScan* ULaserPi::scan
private
ULineSegment ULaserPi::segment
private

Line segment desribing the interval

Referenced by get2DLine(), getCenterPos(), getTop(), getWidth(), moveToMap(), and setInterval().

double ULaserPi::tilt
private

Road tilt value relative to robot. This value is set from road edge-points

Referenced by getTilt(), and setInterval().

UPosition ULaserPi::topPos
private

Top of road

double ULaserPi::variance
private

Variance relative to segment

Referenced by getFitVariance(), and setInterval().

double ULaserPi::varianceMin
private

Minimum half robot width variance (within minimum limit)

Referenced by getVarMin(), and setInterval().

double ULaserPi::varianceMin2
private

Minimum half robot width variance based on at leat 10 measurements, no min limit.

Referenced by getVarMin2(), and setInterval().

double ULaserPi::yw
private

Segment width perpendiculat ro robot. Could be taken as road width.

Referenced by getYWidth(), and setInterval().


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