AURobotServers
4
|
#include <ufakedevice.h>
Public Member Functions | |
virtual bool | changeMode (int scanangle, double resolution) |
virtual void | createBaseVars () |
virtual bool | getNewestData (ULaserData *dest, unsigned long lastSerial, int fake) |
virtual bool | isFake () |
virtual bool | isPortOpen () |
double | maxRange () |
virtual const char * | print (const char *preString, char *buff, int buffCnt) |
virtual void | setDeviceName (const char *device) |
UFakeDevice () | |
~UFakeDevice () | |
Public Member Functions inherited from ULaserDevice | |
virtual void | callGotNewDataWithObject () |
unsigned int | getBad () |
char * | getDeviceName () |
int | getDeviceNum () |
UPosition | getDevicePos () |
UPosRot | getDevicePose () |
URotation | getDeviceRot () |
unsigned int | getGood () |
char * | getLogFileName (char *buffer, int bufferCnt) |
int | getLogInterval () |
bool | getLogUsedScans () |
int | getMaxMeasurements () |
bool | getMirror () |
double | getMsgRate () |
char * | getName () |
virtual const char * | getNameFromDevice () |
int | getScanAngle () |
double | getScanAngle (int measurement) |
double | getScanResolution () |
unsigned long | getSerial () |
void | gotNewScan (ULaserData *gotData) |
virtual bool | isLogFileOpen () |
virtual bool | isReplayDevice () |
bool | isRunning () |
bool | isSend () |
virtual bool | isVerbose () |
void | logFileClose () |
bool | logFileOpen () |
void | logThisScan (ULaserData *scan) |
void | openRequest (bool toOpen) |
void | print (char *preString) |
void | send (char *msg) |
virtual void | setCore (UCmdExe *pCore) |
void | setDeviceNum (int value) |
void | setDevicePose (UPosRot *newPose) |
void | setLogInterval (int value) |
void | setLogUsedScans (bool value) |
void | setMirror (bool value) |
void | setVarStructure (UVarPool *varStruct) |
void | setVerbose (bool value) |
bool | start () |
void | stop (bool justClosePort) |
void | threadRunLoop () |
ULaserDevice () | |
virtual | ~ULaserDevice () |
Public Member Functions inherited from UServerPush | |
int | addPushCommand (UServerInMsg *msg) |
bool | doPushCall (UServerPushElement *pe, const char *value) |
void | flushClientCmds (int clientIdx) |
UServerPushImplement * | getImplementor () |
int | getPushCmdCnt (int *cmdCnt, int *callCnt) |
UServerPushQueue * | getPushQueue () |
bool | gotCmdExe () |
void | gotNewData (void *pData) |
bool | isUpdated (int lastCnt, int *newCnt) |
bool | needNewData () |
void | print (const char *preString) |
void | print (const char *preString, char *buff, int buffCnt) |
void | servicePendingPushCmds () |
void | setCmdExe (UServerPushImplement *executor) |
void | setImplementor (UServerPushImplement *executor) |
bool | setResource (UResBase *resource, bool remove) |
bool | setUpdated (const char *value) |
Add watch object if needed. An image or other object is updated. set object as updated, with an extra qualifier, that may be used as a parameter in a push call. this push list is then added to the to the push list examined by the server thread. when server thread reach this push list it will call to get a possible associated data structure by a call to needNewData() whish is expected to call gotNewData(void * data_structure) - but now in the server thread. More... | |
UServerPush () | |
virtual | ~UServerPush () |
Public Member Functions inherited from ULock | |
bool | lock () |
void | lockInit () |
void | post () |
bool | tryLock () |
bool | tryWait () |
ULock () | |
void | unlock () |
bool | wait () |
~ULock () | |
Protected Member Functions | |
virtual void | closePort () |
virtual bool | openPort () |
Protected Member Functions inherited from ULaserDevice | |
virtual double | getDefaultDelay () |
void | getFakeScan (ULaserData *dest, unsigned long lastSerial, int fake, double fakeDt=0.2) |
virtual bool | receiveData () |
virtual bool | sendToDevice (const char *msg, int lng) |
void | updateScanData (UTime scanTime) |
Device to deliver some simple fake scandata for test without real scanner or simulator.
@author Christian Andersen <jca@oersted.dtu.dk>
UFakeDevice::UFakeDevice | ( | ) |
Constructor
References ULaserDevice::angleResolution, MAX_NAME_LNG, maxRange(), ULaserDevice::maxValidRange, ULaserDevice::modeAngleScan, ULaserDevice::name, open, ULaserDevice::replayOrFake, and setDeviceName().
UFakeDevice::~UFakeDevice | ( | ) |
Destructor
|
virtual |
Change scanner resolution mode. Returns true if new resolution is set
Reimplemented from ULaserDevice.
References ULaserDevice::angleResolution, and ULaserDevice::modeAngleScan.
|
protectedvirtual |
|
virtual |
Create entry infor the globas variable database for this device
Reimplemented from ULaserDevice.
References UVarPool::addVar(), UVarPool::addVarA(), ULaserDevice::createBaseVars(), varAddToPoly, varAddToPose, varFakeDt, varPoseErr, varRsd, and ULaserDevice::vars.
Referenced by isFake().
|
virtual |
Get fake data to this destination and advance fake position if scan number is used before, otherwise maintain position
dest | is where to load the scan. |
lastSerial | is last used serial number - set next number in scan |
int | fake is fake number - 0 is live |
double | fakeDt is update time for fake position - default is 0.2 sec |
Reimplemented from ULaserDevice.
References UFakeMap::copyToPoly(), UFakeMap::devicePose, UFakeMap::distError, UFakeMap::distOffset, fakeMap, fakeMode, UVariable::getBool(), ULaserDevice::getDevicePose(), UVariable::getDouble(), ULaserDevice::getFakeScan(), UFakeMap::headError, UFakeMap::headOffset, isPortOpen(), UFakeMap::keepODOpose, UFakeMap::keepUTMpose, maxRange(), ULaserDevice::maxValidRange, openPort(), UFakeMap::rangeError, UVariable::setInt(), varAddToPoly, varAddToPose, varFakeDt, varPoseErr, and varRsd.
Referenced by isPortOpen().
|
inlinevirtual |
Is laserscanner a fake scanner
References closePort(), createBaseVars(), maxRange(), open, openPort(), print(), and setDeviceName().
|
inlinevirtual |
Is the port to the device open
Reimplemented from ULaserDevice.
References getNewestData().
Referenced by getNewestData().
double UFakeDevice::maxRange | ( | ) |
Device name determines max range for device. Decode the range from the name.
References ULaserDevice::maxValidRange.
Referenced by getNewestData(), isFake(), print(), and UFakeDevice().
|
protectedvirtual |
Open serial post. Return true if open(ed)
Reimplemented from ULaserDevice.
References fakeMap, open, and UFakeMap::reset().
Referenced by getNewestData(), and isFake().
|
virtual |
Print device status to a buffer string
Reimplemented from ULaserDevice.
References ULaserDevice::angleResolution, UFakeMap::currentTruePose, ULaserDevice::devName, fakeMap, ULaserDevice::getName(), UPose::h, maxRange(), ULaserDevice::modeAngleScan, UPose::x, and UPose::y.
Referenced by isFake().
|
virtual |
Set device name
Reimplemented from ULaserDevice.
References ULaserDevice::angleResolution, ULaserDevice::devName, fakeMode, ULaserDevice::maxValidRange, ULaserDevice::modeAngleScan, and ULaserDevice::setDeviceName().
Referenced by isFake(), and UFakeDevice().
|
protected |
Default fake pattern
Referenced by getNewestData(), and setDeviceName().
|
protected |
Is connection open - used to reset coordinates
Referenced by closePort(), isFake(), openPort(), and UFakeDevice().
|
protected |
add fakw world to polygon plugin
Referenced by createBaseVars(), and getNewestData().
|
protected |
add fakw world to polygon plugin
Referenced by createBaseVars(), and getNewestData().
|
protected |
fake timing
Referenced by createBaseVars(), and getNewestData().
|
protected |
pose error value
Referenced by createBaseVars(), and getNewestData().
|
protected |
link to range SD value
Referenced by createBaseVars(), and getNewestData().