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

#include <ureslaserifroad.h>

Inheritance diagram for UResLaserIfRoad:
Inheritance graph

Public Member Functions

void clear ()
 
virtual const char * commandList ()
 
URoadLineDatagetRoadCurrent (int side)
 
URoadLineDatagetRoadLine (int idx)
 
int getRoadLinesCnt ()
 
virtual bool gotAllResources (char *missingThese, int missingTheseCnt)
 
virtual void handleNewData (USmlTag *tag, const char *ifname)
 
virtual bool methodCall (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct=NULL, int *returnStructCnt=NULL)
 
virtual const char * print (const char *preString, char *buff, int buffCnt)
 
virtual bool setResource (UResBase *resource, bool remove)
 
virtual const char * snprint (const char *preString, char *buff, int buffCnt)
 
 UResLaserIfRoad ()
 
void UResLaserIfRoadInit ()
 
 ~UResLaserIfRoad ()
 
- Public Member Functions inherited from UResIfBase
 UResIfBase ()
 
 ~UResIfBase ()
 
- Public Member Functions inherited from UClientFuncBase
virtual void changedNamespace (const char *newNamespace)
 
virtual void doTimeTick ()
 
int getMsgCnt ()
 
bool getVerbose ()
 
virtual const char * name ()
 
bool sendMsg (UClientPortSml *cnn, const char *buff, int buffCnt)
 
bool sendMsg (UClientPortSml *cnn, const char *buff)
 
void setVerbose (bool value)
 
 UClientFuncBase ()
 
virtual ~UClientFuncBase ()
 
- 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 ()
 
bool isLogFileOpen ()
 
bool isLogFileOpen (const char *structName)
 
bool isVarPoolUpdated (int lastCnt, int *newCnt)
 
void logFileClose ()
 
bool logFileOpen ()
 
void logFileStart (const char *structName, bool open)
 
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)
 
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 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

void createBaseVar ()
 
void handleRoad (USmlTag *tag)
 
virtual void newDataAvailable ()
 
void updateLine (const int lineType, const unsigned long lineSerial, const double lineQ, ULineSegment *lineSeg, const unsigned long scan)
 
- Protected Member Functions inherited from UClientFuncBase
void handleHelp (USmlTag *tag)
 
void printReply (USmlTagIn *tag, const char *preString)
 
- 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...
 

Protected Attributes

bool callDispOnNewData
 
URoadLineDatanewestLeft
 
URoadLineDatanewestRight
 
URoadLineDatanewestTop
 
URoadLineDataroadLines [MAX_ROAD_LINE_CNT]
 
int roadLinesCnt
 
unsigned long scanSerial
 
UTime updTime
 
UVariablevarCN
 
UVariablevarCQ
 
UVariablevarLN
 
UVariablevarLQ
 
UVariablevarRN
 
UVariablevarRQ
 
UVariablevarUpdateTime
 
- Protected Attributes inherited from UClientFuncBase
int msgHandled
 
char serverNamespace [MAX_SML_NAME_LENGTH]
 
int serverNamespaceValue
 
bool verboseMessages
 
- 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
 

Static Protected Attributes

static const int MAX_ROAD_LINE_CNT = 20
 
- 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 UClientFuncBase
ULock decodeLock
 
- Public Attributes inherited from UReplay
bool replayTimeAdvancePending
 
UTime replayTimeNow
 

Detailed Description

Class to handle detected road lines for reactive behaviour

Author
Christian Andersen

Constructor & Destructor Documentation

UResLaserIfRoad::UResLaserIfRoad ( )
inline

Constructor

UResLaserIfRoad::~UResLaserIfRoad ( )

Destructor

Member Function Documentation

void UResLaserIfRoad::clear ( void  )
inline

Clear all data (data structures are not released

References URoadLineData::lineSerial, and scan.

Referenced by UFunctionLaserIfData::handleLaserIf().

const char * UResLaserIfRoad::commandList ( )
virtual

Function, that shall return a string with all handled commands, i.e. should return "gmk gmk2d guidemark", if commands starting with any of these three keywords are handled by this function

Reimplemented from UClientFuncBase.

void UResLaserIfRoad::createBaseVar ( )
protected

Create the variables and methods valid (initially) for this var-pool

References UVarPool::addMethod(), and UVarPool::addVar().

static const char* UResLaserIfRoad::getResClassID ( )
inlinestatic

Fixed name of this resource type

References UDataBase::snprint().

Referenced by UNavPaint::setResource(), UFunctionLaserIfData::setResource(), and UNavView::setResource().

URoadLineData * UResLaserIfRoad::getRoadCurrent ( int  side)

Get specific road line

Referenced by UNavPaint::paint().

URoadLineData* UResLaserIfRoad::getRoadLine ( int  idx)
inline

Get specific road line

Referenced by UNavPaint::paint().

int UResLaserIfRoad::getRoadLinesCnt ( )
inline

Get number of available road lines

Referenced by UFunctionLaserIfData::handleLaserIf(), and UNavPaint::paint().

bool UResLaserIfRoad::gotAllResources ( char *  missingThese,
int  missingTheseCnt 
)
virtual

Is this resource missing any base ressources

Reimplemented from UResVarPool.

References UResBase::gotAllResources().

void UResLaserIfRoad::handleNewData ( USmlTag tag,
const char *  ifname 
)
virtual

Got fresh data destined to this function.

Reimplemented from UClientFuncBase.

References USmlTagIn::isTagA().

void UResLaserIfRoad::handleRoad ( USmlTag tag)
protected
bool UResLaserIfRoad::methodCall ( const char *  name,
const char *  paramOrder,
char **  strings,
const double *  doubles,
double *  value,
UDataBase **  returnStruct = NULL,
int *  returnStructCnt = NULL 
)
virtual

The varPool has methods, and a call to one of these are needed. Do the call now and return (a double sized) result in 'value' and return true if the method call is allowed. If the returnStruct and returnStructCnt is not NULL, then a number (no more than initial value of returnStructCnt) of structures based on UDataBase may be returned into returnStruct array of pointers. The returnStructCnt should be modified to the actual number of used pointers (if needed).

Reimplemented from UResVarPool.

References URoadLineData::edgeLine, URoadLineData::line, and URoadLineData::lineQuality.

void UResLaserIfRoad::newDataAvailable ( )
protectedvirtual

This function is called, when a new polygon is unpacked. It can be used to trigger other functions.

References URoadLineData::scanSerial.

virtual const char* UResLaserIfRoad::print ( const char *  preString,
char *  buff,
int  buffCnt 
)
inlinevirtual

Print status for this resource

Reimplemented from UResVarPool.

References UDataBase::snprint().

bool UResLaserIfRoad::setResource ( UResBase resource,
bool  remove 
)
virtual

Set ressource as needed (probably not used by this resource)

Reimplemented from UResVarPool.

References UResVarPool::setResource().

const char * UResLaserIfRoad::snprint ( const char *  preString,
char *  buff,
int  buffCnt 
)
virtual

Print status for this resource

Referenced by UFunctionLaserIfData::handleLaserIf(), and UFunctionLaserIfData::handleLaserObst().

void UResLaserIfRoad::updateLine ( const int  lineType,
const unsigned long  lineSerial,
const double  lineQ,
ULineSegment lineSeg,
const unsigned long  scan 
)
protected

Update line with this new road segment update

References URoadLineData::clear(), URoadLineData::scanSerial, and URoadLineData::URoadLineData().

void UResLaserIfRoad::UResLaserIfRoadInit ( )

Initalize class

References URoadLineData::scanSerial.

Member Data Documentation

bool UResLaserIfRoad::callDispOnNewData
protected

Call display update on new data

const int UResLaserIfRoad::MAX_ROAD_LINE_CNT = 20
staticprotected

Maximum number of polylines used to for road lines

URoadLineData* UResLaserIfRoad::newestLeft
protected

Pointer to the newest line describing the left road side

URoadLineData* UResLaserIfRoad::newestRight
protected

Pointer to the newest line describing the right road side

URoadLineData* UResLaserIfRoad::newestTop
protected

Pointer to the newest line describing the center road side

URoadLineData* UResLaserIfRoad::roadLines[MAX_ROAD_LINE_CNT]
protected

Road lines

int UResLaserIfRoad::roadLinesCnt
protected

Number of used road lines

unsigned long UResLaserIfRoad::scanSerial
protected

Latest laser scan number

UTime UResLaserIfRoad::updTime
protected

Latest update time - used to timeout old lines

UVariable* UResLaserIfRoad::varCN
protected

index to varpool variable for center roadside - update cnt

UVariable* UResLaserIfRoad::varCQ
protected

index to varpool variable for center roadside - quality

UVariable* UResLaserIfRoad::varLN
protected

index to varpool variable for left roadside - update cnt

UVariable* UResLaserIfRoad::varLQ
protected

index to varpool variable for left roadside - quality

UVariable* UResLaserIfRoad::varRN
protected

index to varpool variable for right roadside - update cnt

UVariable* UResLaserIfRoad::varRQ
protected

index to varpool variable for right roadside - quality

UVariable* UResLaserIfRoad::varUpdateTime
protected

index to variable with latest update time


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