AURobotServers
4
|
#include <uresmapobst.h>
Public Member Functions | |
int | getNearObstacles (UPose mapPose, UPose odoPoseOrigin, UDataBase *obstGrp) |
virtual bool | methodCall (const char *name, const char *paramOrder, char **strings, const double *pars, double *value, UDataBase **returnStruct, int *returnStructCnt) |
bool | methodCallV (const char *name, const char *paramOrder, UVariable *params[], UDataBase **returnStruct, int *returnStructCnt) |
virtual const char * | print (const char *preString, char *buff, int buffCnt) |
int | sendMapLinesToLocalizer (int client, bool justObstacles) |
UResMapObst () | |
virtual | ~UResMapObst () |
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) |
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 () |
Public Member Functions inherited from ULogFile | |
void | closeLog () |
void | doFlush () |
FILE * | getF () |
const char * | getLogFileName () |
const char * | getLogName () |
bool | isLogOpen () |
bool | isOpen () |
void | logLock () |
bool | logRename (const char *name) |
void | logUnlock () |
bool | openLog () |
bool | openLog (bool doOpen) |
bool | openLog (const char *resName) |
void | setLogFlush (bool doFlush) |
void | setLogName (const char *resName, const char *ext="log") |
void | setLogNameNumber (int number) |
add a number to the logfile name, That is if the logName is 'svs' and number is 2 (and logPath is '/rhome/demo'), then logfilename is set to '/rhome/demo/svs_2.log'. The purpose is to have an alternative, if the file renaming fails (if the file system is locked or something). More... | |
void | setLogTime (UTime timestamp) |
void | toLog (const char *logString) |
void | toLog (const char *s1, const char *s2) |
void | toLog (const int num, const char *s1, const char *s2) |
void | toLog (const char *s1, const int num, const char *s2) |
void | toLog (const char *s1, const int n1, const int n2, const char *s2) |
void | toLog (const char *s1, const int num, const char *s2, const char *s3) |
void | toLog (const char *s1, const int n1, const int n2, const char *s2, const char *s3) |
ULogFile () | |
void | useLogTime (bool value) |
~ULogFile () | |
Public Attributes | |
bool | verbose |
Public Attributes inherited from UReplay | |
bool | replayTimeAdvancePending |
UTime | replayTimeNow |
Protected Member Functions | |
void | createBaseVar () |
void | UResMapObstInit () |
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 | |
UVariable * | varBack |
map search volumen relative to robot More... | |
UVariable * | varFront |
time for last obstacle extraction More... | |
UVariable * | varMapLineCnt |
number of map lines loaded to localizer More... | |
UVariable * | varMapPose |
position of robot at last extraction More... | |
UVariable * | varMarginFluffyFactor |
part of 'perimeter' that is more fluffy - expect false obstacles More... | |
UVariable * | varMarginSolidFactor |
part of 'perimeter' that is solid obstacle More... | |
UVariable * | varObstCnt |
obstacle count in last extraction More... | |
UVariable * | varWidth |
map search volumen relative to robot More... | |
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 |
Protected Attributes inherited from ULogFile | |
int | failCnt |
FILE * | logFile |
ULock | logFileLock |
char | logFileName [MAX_FILENAME_SIZE] |
bool | logFlush |
char | logName [MAX_FILENAME_SIZE] |
UTime | logTime |
bool | logTimeUse |
Additional Inherited Members | |
Static Public Member Functions inherited from UResVarPool | |
static const char * | getResClassID () |
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.
The class has the resource to extract obstacle lines from the map in the vicinity of the current robot position.
|
inline |
Constructor
References createBaseVar(), getNearObstacles(), methodCall(), methodCallV(), print(), sendMapLinesToLocalizer(), UResBase::setResID(), UResMapObstInit(), and ~UResMapObst().
|
virtual |
|
protected |
Make the variables that will be available to other plugins
References UResVarPool::addMethod(), UResVarPool::addMethodV(), UResVarPool::addVar(), varBack, varFront, varMapLineCnt, varMapPose, varMarginFluffyFactor, varMarginSolidFactor, varObstCnt, and varWidth.
Referenced by UResMapObst(), and UResMapObstInit().
extract map lines from obstacle bas that is near the current robot pose
odoPoseOrigin | is current robot pose in odometry coordinates, and the related pose time |
obstGrp | is the obstacle group, where resulting obstacles are to be placed |
References UPolygon::add(), UPolygon::clear(), UObstacleGroup::clear(), UPolygon::extractConvexTo(), U2Dseg::getDistanceSigned(), U2Dseg::getHeading(), UPose::getMapToPose(), UObstacleGroup::getNewObst(), UObstacleGroup::getObstsCnt(), U2Dseg::getOtherEnd(), UPose::getPoseToMap(), UResBase::getStaticResource(), UVariable::getValued(), UResBase::line, UTime::now(), UPose::set(), U2Dpos::set(), UPolygon::setAsPolygon(), U2Dseg::setFromPoints(), UVariable::setInt(), UObstacle::setMargin(), UVariable::setPose(), UObstacle::setPoseFirst(), UObstacle::setPoseLast(), UPoseTime::t, varFront, varMapPose, varMarginFluffyFactor, varMarginSolidFactor, varObstCnt, U2Dpos::x, UPose::x, U2Dpos::y, and UPose::y.
Referenced by methodCall(), methodCallV(), and UResMapObst().
|
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. |
strings | is an array of string pointers for the string type parameters (may be NULL if not used) |
doubles | is an array with double typed parameters (may be NULL if not used) |
value | is the (direct) result of the class, either a double value, or 0.0 for false 1.0 for true (2.0 for implicit stop if a controll call from mission sequencer). |
returnStruct | is an array of class object pointers that can be used as parameters or return objects (may be NULL) |
returnStructCnt | is the number of objects in the returnStruct buffer |
Reimplemented from UResVarPool.
References getNearObstacles(), and UPose::set().
Referenced by UResMapObst().
|
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 getNearObstacles(), UVariable::getPose(), UResBase::isA(), UVariable::setDouble(), and UResBase::var.
Referenced by UResMapObst().
|
virtual |
int UResMapObst::sendMapLinesToLocalizer | ( | int | client, |
bool | justObstacles | ||
) |
Take map lines and feed them to the localizer using the core command queue.
client | is the 'fake' client number putting the commands on the queue. |
justObstacles | use only those map lines that are marked as obstacles. |
References UResBase::getCorePointer(), UResBase::getStaticResource(), UResBase::line, UCmdExe::postCommand(), UVariable::setInt(), and varMapLineCnt.
Referenced by UFuncMapObst::handleCommand(), and UResMapObst().
|
protected |
Initialize resource
References createBaseVar(), ULogFile::openLog(), ULogFile::setLogName(), and verbose.
Referenced by UResMapObst().
|
protected |
map search volumen relative to robot
Referenced by createBaseVar().
|
protected |
time for last obstacle extraction
map search volumen relative to robot
Referenced by createBaseVar(), and getNearObstacles().
|
protected |
number of map lines loaded to localizer
Referenced by createBaseVar(), and sendMapLinesToLocalizer().
|
protected |
position of robot at last extraction
Referenced by createBaseVar(), and getNearObstacles().
|
protected |
part of 'perimeter' that is more fluffy - expect false obstacles
Referenced by createBaseVar(), and getNearObstacles().
|
protected |
part of 'perimeter' that is solid obstacle
Referenced by createBaseVar(), and getNearObstacles().
|
protected |
obstacle count in last extraction
Referenced by createBaseVar(), and getNearObstacles().
|
protected |
map search volumen relative to robot
Referenced by createBaseVar().
bool UResMapObst::verbose |
Is the resource to output verbose message to console
Referenced by UFuncMapObst::handleCommand(), and UResMapObstInit().