AURobotServers
4
|
#include <ureplaydevice.h>
Public Member Functions | |
virtual bool | getNewestData (ULaserData *dest, unsigned long lastSerial, int fake) |
bool | getReplayFileExist () |
char * | getReplayFileName (char *fn, const int fnCnt) |
int | getReplayLogLine () |
UTime | getReplayTimeNext () |
UTime | getReplayTimeNow () |
virtual bool | isPortOpen () |
virtual bool | isReplay () |
virtual bool | isReplayDevice () |
bool | isReplayFileOpen () |
double | maxRange () |
bool | replayStep (int steps, UResBase *lasPool) |
bool | replayStepToScan (unsigned int toSerial, UResBase *lasPool) |
bool | replayToTime (UTime untilTime) |
bool | setReplay (bool value) |
UReplayDevice () | |
~UReplayDevice () | |
Public Member Functions inherited from ULaserDevice | |
virtual void | callGotNewDataWithObject () |
virtual bool | changeMode (int scanangle, double resolution) |
virtual void | createBaseVars () |
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 () |
bool | isRunning () |
bool | isSend () |
virtual bool | isVerbose () |
void | logFileClose () |
bool | logFileOpen () |
void | logThisScan (ULaserData *scan) |
void | openRequest (bool toOpen) |
void | print (char *preString) |
virtual const char * | print (const char *preString, char *buff, int buffCnt) |
void | send (char *msg) |
virtual void | setCore (UCmdExe *pCore) |
virtual void | setDeviceName (const char *device) |
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 () |
Static Protected Attributes | |
static const int | MAX_LOG_LINE_LENGTH = 10000 |
Private Member Functions | |
bool | replayStep () |
Additional Inherited Members | |
Protected Member Functions inherited from ULaserDevice | |
virtual void | closePort () |
virtual double | getDefaultDelay () |
void | getFakeScan (ULaserData *dest, unsigned long lastSerial, int fake, double fakeDt=0.2) |
virtual bool | openPort () |
virtual bool | receiveData () |
virtual bool | sendToDevice (const char *msg, int lng) |
void | updateScanData (UTime scanTime) |
Laser scanner device that gets the data from a logfile
@author Christian Andersen <jca@oersted.dtu.dk>
UReplayDevice::UReplayDevice | ( | ) |
Constructor
References ULaserDevice::devName, MAX_DEVICE_NAME_LNG, MAX_NAME_LNG, ULaserDevice::maxValidRange, ULaserDevice::name, replay, replayFile, replayLine, replayLogLine, and ULaserDevice::replayOrFake.
UReplayDevice::~UReplayDevice | ( | ) |
destructor
|
virtual |
Get the newest data unpacked to this structure. Returns true if valid.
Reimplemented from ULaserDevice.
References ULaserData::copy(), ULaserDevice::getFakeScan(), ULaserData::getSerial(), ULock::lock(), scan, ULaserData::setValid(), and ULock::unlock().
Referenced by isPortOpen().
bool UReplayDevice::getReplayFileExist | ( | ) |
Test if replay file with current specifications exist (and read is allowed)
References getReplayFileName().
Referenced by getReplayLogLine(), and UFunctionLaser::handleSetCommand().
char * UReplayDevice::getReplayFileName | ( | char * | fn, |
const int | fnCnt | ||
) |
Get the full replay logfile name. Returns pointer fn[] string.
References ULaserDevice::devName, and replayPath.
Referenced by getReplayFileExist(), getReplayLogLine(), UFunctionLaser::handleSetCommand(), and setReplay().
|
inline |
Get current line number in replay logfile
References getReplayFileExist(), getReplayFileName(), replayLogLine, replayStep(), replayStepToScan(), and replayToTime().
Referenced by UFunctionLaser::handleSetCommand().
|
inline |
Get replat time next
References replayTimeNext.
Referenced by UFunctionLaser::handleSetCommand(), and replayStep().
|
inline |
Set replay subdir. Sets the value to the subdir buffer, but nothing else is changed. Get pointer to replay subdir Get replat time now
References replayTimeNow.
Referenced by UFunctionLaser::handleSetCommand().
|
inlinevirtual |
Change scanner resolution mode. Returns true if new resolution is set Is the port to the device open
Reimplemented from ULaserDevice.
References getNewestData().
|
inlinevirtual |
Get replay flag
References replay.
|
inlinevirtual |
Is laserscanner a replay device scanner
Reimplemented from ULaserDevice.
References maxRange(), and setReplay().
Referenced by UFunctionLaser::handleSetCommand().
|
inline |
double UReplayDevice::maxRange | ( | ) |
Print device status to a buffer string Device name determines max range for device. Decode the range from the name.
Referenced by isReplayDevice().
bool UReplayDevice::replayStep | ( | int | steps, |
UResBase * | lasPool | ||
) |
Replay N singles from the logfile.
steps | number of steps to advance |
lasPool | is pointer to laser pool - to notify other replay partners. true if N steps were available in replay file. |
References UReplay::replayAdvanceTime(), replayStep(), and replayTimeNow.
Referenced by UFunctionLaser::handleSetCommand().
|
private |
Replay a single step from the logfile. true if step is performed (not EOF).
References absf(), ULaserData::addMeasurements(), ULaserDevice::angleResolution, ULaserDevice::getDeviceNum(), ULaserData::getFlags(), getReplayTimeNext(), ULaserDevice::gotNewScan(), UPose::h, ULock::lock(), MAX_LOG_LINE_LENGTH, ULaserDevice::maxValidRange, ULaserDevice::mirrorData, ULaserDevice::modeAngleScan, ULaserDevice::pose, replay, replayFile, replayLine, replayLogLine, replayTimeNext, replayTimeNow, roundi(), scan, ULaserDevice::serial, ULaserData::setAngleResAndStart(), ULaserData::setDeviceNum(), ULaserData::setMaxValidRange(), ULaserData::setMeasurement(), ULaserData::setRangeCnt(), setReplay(), ULaserData::setScanTime(), ULaserData::setSerial(), UTime::setTimeTod(), ULaserData::setUnit(), ULaserData::setValid(), UPoseTime::t, ULock::unlock(), UTime::valid, ULaserDevice::var, UPose::x, and UPose::y.
Referenced by getReplayLogLine(), replayStep(), replayStepToScan(), and replayToTime().
bool UReplayDevice::replayStepToScan | ( | unsigned int | toSerial, |
UResBase * | lasPool | ||
) |
Advance replay to this scannumber
toSerial | is the scan serial to advance to |
lasPool | is pointer to laser pool - to notify other replay partners. true if scan is found. |
References ULaserData::getSerial(), UReplay::replayAdvanceTime(), replayStep(), replayTimeNow, and scan.
Referenced by getReplayLogLine(), and UFunctionLaser::handleSetCommand().
bool UReplayDevice::replayToTime | ( | UTime | untilTime | ) |
Replay until just before this time
References replayStep(), and replayTimeNext.
Referenced by getReplayLogLine(), and ULaserPool::replayToTime().
bool UReplayDevice::setReplay | ( | bool | value | ) |
Set replay flag. If replay flag is changed to true, the logfile (odo.log) is attempted opened. If successfull, the current pose history is cleared and the first record read and implemented. If not successfull, the replay flag is set to true, and the pose history is cleared only. Returns true if replay file is opened
References getReplayFileName(), MAX_LOG_LINE_LENGTH, replay, replayFile, replayLine, replayLogLine, replayTimeNext, UTime::setTimeTod(), and UTime::valid.
Referenced by UFunctionLaser::handleSetCommand(), isReplayDevice(), and replayStep().
|
staticprotected |
Maximum length of a line in the logfile
Referenced by replayStep(), and setReplay().
|
protected |
Replay flag - source of info for pose history a change in this flag clears the current pose history.
Referenced by isReplay(), replayStep(), setReplay(), and UReplayDevice().
|
protected |
Replay file handle
Referenced by isReplayFileOpen(), replayStep(), setReplay(), and UReplayDevice().
|
protected |
Buffer for latest line (but not used) line from logfile
Referenced by replayStep(), setReplay(), and UReplayDevice().
|
protected |
Current line number in logfile
Referenced by getReplayLogLine(), replayStep(), setReplay(), and UReplayDevice().
|
protected |
Replay time of next data from in logfile (line buffer)
Referenced by getReplayTimeNext(), replayStep(), replayToTime(), and setReplay().
|
protected |
Replay time of last used data from logfile
Referenced by getReplayTimeNow(), replayStep(), and replayStepToScan().
|
protected |
Buffer for laser data
Referenced by getNewestData(), replayStep(), and replayStepToScan().