#include <URG04LX.h>
Public Member Functions | |
URG04LXCommand () | |
defalut constructor | |
~URG04LXCommand () | |
destructor | |
string | getObjectName () const |
Gets the name for debugging purposes. | |
void | setDevice (const char *device) |
change device path, FILE*, file descriptor | |
int | writeCmd (char *s) |
send a command contained in an appropriate ExtString | |
int | readCmd (char *s) |
receive the answer of the sensor to a command | |
ExtString | int2string (int bytes, int value) |
converts an int into a strig made of a fixed number of characters | |
bool | checkEcho (ExtString command, ExtString response) |
verifies that the echo of the responses is equal to the commad sent to URG | |
bool | checkStatus (ExtString command, ExtString response) |
compare the STATUS camp of the response with status param | |
void | changeProtocol () |
changes protocol to SCIP2.0 | |
void | on () |
turn on laser for scanning | |
void | off () |
turn off laser for scanning | |
void | reset () |
reset sensor switching off laser and resetting all parameters to default values | |
Time | timeMatch (ExtString testString) |
useful to match host and sensor time and to evaluate avg data TX time | |
bool | localFSM (char *_command, ExtString &_output) |
implements a FSM locally called for I/O opeations | |
void | setSCIP2 () |
set _SCIP2 flag | |
void | unsetSCIP2 () |
unset _SCIP2 flag | |
void | setFirstBlock () |
set _isReceiving flag | |
void | setVerboseOn () |
set _verboseOn flag | |
void | setLog () |
set _log flag | |
void | setfdBad () |
set _fdBad flag | |
void | unsetFirstBlock () |
unset _isReceiving flag | |
void | setIsFinished () |
set _isFinished flag | |
void | unsetIsFinished () |
unset _isFinished flag | |
void | unsetVerboseOn () |
unset _verboseOn flag | |
void | unsetLog () |
unset _log flag | |
void | unsetfdBad () |
unset _fdBad flag | |
const char * | device () |
get device path | |
FILE * | laserPort () |
get FILE* of device | |
int | fd () |
get file descriptor of device | |
bool | SCIP2 () |
get _SCIP2 flag | |
bool | firstBlock () |
get _isReceiving flag | |
bool | isFinished () |
get _isFinished flag | |
bool | verboseOn () |
return _verboseOn flag | |
bool | log () |
return _log flag | |
bool | fdBad () |
return _fdBad flag |
Contains those methods that perform (or are usueful to perform) communication with real sensor. Communication is actually realized by localFSM. There are also some get and set functions for private attributes Scan operations are not implemented here.
MipResources::URG04LXCommand::URG04LXCommand | ( | ) | [inline] |
defalut constructor
MipResources::URG04LXCommand::~URG04LXCommand | ( | ) | [inline] |
destructor
string MipResources::URG04LXCommand::getObjectName | ( | ) | const [inline, virtual] |
void MipResources::URG04LXCommand::setDevice | ( | const char * | device | ) | [inline] |
change device path, FILE*, file descriptor
device | new device path |
int MipResources::URG04LXCommand::writeCmd | ( | char * | s | ) |
int MipResources::URG04LXCommand::readCmd | ( | char * | s | ) |
receive the answer of the sensor to a command
s | pointer to the first character of the ExtString containing the answer of the sensor |
ExtString MipResources::URG04LXCommand::int2string | ( | int | bytes, | |
int | value | |||
) |
converts an int into a strig made of a fixed number of characters
bytes | number of characters of the string | |
value | int value to convert |
verifies that the echo of the responses is equal to the commad sent to URG
command | command sent | |
response | response received |
compare the STATUS camp of the response with status param
command | command sent | |
response | response received |
void MipResources::URG04LXCommand::changeProtocol | ( | ) |
changes protocol to SCIP2.0
void MipResources::URG04LXCommand::on | ( | ) |
turn on laser for scanning
void MipResources::URG04LXCommand::off | ( | ) |
turn off laser for scanning
void MipResources::URG04LXCommand::reset | ( | void | ) |
reset sensor switching off laser and resetting all parameters to default values
useful to match host and sensor time and to evaluate avg data TX time
testString | parameter for avg data TX time evaluation |
bool MipResources::URG04LXCommand::localFSM | ( | char * | _command, | |
ExtString & | _output | |||
) |
implements a FSM locally called for I/O opeations
_command | command to send | |
_output | response received |
void MipResources::URG04LXCommand::setSCIP2 | ( | ) | [inline] |
set _SCIP2 flag
void MipResources::URG04LXCommand::unsetSCIP2 | ( | ) | [inline] |
unset _SCIP2 flag
void MipResources::URG04LXCommand::setFirstBlock | ( | ) | [inline] |
set _isReceiving flag
void MipResources::URG04LXCommand::setVerboseOn | ( | ) | [inline] |
set _verboseOn flag
void MipResources::URG04LXCommand::setLog | ( | ) | [inline] |
set _log flag
void MipResources::URG04LXCommand::setfdBad | ( | ) | [inline] |
set _fdBad flag
void MipResources::URG04LXCommand::unsetFirstBlock | ( | ) | [inline] |
unset _isReceiving flag
void MipResources::URG04LXCommand::setIsFinished | ( | ) | [inline] |
set _isFinished flag
void MipResources::URG04LXCommand::unsetIsFinished | ( | ) | [inline] |
unset _isFinished flag
void MipResources::URG04LXCommand::unsetVerboseOn | ( | ) | [inline] |
unset _verboseOn flag
void MipResources::URG04LXCommand::unsetLog | ( | ) | [inline] |
unset _log flag
void MipResources::URG04LXCommand::unsetfdBad | ( | ) | [inline] |
unset _fdBad flag
const char* MipResources::URG04LXCommand::device | ( | ) | [inline] |
get device path
FILE* MipResources::URG04LXCommand::laserPort | ( | ) | [inline] |
get FILE* of device
int MipResources::URG04LXCommand::fd | ( | ) | [inline] |
get file descriptor of device
bool MipResources::URG04LXCommand::SCIP2 | ( | ) | [inline] |
get _SCIP2 flag
bool MipResources::URG04LXCommand::firstBlock | ( | ) | [inline] |
get _isReceiving flag
bool MipResources::URG04LXCommand::isFinished | ( | ) | [inline] |
get _isFinished flag
bool MipResources::URG04LXCommand::verboseOn | ( | ) | [inline] |
return _verboseOn flag
bool MipResources::URG04LXCommand::log | ( | ) | [inline] |
return _log flag
bool MipResources::URG04LXCommand::fdBad | ( | ) | [inline] |
return _fdBad flag