AURobotServers
4
|
#include <ufunctioncampath.h>
Public Member Functions | |
virtual bool | handleCommand (UServerInMsg *msg, void *extra) |
void | setLog (FILE *logFd) |
UFunctionCamPath () | |
virtual | ~UFunctionCamPath () |
Public Member Functions inherited from UFunctionCamBase | |
virtual void | createResources () |
UImage * | getImage (UServerInMsg *msg, void *extra) |
virtual bool | setResource (UResBase *ressource, bool remove) |
UFunctionCamBase () | |
virtual | ~UFunctionCamBase () |
Public Member Functions inherited from UFunctionImgBase | |
virtual void | setCmdHandler (UCmdExe *cmdExe) |
void | showImagesAsDefault (bool show) |
UFunctionImgBase () | |
virtual | ~UFunctionImgBase () |
Public Member Functions inherited from UFunctionBase | |
bool | addResource (UResBase *resource, UFunctionBase *owner) |
void | closeLogfile () |
virtual const char * | commandList () |
const char * | getAliasName () |
const char * | getLoadedFileName () |
void * | getLoadedModuleRef () |
virtual bool | gotAllResources (char *missingThese, int missingTheseCnt) |
bool | isMine (const char *cmdName) |
bool | isStatic () |
is the module loaded as static A module is static if the ldFilename has a length of zero. More... | |
virtual const char * | name () |
bool | newCmd (UServerInMsg *newMsg, UDataBase *extra) |
bool | newCommand (UServerInMsg *newMsg, void *extra) |
bool | openLogfile (const char *name) |
void | print (const char *preString) |
virtual void | resourceUpdated () |
bool | sendEndTag (UServerInMsg *msg) |
bool | sendEndTag () |
bool | sendFullTag (const char *attributes) |
bool | sendHelpDone (UServerInMsg *msg) |
bool | sendHelpDone () |
bool | sendHelpStart (UServerInMsg *msg, const char *subject) |
bool | sendHelpStart (const char *subject) |
bool | sendHelpStart () |
bool | sendMsg (UServerInMsg *msg, const char *message, int size) |
bool | sendMsg (const char *message) |
bool | sendMsg (UServerInMsg *msg, const char *message) |
bool | sendMsg (int clientIdx, const char *message, int size) |
bool | sendMsgInt (int clientIdx, const char *message) |
bool | sendStartTag (const char *attributes) |
bool | sendText (UServerInMsg *msg, const char *text) |
bool | sendText (const char *text) |
virtual void | setAliasName (const char *name) |
virtual void | setCommand (const char *cmdList, const char *name, const char *note) |
void | setLoadedModuleRef (void *module, const char *moduleFileName) |
virtual void | setLoadTime (UTime) |
void | setName (const char *name) |
void | setVerbose (bool value) |
UFunctionBase () | |
virtual | ~UFunctionBase () |
Public Member Functions inherited from UCallBack | |
bool | addOnEvent (UOnEvent *dataObject) |
virtual bool | onEvent (const char *interface, const char *dataType, void *data) |
UCallBack () | |
virtual | ~UCallBack () |
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) |
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) |
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) |
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 | 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 () |
Protected Member Functions | |
bool | findPath (UServerInMsg *msg, UImage *pushImg, UCamPush *cam, UPose robPose, bool push, double lookingLeft, int x1, int y1, int x2, int y2, bool colorCorrect, bool testBalLim) |
bool | getImageName (int imgNumber, const char *subdir, const char *imgFileLog, char *imgFile, int imgFileLng, UTime *imgTime, int *camDeviceNum, char *posName, unsigned long *imageNumber) |
bool | getRobotPose (const char *subdir, const char *odoFileLog, UTime imgTime, UPose *robPose) |
bool | handlePathGetCommand (UServerInMsg *msg, URawImage *imgBase) |
bool | initializeFindPath () |
Protected Member Functions inherited from UFunctionCamBase | |
UCamPush * | getCam (int imgDevice, const char *posName) |
UCamPush * | getCam (int camDevNum) |
bool | getCamAndRawImage (UCamPush **cam, UImage **imgRaw, int *imgDevice, void *imgBase, const char *posName, int rectfiedImg) |
int | getDefaultCamDevice () |
Protected Member Functions inherited from UFunctionImgBase | |
bool | sendImage (UServerInMsg *msg, const char *tagName, UImage *imgRgb, int imgLeft=0, int imgTop=0, int imgWidth=640, int imgHeight=480, int imgSource=-1, bool isCodecBin=true, bool imgIsBW=false, bool imgGetNum=true, bool imgGetTod=true, bool imgGetTime=false, const char *posName=NULL, bool imgGetName=true, bool silent=false) |
Protected Member Functions inherited from UFunctionBase | |
int | getCmdIndex () |
UResBase * | getStaticResource (const char *resName, bool mayCreate, bool staticOnly=true) |
get a pointer to a static resource. More... | |
bool | isClientAlive (int clientIdx, double holdOffTime) |
bool | sendDebug (UServerInMsg *msg, const char *debugText) |
bool | sendDebug (const char *debugText) |
bool | sendError (UServerInMsg *msg, const char *errorText) |
bool | sendError (const char *errorText) |
bool | sendHelp (UServerInMsg *msg, const char *infoText) |
bool | sendHelp (const char *infoText) |
bool | sendInfo (UServerInMsg *msg, const char *infoText) |
bool | sendInfo (const char *infoText) |
bool | sendWarning (UServerInMsg *msg, const char *warningText) |
bool | sendWarning (const char *warningText) |
UResBase * | setThisResource (const char *ID, UResBase *resource, bool remove, bool *changed, UResBase *currentResPtr, bool *isLocal) |
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... | |
Private Attributes | |
UImageAna * | ana |
double | ballance |
CvMemStorage * | cvStorage |
UProbGrid * | grid |
char | imgFileLog [MAX_LIST_FILENAME_SIZE] |
int | imgFileNum |
char | imgFileSubdir [MAX_LIST_FILENAME_SIZE] |
UImgProj * | imp |
bool | initialized |
double | limit |
FILE * | logPath |
Additional Inherited Members | |
Static Public Member Functions inherited from UResVarPool | |
static const char * | getResClassID () |
Public Attributes inherited from UFunctionBase | |
bool | silent |
is reply to client and console to be limited More... | |
Public Attributes inherited from UReplay | |
bool | replayTimeAdvancePending |
UTime | replayTimeNow |
Static Public Attributes inherited from UFunctionBase | |
static const int | MAX_ID_LENGTH = 30 |
static const int | MAX_RESOURCE_LIST_SIZE = 250 |
Protected Attributes inherited from UFunctionCamBase | |
UCamPool * | camPool |
Protected Attributes inherited from UFunctionImgBase | |
UImagePool * | imgPool |
Protected Attributes inherited from UFunctionBase | |
char | aliasName [MAX_ID_LENGTH] |
UCmdExe * | cmdHandler |
char * | cmdToks [20] |
int | cmdToksCnt |
char | commandsHandled [MAX_RESOURCE_LIST_SIZE] |
UServerInMsg * | msg |
char | pluginName [MAX_RESOURCE_LIST_SIZE] |
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 |
UReplay * | replayParent |
UTime | replayTimeNext |
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... | |
server function to extract free path from images Version tag
UFunctionCamPath::UFunctionCamPath | ( | ) |
Constructor
References ana, ballance, cvStorage, grid, imgFileLog, imgFileNum, imgFileSubdir, imp, initialized, limit, logPath, and UFunctionBase::setCommand().
|
virtual |
Destructor
References logPath.
|
protected |
The find path function. Finds a polygon from a seed point, using an relative and an absolute paramaeter
References ana, ballance, UImage::camDevice, UProbPoly::clear(), UFunctionBase::cmdHandler, UPolygon::copy(), UImgProj::doProjectPolygonToFloorReal(), UImageAna::findRoadPoly(), UCamRad::getCamPar(), UImageAna::getCromaTraceSD(), UImgProj::getFloorPoly(), UImageAna::getFloorPolygon(), UImageAna::getFloorPolygonCnt(), UImagePool::getImage(), UImageAna::getObstacleFlags(), UPolygon::getPointsCnt(), UCamMounted::getPos(), UCamMounted::getRot(), UTime::getTimePassed(), UPolygon::getXYarea(), UImage::imageNumber, imagePath, UImageAna::imageUsable(), UFunctionImgBase::imgPool, UImage::imgTime, imp, limit, logPath, maxf(), minf(), UTime::Now(), roundi(), UImage::savePNG(), UFunctionImgBase::sendImage(), UFunctionBase::sendInfo(), USmlTag::sendProbPoly(), UImgProj::setCamPar(), UImgProj::setCamPos(), UProbPoly::setCromaSD(), UImageAna::setImage(), UCamPar::setPixelSize(), UProbPoly::setPoly(), and UImage::width().
Referenced by handlePathGetCommand(), and setLog().
|
protected |
Get image name and decode device, time, camera, hdrMode
References imagePath, MAX_PATH_LENGTH, and UTime::setTime().
Referenced by handlePathGetCommand(), and setLog().
|
protected |
Get robot pose at this time
References imagePath, MAX_PATH_LENGTH, UPose::set(), and UTime::setTime().
Referenced by setLog().
|
virtual |
Name of function The returned name is intended as informative to clients and should include a version number Returns list of handled functions Handle camera and image commands
Reimplemented from UFunctionBase.
References handlePathGetCommand(), USmlTagIn::isTagA(), UFunctionBase::sendDebug(), and UServerInMsg::tag.
|
protected |
Function to do the path analysis
References absi(), ballance, UImage::cam, UImage::camDevice, findPath(), UFunctionCamBase::getCam(), UFunctionCamBase::getCamAndRawImage(), UCamBase::getDev(), UCamDevBase::getDeviceNumber(), UImagePool::getImage(), getImageName(), UCamMounted::getMtoPix(), USmlTagIn::getNextAttribute(), UImage::height(), UImage::imageNumber, imagePath, imgFileLog, imgFileNum, imgFileSubdir, UFunctionImgBase::imgPool, UImage::imgTime, UImage::imgUpdated(), initialized, initializeFindPath(), limit, UImage::loadBMP(), logPath, MAX_LIST_FILENAME_SIZE, MAX_MOUNT_NAME_SIZE, MAX_PATH_LENGTH, MAX_SML_NAME_LENGTH, maxi(), mini(), UPosition::print(), roundi(), UFunctionBase::sendInfo(), UFunctionBase::sendMsg(), UFunctionBase::sendText(), UFunctionBase::sendWarning(), str2bool(), UServerInMsg::tag, UImage::toRGB(), UImage::width(), UPosition::x, UPosition::y, and UPosition::z.
Referenced by handleCommand(), and setLog().
|
protected |
Initialize needed structures
References ana, UImgProj::clearColMap(), UImgProj::clearPathMap(), cvStorage, UImagePool::getImage(), UImgProj::getMapColImg(), grid, UFunctionImgBase::imgPool, imp, UImgProj::paintGrid(), UProbGrid::setGrid(), UImageAna::setImagePool(), UImgProj::setImages(), UImageAna::setStorage(), and UProbGrid::setTempImg().
Referenced by handlePathGetCommand(), and setLog().
|
inline |
Set logfile to use for path limit analyze
References findPath(), getImageName(), getRobotPose(), handlePathGetCommand(), imgFileLog, initializeFindPath(), and logPath.
|
private |
Image analysis object
Referenced by findPath(), initializeFindPath(), and UFunctionCamPath().
|
private |
ballance between croma and edge – default = 0.5. Ballance = 0.0 => croma criteria only. Ballance = 1.0 => edge alone.
Referenced by findPath(), handlePathGetCommand(), and UFunctionCamPath().
|
private |
Storage used by openCV
Referenced by initializeFindPath(), and UFunctionCamPath().
|
private |
Probability grid object
Referenced by initializeFindPath(), and UFunctionCamPath().
|
private |
Name of file with saved images for testing
Referenced by handlePathGetCommand(), setLog(), and UFunctionCamPath().
|
private |
Last used image number from file, to allow use of push of next image number.
Referenced by handlePathGetCommand(), and UFunctionCamPath().
|
private |
Name of file with logged odometry information in format:
tomeofday x y h
1099404780.178155 -0.000921 0.000003 -0.004755
1099404780.238847 -0.001036 0.000003 -0.004756
1099404780.328159 -0.001094 0.000003 -0.004993
Subdirectory relative to imagePath, where the logfiles and the images are stored.
Referenced by handlePathGetCommand(), and UFunctionCamPath().
|
private |
Projection object
Referenced by findPath(), initializeFindPath(), and UFunctionCamPath().
|
private |
is all objects initialized
Referenced by handlePathGetCommand(), and UFunctionCamPath().
|
private |
Absolute treshold for free path edge finding relative to seed point.
Referenced by findPath(), handlePathGetCommand(), and UFunctionCamPath().
|
private |
Logfile for path analyze
Referenced by findPath(), handlePathGetCommand(), setLog(), UFunctionCamPath(), and ~UFunctionCamPath().