AURobotServers
4
|
#include <uresroadline.h>
Public Member Functions | |
void | addRoadlineParameters () |
int | getBestLine () |
int | getCentIdx () |
int | getLeftIdx () |
int | getRightIdx () |
URoadLine * | getRoadLine (int idx) |
int | getRoadsCnt () |
void | postUpdate (unsigned int scan, UPoseTime *pose, bool moving) |
virtual const char * | print (const char *preString, char *buff, int buffCnt) |
void | update (unsigned long scan, ULaserPi *pis, int pisCnt, UPoseTime pose, UPosRot *sensorPose, double maxLineRange) |
void | updateRoadVariables (UPoseTime *pose) |
UResRoadLine () | |
void | UResRoadLineInit () |
virtual | ~UResRoadLine () |
Public Member Functions inherited from UResVarPool | |
int | addMethod (const char *formalName, const char *paramTypes, const char *comment) |
int | addMethodV (const char *formalName, const char *paramTypes, const char *comment) |
UVarPool * | addStruct (const char *name, const char *comment, bool copy=false) |
UVariable * | addVar (const char *name, const double initialValue, const char *type, const char *comment) |
UVariable * | addVar (const char *name, const char *initialValue, const char *type, const char *comment) |
UVariable * | addVarA (const char *name, const char *initialValue, const char *type, const char *comment) |
bool | callGlobal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt) |
bool | callGlobalV (const char *name, const char *paramOrder, UVariable **params, UDataBase **returnStruct, int *returnStructCnt) |
Call a method from the root var pool scope It may be in the structure direct (no '.') or in any sub-structure that the 'name.subname' indicate. More... | |
bool | callLocal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt) |
bool | callVS (const char *function, const char *stringParam) |
int | callVSCD (const char *function, const char *strPar, UDataBase *data, int cooSys) |
void | createBaseVar () |
virtual bool | createVarSpace (const int varCnt, const int structCnt, const int methCnt, const char *note, bool copy=false) |
bool | getGlobalString (const char *name, const char **value) |
bool | getGlobalValue (const char *name, double *value) |
bool | getGlobalValue (const char *name, const char **value) |
bool | getGlobalValue (const char *name, bool *value) |
bool | getGlobalValue (const char *name, UTime *value) |
bool | getLocalValue (const char *name, double *value) |
get a value in this variable tree More... | |
bool | getLocalValue (const char *name, bool *value) |
bool | getLocalValue (const char *name, UTime *value) |
double | getLocalValue (int idx) |
UPosition | getLocalValue3D (int idx) |
UPosRot | getLocalValue6D (int idx) |
bool | getLocalValueBool (int idx) |
int | getLocalValueInt (int idx) |
UTime | getLocalValueTime (int idx) |
const char * | getLogFileName () |
const char * | getVarDescription (int idx) |
UVarCalc * | getVarPool () |
virtual bool | gotAllResources (char *missingThese, int missingTheseCnt) |
bool | isLogFileOpen () |
bool | isLogFileOpen (const char *structName) |
bool | isVarPoolUpdated (int lastCnt, int *newCnt) |
void | logFileClose () |
bool | logFileOpen () |
void | logFileStart (const char *structName, bool open) |
virtual bool | methodCall (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct=NULL, int *returnStructCnt=NULL) |
bool | setGlobalVar (const char *name, const double value, bool mayAdd) |
Assigns a value to a variable. The variable may be a part of a structure. More... | |
bool | setLocalVar (int idx, double value, const int element) |
bool | setLocalVar (const char *name, const double value, bool mayAdd) |
Assigns a value to a variable. The variable may be a part of a structure. More... | |
bool | setLocalVar3D (int idx, UPosition *value) |
bool | setLocalVar6D (int idx, UPosRot *value) |
bool | setLocalVarAdd (int idx, double value, const int element) |
bool | setLocalVarPose (int idx, UPose *value) |
virtual bool | setResource (UResBase *resource, bool remove) |
void | setVarPool (UVarCalc *sharedVarPool) |
int | updateQTvars (int structIdx) |
UResVarPool () | |
virtual | ~UResVarPool () |
Public Member Functions inherited from UResBase | |
void | createReplayVar (UVarPool *pool) |
virtual void | createResources () |
UCmdExe * | getCorePointer () |
char * | getLogFileName (char *fn, const int fnCnt) |
int | getResFuncIdx () |
const char * | getResID () |
int | getResVersion () |
bool | isA (const char *idStr) |
bool | isAlsoA (const char *id) |
virtual void | print (const char *preString) |
virtual void | saveSettings () |
void | setCorePointer (UCmdExe *serverCore) |
void | setResFuncIdx (int idx) |
virtual void | setResID (const char *id, const int version) |
virtual void | stop (bool) |
virtual void | updateReplayStatus () |
UResBase () | |
virtual | ~UResBase () |
Public Member Functions inherited from UReplay | |
void | addChild (UReplay *child) |
virtual bool | decodeReplayLine (char *) |
char * | getLogFileName (char *fn, const int fnCnt) |
char * | getReplayFileName (char *fn, const int fnCnt) |
int | getReplayLogLine () |
bool | isReplay () |
bool | isReplayFileOpen () |
void | removeChild (UReplay *child) |
virtual void | replayAdvanceTime (UTime untilTime) |
void | replaySetBaseFileName (const char *name, const char *preName="") |
void | replaySetFileName (const char *name) |
virtual bool | replayStep () |
int | replayStep (int steps) |
virtual bool | replayToTime (UTime untilTime) |
void | setParent (UReplay *parent) |
bool | setReplay (bool value) |
UReplay () | |
virtual | ~UReplay () |
Public Member Functions inherited from ULock | |
bool | lock () |
void | lockInit () |
void | post () |
bool | tryLock () |
bool | tryWait () |
ULock () | |
void | unlock () |
bool | wait () |
~ULock () | |
Public Member Functions inherited from UVarMethodImplement | |
virtual bool | methodCallV (const char *name, const char *paramOrder, UVariable *params[], UDataBase **returnStruct, int *returnStructCnt) |
virtual | ~UVarMethodImplement () |
Static Public Member Functions | |
static const char * | getResClassID () |
Static Public Member Functions inherited from UResVarPool | |
static const char * | getResClassID () |
Protected Member Functions | |
int | findCurrentRoad (UPoseTime *pose) |
void | findCurrentRoad2 (UPoseTime *pose) |
Protected Member Functions inherited from UResVarPool | |
void | setDescription (const char *note, bool copy=false) |
Protected Member Functions inherited from UResBase | |
UResBase * | getStaticResource (const char *resName, bool mayCreate, bool staticOnly=true) |
get a pointer to a static resource. More... | |
Protected Attributes | |
int | bestLine |
double | gain |
UPoseTime | odoPose |
int | roadCenterIdx |
int | roadLeftIdx |
FILE * | roadLog |
int | roadRightIdx |
URoadLine | roads [MAX_ROAD_LINES] |
int | roadsCnt |
unsigned long | roadSerial |
UVariable * | varPoolIdx [13] |
Protected Attributes inherited from UResBase | |
int | resFuncIdx |
char | resID [MAX_RESOURCE_ID_LENGTH] |
char | resIsAlso [MAX_RESOURCE_ISALSO_LENGTH] |
int | resVersion |
Protected Attributes inherited from UReplay | |
bool | replay |
FILE * | replayFile |
char | replayFileName [REPLAY_FILE_NAME_LENGTH] |
replay filename More... | |
char | replayLine [MAX_LOG_LINE_LENGTH] |
int | replayLogLine |
UReplay * | replayParent |
UTime | replayTimeNext |
Static Protected Attributes | |
static const int | MAX_ROAD_LINES = 60 |
Static Protected Attributes inherited from UReplay | |
static const int | MAX_LOG_LINE_LENGTH = 10000 |
static const int | REPLAY_FILE_NAME_LENGTH = 264 |
max length of replay filename More... | |
Additional Inherited Members | |
Public Attributes inherited from UReplay | |
bool | replayTimeAdvancePending |
UTime | replayTimeNow |
This is the shared resource class. It must enherit from the resource base class (or one of its decendent) as shown.
|
inline |
Constructor
References getResClassID(), UResBase::setResID(), UResRoadLineInit(), and ~UResRoadLine().
|
virtual |
Destructor
Referenced by UResRoadLine().
void UResRoadLine::addRoadlineParameters | ( | ) |
Add used parameter variables to the var pool
Referenced by getResClassID().
|
protected |
Search among detected road lines to find the most likely curent road, that is the best left edge to the left that has a significant update count. The best line is allowed to slightly on the wrong side of the robot. Returns index to the best of the three road lines
References UEdgeList::add(), UEdgeList::getBest(), URoadLine::getLine(), URoadLine::getLineType(), URoadLine::getQual(), URoadLine::getUpdateCnt(), ULine::getXYsignedDistance(), URoadLine::isValid(), UPosition::set(), UPose::x, and UPose::y.
Referenced by getRightIdx().
|
protected |
Second extended version of curent road finder
References compareRdFull(), URoad::currentCenter, URoad::currentLeft, URoad::currentRight, URoad::distC, URoad::distL, URoad::distR, URoadLine::getLine(), URoadLine::getUpdateCnt(), ULine::getXYsignedDistance(), URoad::idxCenter, URoad::idxLeft, URoad::idxRight, URoadLine::isA(), URoad::rlCenter, URoad::rlLeft, URoad::rlRight, UPosition::set(), URoad::setRoadQ(), UPose::x, and UPose::y.
Referenced by getRightIdx().
|
inline |
Get index to best road line
References bestLine.
|
inline |
Get center road-line index. Returns -1 if no valid line is estimated
References roadCenterIdx.
Referenced by UFunctionPassable::sendRoadLines().
|
inline |
Get left road-edge index. Returns -1 if no valid line is estimated
References roadLeftIdx.
Referenced by UFunctionPassable::sendRoadLines().
|
inlinestatic |
Fixed name of this resource type
References addRoadlineParameters(), print(), scan, and update().
Referenced by UResRoadLine().
|
inline |
Get right road-edge index. Returns -1 if no valid line is estimated
References findCurrentRoad(), findCurrentRoad2(), roadRightIdx, and updateRoadVariables().
Referenced by UFunctionPassable::sendRoadLines().
|
inline |
Get pointer to road line element
References roads.
Referenced by UFunctionPassable::sendRoadLines().
|
inline |
Get number of established road lines
References postUpdate(), and roadsCnt.
Referenced by UFunctionPassable::sendRoadLines().
void UResRoadLine::postUpdate | ( | unsigned int | scan, |
UPoseTime * | pose, | ||
bool | moving | ||
) |
Update all lines that has not received an update, that is drop unmaintained lines
References URoadLine::isValid(), and URoadLine::postUpdate().
Referenced by getRoadsCnt().
|
virtual |
Fixed varsion number for this resource type. Should follow release version, i.e. version 1.28 gives number 128. Should be incremented only when there is change to this class definition, i.e new or changed functions or variables. print status to a string buffer
Reimplemented from UResVarPool.
Referenced by getResClassID().
void UResRoadLine::update | ( | unsigned long | scan, |
ULaserPi * | pis, | ||
int | pisCnt, | ||
UPoseTime | pose, | ||
UPosRot * | sensorPose, | ||
double | maxLineRange | ||
) |
Get values and settings from var pool Update road lines using these passable intervals
References URoadLine::clear(), compareRLC(), UPosition::dist(), ULaserPi::getCenterPos(), URoadLine::getEstVar(), ULaserPi::getLeftPos(), URoadLine::getLine(), URoadLine::getLineType(), ULaserPi::getRightPos(), UPosRot::getRtoMMatrix(), URoadLine::getScanSerial(), URoadLine::getUpdateCnt(), UPose::h, URoadLine::isA(), URoadLine::isValid(), limitToPi(), UEdgeLinePair::line, MAX_PASSABLE_INTERVALS_PR_SCAN, UEdgeLinePair::pi, UEdgeLinePair::pisPos, scan, UPosRot::setFromPose(), URoadLine::setNew(), UEdgeLinePair::setPair(), URoadLine::update(), UPose::x, and UPose::y.
Referenced by UResPassable::doFullAnalysis(), and getResClassID().
void UResRoadLine::updateRoadVariables | ( | UPoseTime * | pose | ) |
Update road variables
References URoadLine::getEstSD(), URoadLine::getLine(), UTime::getMicrosec(), ULineSegment::getOtherEnd(), UPose::getPoseToMap(), ULine::getPositionOnLine(), URoadLine::getQual(), URoadLine::getScanSerial(), UTime::getSec(), URoadLine::getUpdateCnt(), ULine::getXYsignedDistance(), ULineSegment::length, UPoseTime::t, UPosition::x, and UPosition::y.
Referenced by getRightIdx().
void UResRoadLine::UResRoadLineInit | ( | ) |
|
protected |
Currently best line
Referenced by getBestLine().
|
protected |
Initial gain for road line update
|
staticprotected |
MAX number of available road lines
|
protected |
robot pose (last)
|
protected |
Index to (best estimated) center road line
Referenced by getCentIdx().
|
protected |
Index to (best estimated) left road line
Referenced by getLeftIdx().
|
protected |
File handle for road log
|
protected |
Index to (best estimated) right road line
Referenced by getRightIdx().
|
protected |
Lines
Referenced by getRoadLine().
|
protected |
Last used road line
Referenced by getRoadsCnt().
|
protected |
Next serial number for road lines
|
protected |
Index to road distance var pool variables