AURobotServers
4
|
#include <urespassable.h>
Public Member Functions | |
bool | addPassableInterval (const int right, const int left, double varMin, double varMin2) |
void | addPassableIntervalParameters () |
bool | combineNearIntervals (double obstSize, double lowVarLimit) |
bool | doFullAnalysis (ULaserData *laserData, UPose pose, UPosRot laserPose, UObstaclePool *obsts, bool outdoorContext, double obstSearchExt, UResRoadLine *roads) |
bool | doObstAnalysis (ULaserData *laserData, UPose pose, UPosRot laserPose, UObstaclePool *obsts, bool outdoorContext) |
ULaserPi * | findPi (int withThisIdx) |
bool | findTopOfRoad (ULaserPi *pp) |
ULaserPi * | getPi (int idx) |
int | getPisCnt () |
ULaserScan * | getScan () |
void | getSettingsFromVarPool () |
int | makePassableIntervals2 (const int leftLim, const int rightLim) |
int | makePassableIntervalsFit (double *maxPassLeft, double *maxPassRight, FILE *logo, FILE *fdI1, FILE *fdI2) |
virtual const char * | print (const char *preString, char *buff, int buffCnt) |
bool | setScan (ULaserData *source, UPose odoPose, UPosRot *laserPose) |
UResPassable () | |
void | UResPassableInit () |
virtual | ~UResPassable () |
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 () |
Additional Inherited Members | |
Public Attributes inherited from UReplay | |
bool | replayTimeAdvancePending |
UTime | replayTimeNow |
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... | |
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... | |
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(), UResPassableInit(), and ~UResPassable().
|
virtual |
bool UResPassable::addPassableInterval | ( | const int | right, |
const int | left, | ||
double | varMin, | ||
double | varMin2 | ||
) |
Add a new passable interval to scan. The position left and right are both included in the interval. 'varMin' is the minimum half-robot-width variance for the interval.
References MAX_PASSABLE_INTERVALS_PR_SCAN, pis, pisCnt, PQ_ROUGH, scan, ULaserPi::setInterval(), and ULaserScan::setQ().
Referenced by getPi(), and makePassableIntervals2().
void UResPassable::addPassableIntervalParameters | ( | ) |
Add used parameter variables to the var pool
References UResVarPool::addVar(), UResVarPool::createVarSpace(), UResBase::getResVersion(), UResVarPool::getVarPool(), varConvexFac, varConvexOffset, varFitEndDev, varFitXTiltLimit, varFitZTiltLimit, varIgnoreIfFixed, varMinCombinedWidth, varMinObstDist, varRoughMinCnt, varRoughSDLimit, varRoughWidth, varUseIntervalCombiner, and varUseSmoothSettings.
Referenced by getResClassID(), and UResPassableInit().
bool UResPassable::combineNearIntervals | ( | double | obstSize, |
double | lowVarLimit | ||
) |
Combine near intervals if they are close, and the split is not blocked by a major obstacle. 'obstSize is in meter hight ABOVE passable areas. 'lowVarLimit' is lower limit of variance, when compareing two intervals (if actual variance limit is lower than this, then this variance is used.)
max difference in variance for two intervals
References ULaserPi::getLeft(), ULineSegment::getOtherEnd(), ULaserScan::getPos(), ULaserPi::getRight(), ULaserPi::getSegment(), ULaserPi::getVarMin(), ULaserPi::getVarMin2(), UPosRot::getZ(), limitToPi(), MIN_MEASUREMENTS_PER_PI, mind(), pis, pisCnt, scan, sensorPose, ULaserPi::setInterval(), sortPis(), ULine::vec, UPosition::x, and UPosition::y.
Referenced by getPi(), and makePassableIntervalsFit().
bool UResPassable::doFullAnalysis | ( | ULaserData * | laserData, |
UPose | pose, | ||
UPosRot | laserPose, | ||
UObstaclePool * | obsts, | ||
bool | outdoorContext, | ||
double | obstSearchExt, | ||
UResRoadLine * | roads | ||
) |
Set parameters used for calculationg variance and detection of passable intervals Analyze scandata and make passable intervals and obstacles. Obstacles are searched up to 'obstSearchExt' further away than most distant passable interval.
References ULaserScan::findNearObstacles(), UVariable::getBool(), ULaserData::getMaxValidRange(), ULaserData::getScanTime(), ULaserData::getSerial(), getSettingsFromVarPool(), UVariable::getValued(), lineFitMinCnt, lineFitWidth, makePassableIntervalsFit(), pis, pisCnt, scan, UPoseTime::setPt(), setScan(), ULaserScan::setVariance(), UResRoadLine::update(), varIgnoreIfFixed, and varMinObstDist.
Referenced by getPi(), and UFunctionPassable::handlePass().
bool UResPassable::doObstAnalysis | ( | ULaserData * | laserData, |
UPose | pose, | ||
UPosRot | laserPose, | ||
UObstaclePool * | obsts, | ||
bool | outdoorContext | ||
) |
analize for obstacles only, assuming the laserscanner is horisintal alligned
laserData | laserscan to be analized |
pose | robot pose at scantime |
laserPose | the position and orientation (6D) of laser scanner |
obsts | is the obstacle pool, where the obstacles are to be delivered. |
outdoorContext | if true obstacles are combined on distance (~0.6 m), else much tighter correlation (0.2m), to avoid to combine wincave walls. |
References ULaserScan::findNearObstacles(), UVariable::getBool(), ULaserData::getMaxValidRange(), UResPoseHist::getNewest(), UResPoseHist::getOdoPoseOrigin(), ULaserData::getScanTime(), getSettingsFromVarPool(), UResBase::getStaticResource(), UVariable::getValued(), scan, UVariable::setPose(), UPoseTime::setPt(), setScan(), varIgnoreIfFixed, and varMinObstDist.
Referenced by getPi(), and UFunctionPassable::handlePass().
ULaserPi * UResPassable::findPi | ( | int | withThisIdx | ) |
Get the passable interval (if any), that includes this measurement index point
References ULaserPi::getLeft(), ULaserPi::getRight(), pis, and pisCnt.
Referenced by ULaserPi::findEdgeObstacles(), and getPi().
bool UResPassable::findTopOfRoad | ( | ULaserPi * | pp | ) |
Find top of passable interval. Returns true if found
References absd(), ULaserScan::getData(), ULaserPi::getFitVariance(), ULaserPi::getLeft(), ULine::getPositionOnLine(), ULaserPi::getRight(), ULaserPi::getSegment(), ULaserPi::getTilt(), ULine::getXYsignedDistance(), ULineSegment::length, lineFitZTiltLimit, maxd(), PQ_EASY, scan, ULaserPi::setCenter(), ULaserPoint::setQ(), sqr(), and ULaserPoint::varL.
Referenced by getPi(), and makePassableIntervalsFit().
|
inline |
Get this passable interval
References addPassableInterval(), combineNearIntervals(), doFullAnalysis(), doObstAnalysis(), findPi(), findTopOfRoad(), makePassableIntervals2(), makePassableIntervalsFit(), and pis.
Referenced by UFunctionPassable::handlePass().
|
inline |
|
inlinestatic |
Fixed name of this resource type
References addPassableIntervalParameters(), getSettingsFromVarPool(), print(), and setScan().
Referenced by UResPassable().
|
inline |
void UResPassable::getSettingsFromVarPool | ( | ) |
Get values and settings from var pool
References UVariable::getBool(), UVariable::getInt(), UVariable::getValued(), lineFitConvexFac, lineFitConvexOffset, lineFitEndpointDev, lineFitMinCnt, lineFitVarLimit, lineFitWidth, lineFitXTiltLimit, lineFitZTiltLimit, lineSmoothSettings, lineUseCombine, minCombinedSegmentWidth, sqr(), varConvexFac, varConvexOffset, varFitEndDev, varFitXTiltLimit, varFitZTiltLimit, varMinCombinedWidth, varRoughMinCnt, varRoughSDLimit, varRoughWidth, varUseIntervalCombiner, and varUseSmoothSettings.
Referenced by doFullAnalysis(), doObstAnalysis(), and getResClassID().
int UResPassable::makePassableIntervals2 | ( | const int | leftLim, |
const int | rightLim | ||
) |
Create passable intervals using line-fit variance data. This replaces the x-variance method in makePassableIntervals
References absd(), addPassableInterval(), ULaserPoint::distLeft, ULaserPoint::distRight, ULaserScan::getData(), iEndDist, iHeight, iInside, iMaxVar, iMeasureDist, ULaserPoint::isValid(), lineFitConvexOffset, lineFitEndpointDev, lineFitVarLimit, lineFitXTiltLimit, lineSmoothSettings, MAX_ALLOWED_HEIGHT, maxd(), MIN_ALLOWED_HEIGHT, MIN_MEASUREMENTS_PER_PI, mind(), mini(), ULaserPoint::pos, PQ_NOT, scan, ULaserScan::setQ(), sqr(), ULaserPoint::tilt, ULaserPoint::varL, ULaserPoint::varToL, UPosition::x, UPosition::y, and UPosition::z.
Referenced by getPi(), and makePassableIntervalsFit().
int UResPassable::makePassableIntervalsFit | ( | double * | maxPassLeft, |
double * | maxPassRight, | ||
FILE * | logo, | ||
FILE * | fdI1, | ||
FILE * | fdI2 | ||
) |
Generate passable intervals using a line-fit method and accept if tilt is less than tiltLimit. and do edge detect (obstacles etc).
References absd(), combineNearIntervals(), findTopOfRoad(), ULaserScan::getData(), ULaserScan::getDataCnt(), ULaserPi::getLeft(), ULaserPi::getRight(), ULaserPi::getSegment(), ULaserScan::getSerial(), ULaserPi::getTilt(), ULineSegment::length, lineFitZTiltLimit, lineSmoothSettings, lineUseCombine, makePassableIntervals2(), MIN_MEASUREMENTS_PER_PI, minCombinedSegmentWidth, pis, pisCnt, scan, and sqr().
Referenced by doFullAnalysis(), and getPi().
|
virtual |
print status to a string buffer
Reimplemented from UResVarPool.
References pis, pisCnt, and ULaserPi::print().
Referenced by getResClassID().
bool UResPassable::setScan | ( | ULaserData * | source, |
UPose | odoPose, | ||
UPosRot * | laserPose | ||
) |
Set new data into ULaserScan.
References ULock::lock(), scan, sensorPose, ULaserScan::setScan(), and ULock::unlock().
Referenced by doFullAnalysis(), doObstAnalysis(), and getResClassID().
void UResPassable::UResPassableInit | ( | ) |
Initialize class
References addPassableIntervalParameters(), iEndDist, iHeight, iInside, iMaxVar, iMeasureDist, scan, sensorPose, and UPosRot::set().
Referenced by UResPassable().
|
protected |
Referenced by makePassableIntervals2(), and UResPassableInit().
|
protected |
Is context indoor or outdoor Statistics
Referenced by makePassableIntervals2(), and UResPassableInit().
|
protected |
Referenced by makePassableIntervals2(), and UResPassableInit().
|
protected |
Referenced by makePassableIntervals2(), and UResPassableInit().
|
protected |
Referenced by makePassableIntervals2(), and UResPassableInit().
|
protected |
Factor used when combining variance and line curvature, in order to favor convex road shapes.
Referenced by getSettingsFromVarPool().
|
protected |
Favor convex shaped roads, by adding this value to the signed distance from one of the end-points to the fittet line
Referenced by getSettingsFromVarPool(), and makePassableIntervals2().
|
protected |
Maximum deviation of endpoints of a passable interval relative to the minimum line-fit variance in the passable interval
Referenced by getSettingsFromVarPool(), and makePassableIntervals2().
|
protected |
Minimum number of measurements in a segment for roughness calculation
Referenced by doFullAnalysis(), and getSettingsFromVarPool().
|
protected |
Parameter for detection of passable interval If line fit variance is above this limit a passable interval can not be found here
Referenced by getSettingsFromVarPool(), and makePassableIntervals2().
|
protected |
width of line segment used for calculation of roughness
Referenced by doFullAnalysis(), and getSettingsFromVarPool().
|
protected |
Tilt limit for final passable intervals using y-x coordinate reference
Referenced by getSettingsFromVarPool(), and makePassableIntervals2().
|
protected |
Tilt limit for final passable intervals when using y-z coordinate reference (value <= laser tilt)
Referenced by findTopOfRoad(), getSettingsFromVarPool(), and makePassableIntervalsFit().
|
protected |
Use tresholds that favor flat smooth surfaces
Referenced by getSettingsFromVarPool(), makePassableIntervals2(), and makePassableIntervalsFit().
|
protected |
Debug flag to possibly disable combiner
Referenced by getSettingsFromVarPool(), and makePassableIntervalsFit().
|
protected |
Minimum combined segment width
Referenced by getSettingsFromVarPool(), and makePassableIntervalsFit().
|
protected |
Passable intervals in this scan
Referenced by addPassableInterval(), combineNearIntervals(), doFullAnalysis(), findPi(), getPi(), makePassableIntervalsFit(), and print().
|
protected |
Number of passable intervals
Referenced by addPassableInterval(), combineNearIntervals(), doFullAnalysis(), findPi(), getPisCnt(), makePassableIntervalsFit(), and print().
|
protected |
local variables provided by this resource.
Referenced by addPassableInterval(), combineNearIntervals(), doFullAnalysis(), doObstAnalysis(), findTopOfRoad(), getScan(), makePassableIntervals2(), makePassableIntervalsFit(), setScan(), and UResPassableInit().
|
protected |
Sensor data for robot
Referenced by combineNearIntervals(), setScan(), UResPassableInit(), and ~UResPassable().
|
protected |
Referenced by addPassableIntervalParameters(), and getSettingsFromVarPool().
|
protected |
Referenced by addPassableIntervalParameters(), and getSettingsFromVarPool().
|
protected |
Referenced by addPassableIntervalParameters(), and getSettingsFromVarPool().
|
protected |
Referenced by addPassableIntervalParameters(), and getSettingsFromVarPool().
|
protected |
Referenced by addPassableIntervalParameters(), and getSettingsFromVarPool().
|
protected |
Referenced by addPassableIntervalParameters(), doFullAnalysis(), and doObstAnalysis().
|
protected |
Referenced by addPassableIntervalParameters(), and getSettingsFromVarPool().
|
protected |
Group of fixed obstacles from a-priori map (mapbase) parameter for obstacle detection
Referenced by addPassableIntervalParameters(), doFullAnalysis(), and doObstAnalysis().
|
protected |
Referenced by addPassableIntervalParameters(), and getSettingsFromVarPool().
|
protected |
Referenced by addPassableIntervalParameters(), and getSettingsFromVarPool().
|
protected |
Referenced by addPassableIntervalParameters(), and getSettingsFromVarPool().
|
protected |
Referenced by addPassableIntervalParameters(), and getSettingsFromVarPool().
|
protected |
Referenced by addPassableIntervalParameters(), and getSettingsFromVarPool().