AURobotServers
4
|
#include <ufuncview.h>
Public Member Functions | |
virtual bool | handleCommand (UServerInMsg *msg, void *extra) |
void | run () |
UFuncView () | |
virtual | ~UFuncView () |
Public Member Functions inherited from UFuncPlugBase | |
UFuncPlugBase () | |
virtual | ~UFuncPlugBase () |
Public Member Functions inherited from UFunctionBase | |
bool | addResource (UResBase *resource, UFunctionBase *owner) |
void | closeLogfile () |
virtual const char * | commandList () |
virtual void | createResources () |
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 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 | 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 | |
void | createBaseVar () |
virtual bool | methodCall (const char *name, const char *paramOrder, char **strings, const double *pars, double *value, UDataBase **returnStruct, int *returnStructCnt) |
void | paintBold (bool bold) |
void | setRangeRingCnt (int value) |
bool | setResource (UResBase *resource, bool remove) |
void | setRobot (const char *robname) |
void | setRobotPose (char *value) |
bool | start () |
void | stop (bool andWait) |
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... | |
Static Protected Attributes | |
static const int | UPD_LIST_MAX_CNT = 100 |
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... | |
Private Attributes | |
bool | saveAsPng |
char | saveAsPngName [MAX_FILENAME_SIZE] |
pthread_t | threadHandle |
bool | threadRunning |
thread runnung flag More... | |
bool | threadStop |
stop thread flag More... | |
UVariable * | varPoolImg |
pointer to limiting red values redMin, redMax, greenMin, greenMax More... | |
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 |
3D viewer - from PCL library
|
inline |
Constructor
References createBaseVar(), handleCommand(), methodCall(), UFunctionBase::msg, UFunctionBase::name(), run(), UFunctionBase::setCommand(), setResource(), start(), stop(), and ~UFuncView().
Referenced by setRobot().
|
virtual |
Destructor - to delete the resource (etc) when finished
Referenced by UFuncView().
|
protected |
Make the variables that will be available to other plugins
References UResVarPool::addMethod(), UResVarPool::addVar(), UResVarPool::addVarA(), varAutoHereNow, varAutoPanView, varBold, varFollowRobot, varPCLspinTime, varRangeRings, varResetView, varResetViewFocus, varResetViewPos, and varRunning.
Referenced by UFuncView().
|
virtual |
Handle incomming command Must return true if the function is handled - otherwise the client will get a 'failed' reply
Reimplemented from UFunctionBase.
References bool2str(), UNavView::followRobot, UTime::getForFilename(), USmlTagIn::getNextAttribute(), USmlTagIn::getTagStart(), globalNavRedisplay, imagePath, MAX_FILENAME_SIZE, MAX_SML_NAME_LENGTH, UNavView::maxStrLng, navPaint, UTime::now(), paintBold(), UNavView::paintCam, UNavView::paintCurves, UNavView::paintGmk, UNavView::paintGridOdo, UNavView::paintGridSize, UNavView::paintIntervalLines, UNavView::paintMapPose, UNavView::paintObstCnt, UNavView::paintOdoPose, UNavView::paintPathLinesCnt, UNavView::paintPathMidPoses, UNavView::paintPcpHide, UNavView::paintPcpShow, UNavView::paintPoly, UNavView::paintPolyHide, UNavView::paintPolyNameCnt, UNavView::paintPolyShow, UNavView::paintPoseHistCnt, UNavView::paintPoseHistVecCnt, UNavView::paintPoseHistVecLng, UNavView::paintPoseRef, UNavView::paintRoadAll, UNavView::paintRoadHistCnt, UNavView::paintScanHistCnt, UNavView::paintUtmPose, UNavView::paintVar, UNavView::paintVarAdd(), UNavView::paintVisPolyCnt, resetView, saveAsPng, saveAsPngName, UFunctionBase::sendInfo(), UFunctionBase::sendMsg(), UFunctionBase::sendText(), UFunctionBase::sendWarning(), setRangeRingCnt(), UNavView::setRefSystemsHere(), setRobot(), UVariable::setValued(), str2bool2(), UServerInMsg::tag, and varAutoHereNow.
Referenced by UFuncView().
|
protectedvirtual |
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 newDataLaser, newDataLaserAt, newDataNav, newDataNavAt, and UTime::Now().
Referenced by UFuncView().
|
protected |
Set the paint bold flag
bold | true or false |
References navPaint, UNavView::paintBold, UVariable::setValued(), and varBold.
Referenced by handleCommand().
void UFuncView::run | ( | ) |
Create viewer thread that updated the view
References deg2rad, dispSync, UNavView::followRobot, UVariable::get3D(), UVariable::getBool(), UVariable::getDouble(), UVariable::getInt(), UTime::getTimePassed(), globalNavRedisplay, limitToPi(), ULock::lock(), UNavView::moveViewPose(), navPaint, newDataLaser, newDataLaserAt, newDataNav, newDataNavAt, UTime::now(), UNavView::paint(), UNavView::rangeRingCnt, resetView, saveAsPng, saveAsPngName, UVariable::setBool(), UNavView::setRefSystemsHere(), UNavView::setViewer(), threadRunning, threadStop, ULock::unlock(), varAutoHereNow, varAutoPanView, varFollowRobot, varPCLspinTime, varRangeRings, varResetView, varResetViewFocus, varResetViewPos, viewer, Wait(), UPosition::x, UPosition::y, and UPosition::z.
Referenced by startUFuncViewThread(), and UFuncView().
|
protected |
Set number of range rings
References navPaint, UNavView::rangeRingCnt, UVariable::setValued(), and varRangeRings.
Referenced by handleCommand().
|
protectedvirtual |
Set ressource as needed (probably not used by this resource)
Reimplemented from UFunctionBase.
References UResPoseHist::getMapPoseID(), UResPoseHist::getOdoPoseID(), UImagePool::getResClassID(), UResBase::getResID(), UResPoseHist::getUtmPoseID(), imgPool, UResBase::isA(), navPaint, poseHist, poseMap, poseUtm, UFunctionBase::setResource(), UNavView::setResource(), and varRoot.
Referenced by UFuncView().
|
protected |
Set robot type.
robname | is the type name of the robot - smr, mmr or hako |
References createFunc(), navPaint, UNavView::paintRobot, UVariable::setValued(), UFuncView(), and varRangeRings.
Referenced by handleCommand().
|
protected |
Set position of robot on display - in meters from bottom position
value | is a string with pose values as a string, p.t. the first cvalue is used only. |
References UPose::h, navPaint, UNavView::robotPose, UPose::x, and UPose::y.
|
protected |
Start viewer thread
References startUFuncViewThread(), threadHandle, threadRunning, and threadStop.
Referenced by UFuncView().
|
protectedvirtual |
Stop viewer thread
Reimplemented from UResBase.
References threadHandle, threadRunning, and threadStop.
Referenced by UFuncView().
|
protected |
Flag for changing scale on nav display
Referenced by handleCommand(), and run().
|
protected |
Pointer to image pool resource
Referenced by setResource().
|
protected |
Painter for navigation image
Referenced by handleCommand(), paintBold(), run(), setRangeRingCnt(), setResource(), setRobot(), and setRobotPose().
|
protected |
New data received to image pool
|
protected |
Time of newest data update of image in image pool
|
protected |
New data received - laser data
Referenced by methodCall(), and run().
|
protected |
Time of newest data update of data for laser plane display
Referenced by methodCall(), and run().
|
protected |
New data received - navigation data
Referenced by methodCall(), and run().
|
protected |
Time of newest data update of data for laser plane display
Referenced by methodCall(), and run().
|
protected |
Pointer to a pose history module with current robot position
Referenced by setResource().
|
protected |
Pointer to a pose history module with current robot position in map coordinates
Referenced by setResource().
|
protected |
Pointer to a pose history module with current robot position in GPS (UTM) coordinates
Referenced by setResource().
|
protected |
Reset view - look at the robot from behind
Referenced by handleCommand(), and run().
|
private |
save viewed image as png-file if true
Referenced by handleCommand(), and run().
|
private |
save as PNG file using this name
Referenced by handleCommand(), and run().
|
private |
|
staticprotected |
allowed number of highgui displayed images
|
protected |
Number of used entries in the image update list
|
protected |
should coordinate systems be alligned at robot always
Referenced by createBaseVar(), handleCommand(), and run().
|
protected |
pan automatically [0]=1 active, [1]=pan angle (degrees), [2]=deg/sec
Referenced by createBaseVar(), and run().
|
protected |
paint bold
Referenced by createBaseVar(), and paintBold().
|
protected |
try to make view follow robot
Referenced by createBaseVar(), and run().
|
protected |
PCL viewer spin time value [1..100] approximately in ms - if available CPU power.
Referenced by createBaseVar(), and run().
|
private |
pointer to limiting red values redMin, redMax, greenMin, greenMax
|
protected |
number of range rings to paint (each 1m)
Referenced by createBaseVar(), run(), setRangeRingCnt(), and setRobot().
|
protected |
reset to default view camera position
Referenced by createBaseVar(), and run().
|
protected |
Default focus position (when reset)
Referenced by createBaseVar(), and run().
|
protected |
Default position of view camera.
Referenced by createBaseVar(), and run().
|
protected |
Pointer to a (root) var-pool with access to all sub-structures
Referenced by setResource().
|
protected |
Index to variable with thread running value
Referenced by createBaseVar().
|
protected |
The viewer
Referenced by run().