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

#include <uavoidpoint.h>

Public Member Functions

void clear ()
 
UAvoidPointinsertAfter (UAvoidPoint *newNext)
 
bool isFreeSpace ()
 
bool isTight ()
 
void printPoses (const char *preStr, const char *postStr)
 
void setAngNext ()
 
void setAvoidObst (UAvoidObst *ob, int idx, bool cvLeft)
 
void setTurnCentreFromMidPose (double turnCentreRadius, bool cvLeft)
 
void setTurnCentreFromMidPose (double turnCentreRadius)
 
bool tPointVisible (bool *knifeOpening=NULL, bool *opposingFirst=NULL)
 
 UAvoidPoint ()
 
UAvoidPointunlinkNext ()
 
 ~UAvoidPoint ()
 

Public Attributes

double angNext
 
UAvoidObstaob
 
UPosition aPos
 
bool avoidLeft
 
bool followLineLastPose
 
int generation
 
UPose mCent
 
UPose mid
 mid poses are More...
 
int midCnt
 
UAvoidPointnext
 
UAvoidObstoob
 
double oobDist
 
UPosition oPos
 
double otDist
 
bool oVertex
 
bool prePoint
 
UAvoidPointprev
 
int serial
 serial number More...
 
UPosition tPos
 
bool tVertex
 
bool useTight
 

Detailed Description

Class to hold one offending points on a route, with safety adius and candidate mid-points

Constructor & Destructor Documentation

UAvoidPoint::UAvoidPoint ( )

Constructor


Copyright (C) 2010 by DTU (Christian Andersen) jca@o.nosp@m.erst.nosp@m.ed.dt.nosp@m.u.dk

  • This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. *
  • This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. *
  • You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

References aob, aPos, avoidLeft, clear(), UPosition::clear(), followLineLastPose, generation, and serial.

UAvoidPoint::~UAvoidPoint ( )

Destructor

Member Function Documentation

void UAvoidPoint::clear ( void  )

Clear to empty point including next-prev flag

References UPose::clear(), UPosition::clear(), mCent, mid, midCnt, next, oob, oPos, prePoint, prev, tPos, and useTight.

Referenced by UAvoidPath2::getEmptyPoint(), and UAvoidPoint().

UAvoidPoint * UAvoidPoint::insertAfter ( UAvoidPoint newNext)

Insert new point after this point.

Parameters
newNextis the new point to add
Returns
pointer to just added point.

References next, prev, and setAngNext().

Referenced by UAvoidPath2::convertToManSeq(), UAvoidPath2::createCellBasedPointList(), UAvoidPath2::createPointList(), and UAvoidPath2::insertNewPointAfter().

bool UAvoidPoint::isFreeSpace ( )
inline

Is the passage of this point away from opposing obstacles that will limit manoeuvres. I.e. no close obstacles.

References oob, setAngNext(), setTurnCentreFromMidPose(), tPointVisible(), and unlinkNext().

Referenced by UAvoidPath2::createMidPathPoints(), UAvoidPath2::insertNewPointAfter(), and UAvoidPath2::setTurnCentre().

bool UAvoidPoint::isTight ( )
inline

Is the passage of this point tight, i.e. a neighboring obstacle puts limits on manoeuvre space.

References oob, and useTight.

Referenced by UAvoidPath2::convertToManSeq(), UAvoidPath2::createMidPathPoints(), and UAvoidPath2::setTurnCentre().

void UAvoidPoint::printPoses ( const char *  preStr,
const char *  postStr 
)
inline

Debug print positions

References aPos, UPose::h, mid, oPos, UPosition::x, UPose::x, UPosition::y, and UPose::y.

Referenced by UAvoidPath2::createMidPathPoints().

void UAvoidPoint::setAngNext ( )

Set the angle to the next point in the point sequence

References angNext, aPos, next, UPosition::x, and UPosition::y.

Referenced by UAvoidPath2::createMidPathPoints(), insertAfter(), isFreeSpace(), and unlinkNext().

void UAvoidPoint::setAvoidObst ( UAvoidObst ob,
int  idx,
bool  cvLeft 
)

Set obsacle to avoid

Parameters
obis pointer to obstacle
idxis the point (vertex) in this obstacle
cvLeftis to be avoided to the left (clockwise).

References aob, aPos, avoidLeft, UPolygon::getPoint(), and UAvoidObst::obst.

Referenced by UAvoidPath2::createPointList().

void UAvoidPoint::setTurnCentreFromMidPose ( double  turnCentreRadius,
bool  cvLeft 
)

Set turn centre from already set mid-pose, but use specified direction. Sets heading of turn-centre to point towards mid-pose.

Parameters
turnCentreRadiusis distance from mid-point to turn centre.
cvLeftif the direction to turn (true is CV (to avoid an obstacle to the left) and false is CCV)

References UPose::getPoseToMapPose(), mCent, and mid.

Referenced by UAvoidPath2::createMidPathPoints(), and isFreeSpace().

void UAvoidPoint::setTurnCentreFromMidPose ( double  turnCentreRadius)

Set turn centre from already set mid-pose. Sets heading of turn-centre to point towards mid-pose.

Parameters
turnCentreRadiusis distance from mid-point to turn centre.

References avoidLeft, UPose::getPoseToMapPose(), mCent, and mid.

bool UAvoidPoint::tPointVisible ( bool *  knifeOpening = NULL,
bool *  opposingFirst = NULL 
)

Is the t-point visible from previous position.

Parameters
knifeOpeningis set to true if narrow passage is a vertex at both sides. tPos is the same vertex as the aPosition.
opposingFirstis set trur if the opposing obstacle closer to previous point than the current obstacle point.
Returns
true if visible - i.e. facing the surface of the obstacle point, else false, i.e. the tPoint is hidden behind the visibility line from previous point.

References aPos, avoidLeft, bool2str(), U2Dlined::distanceSigned(), U2Dseg::getFirstEnd(), U2Dseg::getOtherEnd(), U2Dseg::getPositionOnLine(), U2Dseg::length, oPos, oVertex, prev, U2Dseg::setFromPoints(), tPos, tVertex, U2Dpos::x, UPosition::x, U2Dpos::y, and UPosition::y.

Referenced by UAvoidPath2::createMidPathPoints(), and isFreeSpace().

UAvoidPoint * UAvoidPoint::unlinkNext ( )

Unlink the next point.

Returns
a pointer to the released point.

References next, prev, and setAngNext().

Referenced by UAvoidPath2::convertToManSeq(), UAvoidPath2::createMidPathPoints(), and isFreeSpace().

Member Data Documentation

double UAvoidPoint::angNext
UAvoidObst* UAvoidPoint::aob
UPosition UAvoidPoint::aPos
bool UAvoidPoint::avoidLeft
bool UAvoidPoint::followLineLastPose
int UAvoidPoint::generation
UPose UAvoidPoint::mCent
UPose UAvoidPoint::mid
int UAvoidPoint::midCnt

Number of evaluated mid-poses

Referenced by clear().

UAvoidPoint* UAvoidPoint::next
UAvoidObst* UAvoidPoint::oob
double UAvoidPoint::oobDist

Distance to closest (other) obstacle

Referenced by UAvoidPath2::setClosestPoint().

UPosition UAvoidPoint::oPos
double UAvoidPoint::otDist
bool UAvoidPoint::oVertex

Is the point at the other obstacle a vertex

Referenced by UAvoidPath2::setClosestPoint(), and tPointVisible().

bool UAvoidPoint::prePoint

is this a prepoint, ahead of a tight passage. this may lead to speciat treatment, e.g. turn centre has a special calculateion and is not to be recalculated.

Referenced by clear(), UAvoidPath2::convertToManSeq(), UAvoidPath2::createMidPathPoints(), UAvoidPath2::setClosestPoint(), UAvoidPath2::setMidPoint(), UAvoidPath2::setPreStopPoint(), UAvoidPath2::setTurnCentre(), and UAvoidPath2::toReplaceOldPoint().

UAvoidPoint* UAvoidPoint::prev
int UAvoidPoint::serial
UPosition UAvoidPoint::tPos
bool UAvoidPoint::tVertex

Is the t-point at a vertex (other than the a-point)

Referenced by UAvoidPath2::setClosestPoint(), and tPointVisible().

bool UAvoidPoint::useTight

Should tight rules be applied (if this is otherwise open space)

Referenced by clear(), UAvoidPath2::convertToManSeq(), UAvoidPath2::createMidPathPoints(), isTight(), and UAvoidPath2::setClosestPoint().


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