AURobotServers
4
|
#include <uresobstacle.h>
Classes | |
struct | UVar |
Public Member Functions | |
void | addObstacleParameters () |
int | getFixedObstCnt () |
virtual void | getObstacleGroupSettings (UObstacleGroupLaser *og) |
bool | getOutdoorExtraDist () |
bool | isOutdoorContext () |
bool | methodCallV (const char *name, const char *paramOrder, UVariable *params[], UDataBase **returnStruct, int *returnStructCnt) |
virtual void | obstDataUpdated (UTime poseTime) |
virtual const char * | print (const char *preString, char *buff, int buffCnt) |
virtual const char * | snprint (const char *preString, char *buff, int buffCnt) |
bool | updateMappedObstacles () |
UResObstacle () | |
virtual | ~UResObstacle () |
Public Member Functions inherited from UObstaclePool | |
bool | addObst (ULaserScan *scan, UPoseTime odoPose, int idx1, int idx2, bool outdoorObsts, bool horizontalScan, bool ignoreIfFixed) |
bool | addObst (UPolygon *poly, UPoseTime odoPose, bool outdoorObsts, bool horizontalScan, bool ignoreIfFixed) |
UObstacleGroupLaser * | advanceNewGroup () |
void | clear () |
void | clearGrp (int idx) |
UObstacleGroup * | getFixeds () |
UObstacleGroupLaser * | getGroup (int fromNewest) |
int | getGroupsCnt () |
UObstacleGroupLaser * | getObstGrp (UPoseTime pt) |
bool | pointsToPolygon (ULaserScan *scan, UPoseTime odoPose, int idx1, int idx2, UPolygon *p40, bool outdoorObsts, bool horizontalScan) |
void | print (const char *prestr) |
void | setFixedObstacles (UObstacleGroup *fixedObstGrp) |
void | setLogFile (FILE *logFile) |
void | setNewGrpDist (double value) |
void | setNewGrpTime (double value) |
UObstaclePool () | |
virtual | ~UObstaclePool () |
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 | ~UVarMethodImplement () |
Static Public Member Functions | |
static const char * | getResClassID () |
Static Public Member Functions inherited from UResVarPool | |
static const char * | getResClassID () |
Protected Attributes | |
UVar | var |
Protected Attributes inherited from UObstaclePool | |
UObstacleGroup * | fixeds |
UObstacleGroupLaser * | groups [MAX_OBSTACLE_GROUPS] |
int | groupsCnt |
FILE * | logo |
int | newest |
double | newGroupTime |
double | newGrpDist |
unsigned long | nextSerial |
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 |
Additional Inherited Members | |
Public Attributes inherited from UReplay | |
bool | replayTimeAdvancePending |
UTime | replayTimeNow |
Static Public Attributes inherited from UObstaclePool | |
static const int | MAX_OBSTACLE_GROUPS = 100 |
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 addObstacleParameters(), UObstaclePool::fixeds, getResClassID(), UResBase::setResID(), and ~UResObstacle().
|
virtual |
void UResObstacle::addObstacleParameters | ( | ) |
Add special variable parameters for obstacle management
References UResVarPool::addMethodV(), UResVarPool::addVar(), UResObstacle::UVar::cogMergeLimit, UResObstacle::UVar::extDist, UResObstacle::UVar::fixedObsts, UResBase::getResVersion(), UResObstacle::UVar::group, UResObstacle::UVar::grpMaxDist, UResObstacle::UVar::grpMaxTime, UResObstacle::UVar::grps, UResObstacle::UVar::indoorCombineDist, UResObstacle::UVar::obstCogMerge, UResObstacle::UVar::obstMerge, UResObstacle::UVar::obstSingleMargin, UResObstacle::UVar::obstSingleMerge, UResObstacle::UVar::outdoorCombineDist, UResObstacle::UVar::outdoorContext, UResObstacle::UVar::updateTime, and var.
Referenced by print(), and UResObstacle().
|
inline |
Get number of fixed obstacles.
References UResObstacle::UVar::fixedObsts, UVariable::getInt(), getObstacleGroupSettings(), obstDataUpdated(), updateMappedObstacles(), and var.
Referenced by UFunctionPassable::handleObstGet().
|
virtual |
Load parameter values from current settings pool to this obstacle group
Reimplemented from UObstaclePool.
References UResObstacle::UVar::cogMergeLimit, UVariable::getBool(), UVariable::getDouble(), UVariable::getValued(), UResObstacle::UVar::grpMaxDist, UResObstacle::UVar::grpMaxTime, UResObstacle::UVar::indoorCombineDist, UResObstacle::UVar::obstCogMerge, UResObstacle::UVar::obstMerge, UResObstacle::UVar::obstSingleMargin, UResObstacle::UVar::obstSingleMerge, UResObstacle::UVar::outdoorCombineDist, UResObstacle::UVar::outdoorContext, UObstacleGroupLaser::setMergeDistance(), UObstaclePool::setNewGrpDist(), UObstaclePool::setNewGrpTime(), and var.
Referenced by getFixedObstCnt().
|
inline |
Get the outdoor context variable from the variable pool. Returns true if the outdoor context is true - or if no variable pool is available.
References UResObstacle::UVar::extDist, UVariable::getBool(), and var.
Referenced by UFunctionPassable::handlePass().
|
inlinestatic |
Fixed name of this resource type
References snprint().
Referenced by UFunctionPassable::setResource(), and UResObstacle().
|
inline |
Get the outdoor context variable from the variable pool. Returns true if the outdoor context is true - or if no variable pool is available.
References UVariable::getBool(), UResObstacle::UVar::outdoorContext, and var.
Referenced by UFunctionPassable::handlePass().
|
virtual |
A varPool method with this class as implementor is called.
name | is the name of the called function |
paramOrder | is a string with one char for each parameter in the call - d is double, s is string, c is class object. |
params | is an array of variable pointers with the actual parameters, in the order specified by order |
returnStruct | is an array of class object pointers that can return values or objects (may be NULL) if no result value is needed (a procedure call) |
returnStructCnt | is the number of objects in the returnStruct buffer |
Reimplemented from UVarMethodImplement.
References UResBase::isA(), UVariable::setDouble(), updateMappedObstacles(), and var.
Referenced by print().
|
virtual |
Obstacle data is updated - tell resource
Reimplemented from UObstaclePool.
References UResObstacle::UVar::group, UObstaclePool::groupsCnt, UResObstacle::UVar::grps, UObstaclePool::newest, UVariable::setInt(), UVariable::setTime(), UResObstacle::UVar::updateTime, and var.
Referenced by getFixedObstCnt(), UFunctionPassable::handleObstGet(), and UResLobst::sendAsObstacles().
|
inlinevirtual |
print status to a string buffer
Reimplemented from UResVarPool.
References addObstacleParameters(), methodCallV(), and snprint().
|
virtual |
print status to a string buffer
References UObstaclePool::getGroup(), UObstaclePool::groupsCnt, mini(), and UObstacleGroup::print().
Referenced by getResClassID(), and print().
bool UResObstacle::updateMappedObstacles | ( | ) |
Extract nearby obstacle lines from mapbase and add as fixed obstacles in odometry coordinates. Requires that mapbase and mapPose resources are available beforre the call.
References UResVarPool::callGlobalV(), UObstacleGroup::clear(), UResObstacle::UVar::fixedObsts, UObstaclePool::fixeds, UResPoseHist::getNewest(), UObstacleGroup::getObstsCnt(), UResPoseHist::getOdoPoseOrigin(), UResBase::getStaticResource(), UVariable::setInt(), UVariable::setPose(), and var.
Referenced by getFixedObstCnt(), UFunctionPassable::handleObstGet(), UFunctionPassable::handlePass(), and methodCallV().
|
protected |