AURobotServers
4
|
#include <uresdrivepos.h>
Public Member Functions | |
double | driveOdo (UPoseV exitPose, bool ignoreVel, int repeat) |
UPoseV | getCurrentPose () |
UManSeq * | getManLocked () |
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) |
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 () |
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 () |
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 () |
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 | |
UResBase * | getStaticResource (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 |
UManSeq * | man |
ULock | manLock |
UResPoseHist * | poseHist |
UPoseV | repeat0startPose |
UPoseV | targetPose |
UVariable * | varFailCnt |
UVariable * | varFinalDistance |
UResVarPool * | varGlobal |
UVariable * | varLoopCnt |
UVariable * | varOdoV |
UVariable * | varOdoX |
UVariable * | varUpdateTime |
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 |
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... | |
This is the shared resource class. It must enherit from the resource base class (or one of its decendent) as shown.
|
inline |
Constructor
References createBaseVar(), UResVarPool::createVarSpace(), getResClassID(), UResBase::getResVersion(), man, odoDriveCnt, poseHist, UResBase::resVersion, UResBase::setResID(), varGlobal, and ~UResDrivePos().
|
virtual |
Destructor
Referenced by UResDrivePos().
|
protected |
Create the smrif related variables
References UResVarPool::addMethod(), UResVarPool::addVar(), UResBase::getResVersion(), varFailCnt, varFinalDistance, varLoopCnt, varOdoV, varOdoX, and varUpdateTime.
Referenced by setManUnlocked(), and UResDrivePos().
double UResDrivePos::driveOdo | ( | UPoseV | exitPose, |
bool | ignoreVel, | ||
int | repeat | ||
) |
Drive to this pose position on odometry coordinates. Desired speed and other options are taken from the usual places.
References UVariable::add(), UResVarPool::callGlobal(), finalPart, finalPose, UPose::getDistance(), UResVarPool::getGlobalValue(), UResPoseHist::getNewest(), UTime::getTimePassed(), UVariable::getValued(), UResVarPool::getVarPool(), UPoseV::getVel(), UPose::h, lastExitPose, lastObstUpdate, lastStartPose, man, manLock, maxd(), odoDriveCnt, poseHist, UVariable::setInt(), UVariable::setPose(), UTime::setTime(), UVariable::setValued(), UPoseV::setVel(), ULock::tryLock(), ULock::unlock(), varFailCnt, varFinalDistance, varLoopCnt, varOdoV, varOdoX, varUpdateTime, UPose::x, and UPose::y.
Referenced by UFunctionDrivePos::handleDrivePos(), methodCall(), and setManUnlocked().
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().
|
inlinestatic |
Fixed name of this resource type
References getManLocked(), gotAllResources(), methodCall(), print(), and setResource().
Referenced by UResDrivePos().
|
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().
|
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().
|
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().
|
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().
|
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().
|
protected |
Set target pose in varPool from these parameters
Referenced by setManUnlocked().
|
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().
|
protected |
The robot pose when entered into the final path
Referenced by driveOdo().
|
protected |
The target pose at the last calculation
Referenced by driveOdo().
|
protected |
The update time used for the latest calculation
Referenced by driveOdo().
|
protected |
The current pose used in previous calculation
Referenced by driveOdo().
|
protected |
Pointer to Last found manouvre sequence (actually in avoid module)
Referenced by driveOdo(), getManLocked(), and UResDrivePos().
|
protected |
Lock to be used during read of the found manoeuvre
Referenced by driveOdo(), getManLocked(), and setManUnlocked().
|
private |
debug count of odo-drives
Referenced by driveOdo(), and UResDrivePos().
|
protected |
local variables provided by this resource. Pose history
Referenced by driveOdo(), getCurrentPose(), gotAllResources(), methodCall(), setResource(), and UResDrivePos().
|
protected |
The current pose on first call to function (relative call only)
Referenced by methodCall().
|
protected |
The calculated (and used) target pose and velocity
|
protected |
index to used count of attempts to get a path, but failed, since lase success
Referenced by createBaseVar(), and driveOdo().
|
protected |
index to area where no additional path calculations take place - close to desired exit position
Referenced by createBaseVar(), and driveOdo().
|
protected |
Pose history
Referenced by gotAllResources(), setResource(), and UResDrivePos().
|
protected |
index to varPool variable loopCount
Referenced by createBaseVar(), and driveOdo().
|
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().
|
protected |
index to varPool variable target pose X
Referenced by createBaseVar(), and driveOdo().
|
protected |
index to latest update time (road drive calculation)
Referenced by createBaseVar(), and driveOdo().