AURobotServers
4
|
#include <uavoidpoint.h>
Public Member Functions | |
void | clear () |
UAvoidPoint * | insertAfter (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 () | |
UAvoidPoint * | unlinkNext () |
~UAvoidPoint () | |
Public Attributes | |
double | angNext |
UAvoidObst * | aob |
UPosition | aPos |
bool | avoidLeft |
bool | followLineLastPose |
int | generation |
UPose | mCent |
UPose | mid |
mid poses are More... | |
int | midCnt |
UAvoidPoint * | next |
UAvoidObst * | oob |
double | oobDist |
UPosition | oPos |
double | otDist |
bool | oVertex |
bool | prePoint |
UAvoidPoint * | prev |
int | serial |
serial number More... | |
UPosition | tPos |
bool | tVertex |
bool | useTight |
Class to hold one offending points on a route, with safety adius and candidate mid-points
UAvoidPoint::UAvoidPoint | ( | ) |
Constructor
Copyright (C) 2010 by DTU (Christian Andersen) jca@o erst ed.dt u.dk
References aob, aPos, avoidLeft, clear(), UPosition::clear(), followLineLastPose, generation, and serial.
UAvoidPoint::~UAvoidPoint | ( | ) |
Destructor
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.
newNext | is the new point to add |
References next, prev, and setAngNext().
Referenced by UAvoidPath2::convertToManSeq(), UAvoidPath2::createCellBasedPointList(), UAvoidPath2::createPointList(), and UAvoidPath2::insertNewPointAfter().
|
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().
|
inline |
Is the passage of this point tight, i.e. a neighboring obstacle puts limits on manoeuvre space.
Referenced by UAvoidPath2::convertToManSeq(), UAvoidPath2::createMidPathPoints(), and UAvoidPath2::setTurnCentre().
|
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
ob | is pointer to obstacle |
idx | is the point (vertex) in this obstacle |
cvLeft | is 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.
turnCentreRadius | is distance from mid-point to turn centre. |
cvLeft | if 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.
turnCentreRadius | is 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.
knifeOpening | is set to true if narrow passage is a vertex at both sides. tPos is the same vertex as the aPosition. |
opposingFirst | is set trur if the opposing obstacle closer to previous point than the current obstacle 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.
References next, prev, and setAngNext().
Referenced by UAvoidPath2::convertToManSeq(), UAvoidPath2::createMidPathPoints(), and isFreeSpace().
double UAvoidPoint::angNext |
Angle to next point
Referenced by UAvoidPath2::createPointList(), UAvoidPath2::insertNewPointAfter(), setAngNext(), and UAvoidPath2::setTurnCentre().
UAvoidObst* UAvoidPoint::aob |
Related obstacle
Referenced by UAvoidPath2::avoidToTheLeft(), UAvoidPath2::createAvoidPoinsPath(), UAvoidPath2::createCellBasedPointList(), UAvoidPath2::createMidPathPoints(), UAvoidPath2::createPointList(), setAvoidObst(), UAvoidPath2::setClosestPoint(), UAvoidPath2::toReplaceOldPoint(), and UAvoidPoint().
UPosition UAvoidPoint::aPos |
Position to be avoided
Referenced by UAvoidPath2::avoidToTheLeft(), UAvoidPath2::convertToManSeq(), UAvoidPath2::createCellBasedPointList(), UAvoidPath2::createMidPathPoints(), UAvoidPath2::createPointList(), UAvoidPath2::insertNewPointAfter(), UAvoidPath2::isAfterDestination(), printPoses(), UFunctionAvoid::sendCurrentAvoidPath(), setAngNext(), setAvoidObst(), UAvoidPath2::setClosestPoint(), UAvoidPath2::setPreStopPoint(), UAvoidPath2::setTurnCentre(), UAvoidPath2::toReplaceOldPoint(), tPointVisible(), UAvoidPath2::turnCentreCrossing(), UAvoidPoint(), and UAvoidPath2::validNewClosePoint().
bool UAvoidPoint::avoidLeft |
Radius of safe distance circle Avoid point is to be avoided to the left
Referenced by UAvoidPath2::avoidToTheLeft(), UAvoidPath2::convertToManSeq(), UAvoidPath2::createAvoidPoinsPath(), UAvoidPath2::createCellBasedPointList(), UAvoidPath2::createMidPathPoints(), UAvoidPath2::createPointList(), UAvoidPath2::extendManoeuvre(), UAvoidPath2::insertNewPointAfter(), setAvoidObst(), UAvoidPath2::setClosestPoint(), UAvoidPath2::setMidPoint(), UAvoidPath2::setPreStopPoint(), UAvoidPath2::setTurnCentre(), setTurnCentreFromMidPose(), tPointVisible(), UAvoidPath2::turnCentreCrossing(), UAvoidPoint(), and UAvoidPath2::validNewClosePoint().
bool UAvoidPoint::followLineLastPose |
Attempt to use follow line on last pose
Referenced by UAvoidPath2::createMidPathPoints(), UAvoidPath2::createPointList(), UAvoidPath2::setMidPoint(), and UAvoidPoint().
int UAvoidPoint::generation |
In which generation of the creation process was this point created.
Referenced by UAvoidPath2::convertToManSeq(), UAvoidPath2::createAvoidPoinsPath(), UAvoidPath2::createCellBasedPointList(), UAvoidPath2::createMidPathPoints(), UAvoidPath2::setPreStopPoint(), and UAvoidPoint().
UPose UAvoidPoint::mCent |
Center for manoeuvre circle for this obstacle point
Referenced by clear(), UAvoidPath2::convertToManSeq(), UAvoidPath2::createMidPathPoints(), UAvoidPath2::insertNewPointAfter(), UFunctionAvoid::sendCurrentAvoidPath(), UAvoidPath2::setMidPoint(), UAvoidPath2::setPreStopPoint(), UAvoidPath2::setTurnCentre(), setTurnCentreFromMidPose(), and UAvoidPath2::turnCentreCrossing().
UPose UAvoidPoint::mid |
mid poses are
Midpose(s) evaluated for this avoid point
Referenced by UAvoidPath2::avoidToTheLeft(), clear(), UAvoidPath2::convertToManSeq(), UAvoidPath2::createMidPathPoints(), UAvoidPath2::extendManoeuvre(), UAvoidPath2::insertNewPointAfter(), UAvoidPath2::isAfterDestination(), printPoses(), UFunctionAvoid::sendCurrentAvoidPath(), UAvoidPath2::setMidPoint(), UAvoidPath2::setPreStopPoint(), setTurnCentreFromMidPose(), and UAvoidPath2::validNewClosePoint().
int UAvoidPoint::midCnt |
Number of evaluated mid-poses
Referenced by clear().
UAvoidPoint* UAvoidPoint::next |
Link to next in sequence
Referenced by clear(), UAvoidPath2::convertToManSeq(), UAvoidPath2::createAvoidPoinsPath(), UAvoidPath2::createCellBasedPointList(), UAvoidPath2::createMidPathPoints(), UAvoidPath2::extendManoeuvre(), UAvoidPath2::getEmptyPoint(), insertAfter(), UAvoidPath2::recyclePoint(), UAvoidPath2::recyclePoints(), UFunctionAvoid::sendCurrentAvoidPath(), setAngNext(), UAvoidPath2::setClosestPoint(), UAvoidPath2::setMidPoint(), UAvoidPath2::setTurnCentre(), UAvoidPath2::toReplaceOldPoint(), unlinkNext(), and UAvoidPath2::validNewClosePoint().
UAvoidObst* UAvoidPoint::oob |
Closest obstacle (if any) within 2xradius (Other obstacle)
Referenced by clear(), UAvoidPath2::createMidPathPoints(), isFreeSpace(), isTight(), UFunctionAvoid::sendCurrentAvoidPath(), UAvoidPath2::setClosestPoint(), and UAvoidPath2::validNewClosePoint().
double UAvoidPoint::oobDist |
Distance to closest (other) obstacle
Referenced by UAvoidPath2::setClosestPoint().
UPosition UAvoidPoint::oPos |
Closest position on other obstacle
Referenced by clear(), UAvoidPath2::createMidPathPoints(), printPoses(), UFunctionAvoid::sendCurrentAvoidPath(), UAvoidPath2::setClosestPoint(), UAvoidPath2::setTurnCentre(), tPointVisible(), and UAvoidPath2::validNewClosePoint().
double UAvoidPoint::otDist |
The distance from oPos to tPos
Referenced by UAvoidPath2::createMidPathPoints(), UAvoidPath2::setClosestPoint(), and UAvoidPath2::setTurnCentre().
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 |
previous in sequence
Referenced by UAvoidPath2::avoidToTheLeft(), clear(), UAvoidPath2::convertToManSeq(), UAvoidPath2::createMidPathPoints(), UAvoidPath2::createPointList(), insertAfter(), UAvoidPath2::insertNewPointAfter(), UAvoidPath2::isAfterDestination(), UFunctionAvoid::sendCurrentAvoidPath(), UAvoidPath2::setClosestPoint(), UAvoidPath2::setMidPoint(), UAvoidPath2::setPreStopPoint(), UAvoidPath2::setTurnCentre(), UAvoidPath2::toReplaceOldPoint(), tPointVisible(), unlinkNext(), and UAvoidPath2::validNewClosePoint().
int UAvoidPoint::serial |
serial number
Referenced by UAvoidPath2::convertToManSeq(), UAvoidPath2::createMidPathPoints(), UAvoidPath2::getEmptyPoint(), UAvoidPath2::insertNewPointAfter(), and UAvoidPoint().
UPosition UAvoidPoint::tPos |
The position on this obstacle closest to oPos
Referenced by clear(), UAvoidPath2::createMidPathPoints(), UAvoidPath2::setClosestPoint(), UAvoidPath2::setTurnCentre(), and tPointVisible().
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().