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

#include <uresdrivepos.h>

Inheritance diagram for UResDrivePos:
Inheritance graph

Public Member Functions

double driveOdo (UPoseV exitPose, bool ignoreVel, int repeat)
 
UPoseV getCurrentPose ()
 
UManSeqgetManLocked ()
 
virtual bool gotAllResources (char *missingThese, int missingTheseCnt)
 
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)
 
void setManUnlocked ()
 
bool setResource (UResBase *resource, bool remove)
 
 UResDrivePos ()
 
virtual ~UResDrivePos ()
 
- 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 ()
 
double setTarget (const char *sideStr, double dist)
 
- 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 finalPart
 
UPose finalPose
 
UPoseV lastExitPose
 
UTime lastObstUpdate
 
UPoseV lastStartPose
 
UManSeqman
 
ULock manLock
 
UResPoseHistposeHist
 
UPoseV repeat0startPose
 
UPoseV targetPose
 
UVariablevarFailCnt
 
UVariablevarFinalDistance
 
UResVarPoolvarGlobal
 
UVariablevarLoopCnt
 
UVariablevarOdoV
 
UVariablevarOdoX
 
UVariablevarUpdateTime
 
- 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
 

Private Attributes

int odoDriveCnt
 

Additional Inherited Members

- Public Attributes inherited from UReplay
bool replayTimeAdvancePending
 
UTime replayTimeNow
 
- 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

UResDrivePos::UResDrivePos ( )
inline
UResDrivePos::~UResDrivePos ( )
virtual

Destructor

Referenced by UResDrivePos().

Member Function Documentation

void UResDrivePos::createBaseVar ( )
protected
double UResDrivePos::driveOdo ( UPoseV  exitPose,
bool  ignoreVel,
int  repeat 
)
UPoseV UResDrivePos::getCurrentPose ( )

Get current pose from poseHist. Pose is (0,0,0) if no poseHist is found

References UResPoseHist::getNewest(), UPose::h, poseHist, UPoseV::set(), UPose::x, and UPose::y.

Referenced by UFunctionDrivePos::handleDrivePos(), and setManUnlocked().

UManSeq * UResDrivePos::getManLocked ( )

Get latest used manouvre sequence in a locked state. When the pointer no longer needed a call must be made to 'setManUnlock()' to allow the roadDrive to continue fretching obstacle avoidance manoeuvres.

References ULock::lock(), man, and manLock.

Referenced by getResClassID(), and UFunctionDrivePos::handleDrivePos().

static const char* UResDrivePos::getResClassID ( )
inlinestatic

Fixed name of this resource type

References getManLocked(), gotAllResources(), methodCall(), print(), and setResource().

Referenced by UResDrivePos().

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

Is this resource missing any other resources to function optimally? Returns false if any is missing, and a list of the missong resources in the string.

Reimplemented from UResVarPool.

References UResPoseHist::getOdoPoseID(), UResBase::getResID(), UResBase::gotAllResources(), poseHist, and varGlobal.

Referenced by getResClassID().

bool UResDrivePos::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.

Reimplemented from UResVarPool.

References driveOdo(), UResPoseHist::getNewest(), UPose::getPoseToMapPose(), poseHist, repeat0startPose, roundi(), and UPoseV::set().

Referenced by getResClassID().

const char * UResDrivePos::print ( const char *  preString,
char *  buff,
int  buffCnt 
)
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 UResDrivePos::setManUnlocked ( )
inline

Unlock the use of the manouvre pointer - must be unlocked as soon as possible to allow roadDrive to function

References createBaseVar(), dist, driveOdo(), getCurrentPose(), manLock, setTarget(), and ULock::unlock().

Referenced by UFunctionDrivePos::handleDrivePos().

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

The server will offer a resource pointer by this call. If the resource is used, please return true.

Reimplemented from UResVarPool.

References UResPoseHist::getOdoPoseID(), UResBase::getResID(), UResBase::isA(), poseHist, UResVarPool::setResource(), and varGlobal.

Referenced by getResClassID().

double UResDrivePos::setTarget ( const char *  sideStr,
double  dist 
)
protected

Set target pose in varPool from these parameters

Referenced by setManUnlocked().

Member Data Documentation

bool UResDrivePos::finalPart
protected

When wery close to target position it is no use to recalculate the planned path, so just continue on current plan until traveled distance to final point is reached

Referenced by driveOdo().

UPose UResDrivePos::finalPose
protected

The robot pose when entered into the final path

Referenced by driveOdo().

UPoseV UResDrivePos::lastExitPose
protected

The target pose at the last calculation

Referenced by driveOdo().

UTime UResDrivePos::lastObstUpdate
protected

The update time used for the latest calculation

Referenced by driveOdo().

UPoseV UResDrivePos::lastStartPose
protected

The current pose used in previous calculation

Referenced by driveOdo().

UManSeq* UResDrivePos::man
protected

Pointer to Last found manouvre sequence (actually in avoid module)

Referenced by driveOdo(), getManLocked(), and UResDrivePos().

ULock UResDrivePos::manLock
protected

Lock to be used during read of the found manoeuvre

Referenced by driveOdo(), getManLocked(), and setManUnlocked().

int UResDrivePos::odoDriveCnt
private

debug count of odo-drives

Referenced by driveOdo(), and UResDrivePos().

UResPoseHist* UResDrivePos::poseHist
protected

local variables provided by this resource. Pose history

Referenced by driveOdo(), getCurrentPose(), gotAllResources(), methodCall(), setResource(), and UResDrivePos().

UPoseV UResDrivePos::repeat0startPose
protected

The current pose on first call to function (relative call only)

Referenced by methodCall().

UPoseV UResDrivePos::targetPose
protected

The calculated (and used) target pose and velocity

UVariable* UResDrivePos::varFailCnt
protected

index to used count of attempts to get a path, but failed, since lase success

Referenced by createBaseVar(), and driveOdo().

UVariable* UResDrivePos::varFinalDistance
protected

index to area where no additional path calculations take place - close to desired exit position

Referenced by createBaseVar(), and driveOdo().

UResVarPool* UResDrivePos::varGlobal
protected

Pose history

Referenced by gotAllResources(), setResource(), and UResDrivePos().

UVariable* UResDrivePos::varLoopCnt
protected

index to varPool variable loopCount

Referenced by createBaseVar(), and driveOdo().

UVariable* UResDrivePos::varOdoV
protected

index to varPool variable targetPose Y index to varPool variable target pose H index to varPool variable target velocity

Referenced by createBaseVar(), and driveOdo().

UVariable* UResDrivePos::varOdoX
protected

index to varPool variable target pose X

Referenced by createBaseVar(), and driveOdo().

UVariable* UResDrivePos::varUpdateTime
protected

index to latest update time (road drive calculation)

Referenced by createBaseVar(), and driveOdo().


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