AURobotServers  4
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
UFakeDevice Class Reference

#include <ufakedevice.h>

Inheritance diagram for UFakeDevice:
Inheritance graph

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)
 
UServerPushImplementgetImplementor ()
 
int getPushCmdCnt (int *cmdCnt, int *callCnt)
 
UServerPushQueuegetPushQueue ()
 
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)
 

Protected Attributes

int fakeMode
 
bool open
 
UVariablevarAddToPoly
 add fakw world to polygon plugin More...
 
UVariablevarAddToPose
 add fakw world to polygon plugin More...
 
UVariablevarFakeDt
 fake timing More...
 
UVariablevarPoseErr
 pose error value More...
 
UVariablevarRsd
 link to range SD value More...
 
- Protected Attributes inherited from ULaserDevice
double angleResolution
 
ULogFile datalog
 
int datalogSeq
 
bool datalogUsedScans
 
int deviceNum
 
char devName [MAX_DEVICE_NAME_LNG]
 
UTime lastScanTime
 
int loopCnt
 
double maxValidRange
 
bool mirrorData
 
int modeAngleScan
 
char name [MAX_NAME_LNG]
 
ULaserDatapushData
 
bool replayOrFake
 
bool sendNewData
 
char sendStr [MAX_SEND_MSG_LNG]
 
int sendStrCnt
 
unsigned long serial
 
unsigned int statBadCnt
 
unsigned int statGoodCnt
 
double statMsgRate
 
pthread_t threadHandle
 
bool threadRunning
 
bool threadStop
 
struct {
   UVariable *   framerate
 
   UVariable *   logData
 
   UVariable *   logDataInterval
 
   UVariable *   logSource
 
   UVariable *   maxRange
 
   UVariable *   name
 
   UVariable *   open
 
   UVariable *   pose
 
   UVariable *   scanDelay
 
   UVariable *   scanres
 
   UVariable *   scanwidth
 
   UVariable *   serial
 
   UVariable *   type
 
   UVariable *   versionInfo
 
var
 
UVarPoolvars
 
bool verbose
 

Detailed Description

Device to deliver some simple fake scandata for test without real scanner or simulator.

    @author Christian Andersen <jca@oersted.dtu.dk>

Constructor & Destructor Documentation

UFakeDevice::UFakeDevice ( )
UFakeDevice::~UFakeDevice ( )

Destructor

Member Function Documentation

bool UFakeDevice::changeMode ( int  scanangle,
double  resolution 
)
virtual

Change scanner resolution mode. Returns true if new resolution is set

Reimplemented from ULaserDevice.

References ULaserDevice::angleResolution, and ULaserDevice::modeAngleScan.

void UFakeDevice::closePort ( )
protectedvirtual

Close serial port

Reimplemented from ULaserDevice.

References open.

Referenced by isFake().

void UFakeDevice::createBaseVars ( )
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().

bool UFakeDevice::getNewestData ( ULaserData dest,
unsigned long  lastSerial,
int  fake 
)
virtual

Get fake data to this destination and advance fake position if scan number is used before, otherwise maintain position

Parameters
destis where to load the scan.
lastSerialis last used serial number - set next number in scan
intfake is fake number - 0 is live
doublefakeDt 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().

virtual bool UFakeDevice::isFake ( )
inlinevirtual

Is laserscanner a fake scanner

References closePort(), createBaseVars(), maxRange(), open, openPort(), print(), and setDeviceName().

virtual bool UFakeDevice::isPortOpen ( )
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().

bool UFakeDevice::openPort ( )
protectedvirtual

Open serial post. Return true if open(ed)

Reimplemented from ULaserDevice.

References fakeMap, open, and UFakeMap::reset().

Referenced by getNewestData(), and isFake().

const char * UFakeDevice::print ( const char *  preString,
char *  buff,
int  buffCnt 
)
virtual
void UFakeDevice::setDeviceName ( const char *  device)
virtual

Member Data Documentation

int UFakeDevice::fakeMode
protected

Default fake pattern

Referenced by getNewestData(), and setDeviceName().

bool UFakeDevice::open
protected

Is connection open - used to reset coordinates

Referenced by closePort(), isFake(), openPort(), and UFakeDevice().

UVariable* UFakeDevice::varAddToPoly
protected

add fakw world to polygon plugin

Referenced by createBaseVars(), and getNewestData().

UVariable* UFakeDevice::varAddToPose
protected

add fakw world to polygon plugin

Referenced by createBaseVars(), and getNewestData().

UVariable* UFakeDevice::varFakeDt
protected

fake timing

Referenced by createBaseVars(), and getNewestData().

UVariable* UFakeDevice::varPoseErr
protected

pose error value

Referenced by createBaseVars(), and getNewestData().

UVariable* UFakeDevice::varRsd
protected

link to range SD value

Referenced by createBaseVars(), and getNewestData().


The documentation for this class was generated from the following files: