AURobotServers  4
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
UResObstacle Class Reference

#include <uresobstacle.h>

Inheritance diagram for UResObstacle:
Inheritance graph

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)
 
UObstacleGroupLaseradvanceNewGroup ()
 
void clear ()
 
void clearGrp (int idx)
 
UObstacleGroupgetFixeds ()
 
UObstacleGroupLasergetGroup (int fromNewest)
 
int getGroupsCnt ()
 
UObstacleGroupLasergetObstGrp (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)
 
UVarPooladdStruct (const char *name, const char *comment, bool copy=false)
 
UVariableaddVar (const char *name, const double initialValue, const char *type, const char *comment)
 
UVariableaddVar (const char *name, const char *initialValue, const char *type, const char *comment)
 
UVariableaddVarA (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)
 
UVarCalcgetVarPool ()
 
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 ()
 
UCmdExegetCorePointer ()
 
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
UObstacleGroupfixeds
 
UObstacleGroupLasergroups [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
 
UReplayreplayParent
 
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
UResBasegetStaticResource (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...
 

Detailed Description

This is the shared resource class. It must enherit from the resource base class (or one of its decendent) as shown.

Author
Christian Andersen

Constructor & Destructor Documentation

UResObstacle::UResObstacle ( )
inline
UResObstacle::~UResObstacle ( )
virtual

Destructor

References UObstaclePool::fixeds.

Referenced by UResObstacle().

Member Function Documentation

void UResObstacle::addObstacleParameters ( )
int UResObstacle::getFixedObstCnt ( )
inline
void UResObstacle::getObstacleGroupSettings ( UObstacleGroupLaser og)
virtual
bool UResObstacle::getOutdoorExtraDist ( )
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().

static const char* UResObstacle::getResClassID ( )
inlinestatic

Fixed name of this resource type

References snprint().

Referenced by UFunctionPassable::setResource(), and UResObstacle().

bool UResObstacle::isOutdoorContext ( )
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().

bool UResObstacle::methodCallV ( const char *  name,
const char *  paramOrder,
UVariable params[],
UDataBase **  returnStruct,
int *  returnStructCnt 
)
virtual

A varPool method with this class as implementor is called.

Parameters
nameis the name of the called function
paramOrderis a string with one char for each parameter in the call - d is double, s is string, c is class object.
paramsis an array of variable pointers with the actual parameters, in the order specified by order
returnStructis an array of class object pointers that can return values or objects (may be NULL) if no result value is needed (a procedure call)
returnStructCntis the number of objects in the returnStruct buffer
Returns
true if the method is recognised (exists), when false is returned a invalid name or parameter list is detected.

Reimplemented from UVarMethodImplement.

References UResBase::isA(), UVariable::setDouble(), updateMappedObstacles(), and var.

Referenced by print().

void UResObstacle::obstDataUpdated ( UTime  poseTime)
virtual
virtual const char* UResObstacle::print ( const char *  preString,
char *  buff,
int  buffCnt 
)
inlinevirtual

print status to a string buffer

Reimplemented from UResVarPool.

References addObstacleParameters(), methodCallV(), and snprint().

const char * UResObstacle::snprint ( const char *  preString,
char *  buff,
int  buffCnt 
)
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.

Returns
true if obstacles are available. false if resources are missing.

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().

Member Data Documentation

UVar UResObstacle::var
protected

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