AURobotServers
4
|
#include <urespcp.h>
Public Member Functions | |
UPcpItem * | add (const char *name) |
UPcpItem * | add (const char *name, const double x, const double y, const double z=0.0) |
UPcpItem * | add (const char *name, UPcpItem::POINT_CLOUD_TYPE type) |
bool | codePcpXml (const char *tagName, char *buf, const int bufCnt, int idx) |
virtual const char * | commandList () |
UPcpItem * | copy (pcl::PointCloud< pcl::PointXYZ > *source, const char *name) |
UPcpItem * | copy (pcl::PointCloud< pcl::PointXYZRGB > *source, const char *name) |
virtual void | createResources () |
bool | del (const char *name) |
UPcpItem * | getItem (const char *name) |
UPcpItem * | getItem (int idx) |
UPcpItem * | getItemXYZ (const char *name) |
const char * | getList (const char *preStr, char *buff, const int buffCnt) |
UPcpItem * | getNext (int p1, int *p2, const char *name) |
int | getPolysCnt () |
void | gotNewData () |
virtual void | handleNewData (USmlTag *tag, const char *ifname) |
virtual bool | methodCall (const char *name, const char *paramOrder, char **strings, const double *pars, double *value, UDataBase **returnStruct, int *returnStructCnt) |
virtual bool | methodCallV (const char *name, const char *paramOrder, UVariable *params[], UDataBase **returnStruct=NULL, int *returnStructCnt=NULL) |
virtual const char * | print (const char *preString, char *buff, int buffCnt) |
bool | savePCD (const char *idName, const char *filename) |
UResPcp () | |
void | UResPcpInit () |
virtual | ~UResPcp () |
Public Member Functions inherited from UResIfBase | |
UResIfBase () | |
~UResIfBase () | |
Public Member Functions inherited from UClientFuncBase | |
virtual void | changedNamespace (const char *newNamespace) |
virtual void | doTimeTick () |
int | getMsgCnt () |
bool | getVerbose () |
virtual const char * | name () |
bool | sendMsg (UClientPortSml *cnn, const char *buff, int buffCnt) |
bool | sendMsg (UClientPortSml *cnn, const char *buff) |
void | setVerbose (bool value) |
UClientFuncBase () | |
virtual | ~UClientFuncBase () |
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) |
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 UClientFuncBase | |
ULock | decodeLock |
Public Attributes inherited from UReplay | |
bool | replayTimeAdvancePending |
UTime | replayTimeNow |
Protected Member Functions | |
void | createBaseVar () |
Protected Member Functions inherited from UClientFuncBase | |
void | handleHelp (USmlTag *tag) |
void | printReply (USmlTagIn *tag, const char *preString) |
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 | MAX_POLYS_CNT = 1000 |
maximum number of pcps More... | |
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... | |
Additional Inherited Members | |
Static Public Member Functions inherited from UResVarPool | |
static const char * | getResClassID () |
This is the shared resource class.
This class implements a point cloud pool (PCP) All pool items has an ID - a text string (< 32 chars) and is also used by the AUVIEW opengl 3D viewer) The items can be retrieved by other plugins for on-line viewing/saving through this plugin
|
inline |
Constructor
References UResBase::setResID(), UResPcpInit(), and ~UResPcp().
|
virtual |
Destructor
Referenced by UResPcp().
UPcpItem * UResPcp::add | ( | const char * | name | ) |
Add a new pcp item
name | is the name of the new item. The name must be unique, |
References UPcpItem::getPointsCnt(), ULock::lock(), UPcpItem::setAsPolyline(), UPcpItem::setName(), ULock::unlock(), and UPcpItem::UPcpItem().
Referenced by copy(), getItem(), and UFuncPcp::handleCommand().
UPcpItem * UResPcp::add | ( | const char * | name, |
const double | x, | ||
const double | y, | ||
const double | z = 0.0 |
||
) |
Add a new XYZ position to this cloud, creates cloud if none exist.
name | is the name of a new or existing item. Names are unique, |
x,y,z | is a position that is added to the end of the item points, z is optional. |
References UPcpItem::add(), UPcpItem::deleteCloud(), UPcpItem::getPointsCnt(), UPcpItem::isXYZ(), ULock::lock(), UPcpItem::makeCloud(), UPcpItem::PointXyz, UPcpItem::setAsPolyline(), UPcpItem::setName(), UPcpItem::setUpdated(), ULock::unlock(), UPcpItem::UPcpItem(), UPosition::x, UPosition::y, and UPosition::z.
UPcpItem * UResPcp::add | ( | const char * | name, |
UPcpItem::POINT_CLOUD_TYPE | type | ||
) |
Add a new (empty) cloud item
[in] | name | is the name of a new or existing item. Names are unique, |
[in] | type | is type of new cloud |
References UPcpItem::clear(), UPcpItem::getCloudType(), UPcpItem::getPointsCnt(), ULock::lock(), UPcpItem::makeCloud(), UPcpItem::setAsPolyline(), UPcpItem::setName(), UPcpItem::setUpdated(), ULock::unlock(), and UPcpItem::UPcpItem().
bool UResPcp::codePcpXml | ( | const char * | tagName, |
char * | buf, | ||
const int | bufCnt, | ||
int | idx | ||
) |
code all pcpgons to an XML message into this buffer
tagName | is the name to the tag, in wich the pcpgons are to be listed. |
buff | is the buffer, where to write the code. |
buffCnt | is the size of the buffer |
updatedSince | only items updated later than this is XML packed |
tagName | is the name to the tag, in wich the pcpgons are to be listed. |
buff | is the buffer, where to write the code. |
buffCnt | is the size of the buffer |
updatedSince | only items updated later than this is XML packed |
idx | is index to the pcpgon to code. |
References buf, and UPcpItem::codeXML().
Referenced by getPolysCnt(), and UFuncPcp::handleCommand().
|
inlinevirtual |
Function, that shall return a string with all handled XML tags, i.e. should return "gmk gmk2d guidemark", if incoming XML tags starting with any of these three keywords are handled by this function
Reimplemented from UClientFuncBase.
References createResources(), getItem(), getItemXYZ(), handleNewData(), methodCall(), methodCallV(), UClientFuncBase::name(), and print().
|
inline |
make a new cloud (XYZRGB) for this source
source | is the source cloud to copy |
name | is the name of the new item. The name must be unique, |
References add(), UPcpItem::copy(), getItem(), and UPcpItem::PointXyz.
UPcpItem* UResPcp::copy | ( | pcl::PointCloud< pcl::PointXYZRGB > * | source, |
const char * | name | ||
) |
make a new cloud (XYZRGB) for this source
source | is the source cloud to copy |
name | is the name of the new item. The name must be unique, |
|
protected |
Make the variables that will be available to other plugins
Referenced by savePCD().
|
virtual |
Create any resources that this modules needs This method is called after the resource is registred by the server.
Reimplemented from UResBase.
Referenced by commandList().
bool UResPcp::del | ( | const char * | name | ) |
Delete a pcp, that is, set vertex count to 0 This marks that the pcpgon is empty and the pcpgon slot may be reused.
name | is the name of the pcp |
References UPcpItem::clear(), ULock::lock(), and ULock::unlock().
Referenced by getItem(), and UFuncPcp::handleCommand().
UPcpItem * UResPcp::getItem | ( | const char * | name | ) |
Get pcp item pointer
name | is the name of the pcp |
Referenced by commandList(), copy(), UFuncPcp::handleCommand(), and savePCD().
|
inline |
get an item by index, NB no range check
idx | the index to the items available, should be in the range 0..getPolysCnt()-1. |
UPcpItem * UResPcp::getItemXYZ | ( | const char * | name | ) |
Get pcp item pointer
name | is the name of the pcp |
References UPcpItem::add(), UPcpItem::makeCloud(), UPcpItem::PointXyz, and UPcpItem::setName().
Referenced by commandList().
const char * UResPcp::getList | ( | const char * | preStr, |
char * | buff, | ||
const int | buffCnt | ||
) |
Get list of current pcps
preStr | is a short string, that is added at the start of the buffer. |
buff | is the buffer, where to write the list. |
buffCnt | is the size of the buffer |
Referenced by getPolysCnt(), and UFuncPcp::handleCommand().
UPcpItem * UResPcp::getNext | ( | int | p1, |
int * | p2, | ||
const char * | name | ||
) |
Get pcp item pointer starting at index 'p1'
p1 | is the first pcpgon to search for the next name that matches 'name' |
p2 | is set (if not NULL) to the next pcpgon after the found |
name | is the name of the pcp |
References UPcpItem::isA(), and UPcpItem::match().
Referenced by getItem().
|
inline |
Get number of current pcp processes
References buf, codePcpXml(), getList(), gotNewData(), and pcpsCnt.
Referenced by UFuncPcp::handleCommand().
void UResPcp::gotNewData | ( | ) |
Tell a display plugin that new data exist - for a potential redraw.
Referenced by getPolysCnt(), and UFuncPcp::handleCommand().
|
virtual |
Got fresh data from a stream destined to this function. that is, the received XML tag is in the commandList() for this resource.
Reimplemented from UClientFuncBase.
References UPcpItem::add(), UPcpItem::clear(), UPcpItem::cloudType, UPcpItem::cooSys, USmlTagIn::getAttBool(), USmlTagIn::getAttInteger(), USmlTagIn::getAttTime(), USmlTagIn::getAttValue(), USmlTagIn::getNextAttribute(), USmlTag::getNextTag(), USmlTagIn::getTagName(), USmlTagIn::isAStartTag(), USmlTagIn::isTagA(), USmlTagIn::isTagAnEnd(), URotation::Kappa, ULock::lock(), UPcpItem::makeCloud(), MAX_SML_NAME_LENGTH, UPcpItem::MNL, UPcpItem::name, UTime::now(), URotation::Omega, URotation::Phi, UPcpItem::PointXyz, UPcpItem::PointXyzRgb, UPcpItem::relPose, UPcpItem::relPoseUse, UPcpItem::sensorTime, USmlTag::skipToEndTag(), ULock::unlock(), UPcpItem::updateTime, UPosition::x, UPcpItem::xyz, UPcpItem::xyzrgb, UPosition::y, and UPosition::z.
Referenced by commandList().
|
virtual |
The varPool has methods, and a call to one of these is needed. Do the call now and return (a double sized) result in 'value' and return true if the method call is allowed. If the returnStruct and returnStructCnt is not NULL, then a number (no more than initial value of returnStructCnt) of structures based on UDataBase may be returned into returnStruct array of pointers. The returnStructCnt should be modified to the actual number of used pointers (if needed). If the call is allowed, but the result is invalid for some reason, the return value 'value' can be set to som agreed value, (e.g. 0.0 (false) and 1.0 for true).
Reimplemented from UResVarPool.
References UPcpItem::add(), UPosition::clear(), UPcpItem::getPoint(), UPcpItem::getPointsCnt(), UPcpItem::isA(), roundi(), and UVariable::set3D().
Referenced by commandList().
|
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 UPcpItem::add(), UPosition::clear(), UPcpItem::cooSys, UPcpItem::copy(), UVariable::get3D(), UVariable::getInt(), UPcpItem::getPoint(), UPcpItem::getPointsCnt(), UPcpItem::isA(), UDataBase::isAlsoA(), UPcpItem::makeCloud(), UPcpItem::PointXyz, UPcpItem::PointXyzRgb, UPcpItem::remove(), roundi(), UVariable::set3D(), UPcpItem::setAsPolygon(), UPcpItem::setAsPolyline(), UVariable::setBool(), UPcpItem::setUpdated(), UPosition::x, UPosition::y, and UPosition::z.
Referenced by commandList().
|
virtual |
|
inline |
Save a cloud to a pcd-file
References createBaseVar(), getItem(), and UPcpItem::savePCD().
Referenced by UFuncPcp::handleCommand().
void UResPcp::UResPcpInit | ( | ) |
Initialize resource
Referenced by UResPcp().
|
staticprotected |
maximum number of pcps
|
protected |
array of pcp handles
Referenced by getItem().
|
protected |
Number of pcps allocated.
Referenced by getPolysCnt().
|
protected |
inform a potential display plugin, that new data is available
|
protected |
number of established pcp items
|
protected |
last update time for pcpgons
bool UResPcp::verbose |
Is the resource to output verbose message to console
Referenced by UFuncPcp::handleCommand().