Provides an abstract parent for all Sick LIDAR devices. More...
#include <SickLIDAR.hh>
Public Member Functions | |
bool | IsInitialized () |
SickLIDAR () | |
Initializes the buffer monitor. | |
virtual | ~SickLIDAR () |
Destructor tears down buffer monitor. | |
Protected Member Functions | |
double | _computeElapsedTime (const struct timeval &beg_time, const struct timeval &end_time) const |
bool | _monitorRunning () const |
void | _recvMessage (SICK_MSG_CLASS &sick_message, const unsigned int timeout_value) const throw ( SickTimeoutException ) |
Attempt to acquire the latest available message from the device. | |
void | _recvMessage (SICK_MSG_CLASS &sick_message, const uint8_t *const byte_sequence, const unsigned int byte_sequence_length, const unsigned int timeout_value) const throw ( SickTimeoutException ) |
Attempt to acquire a message having a payload beginning w/ the given byte sequence. | |
void | _sendMessage (const SICK_MSG_CLASS &sick_message, const unsigned int byte_interval) const throw ( SickIOException ) |
Sends a message to the Sick device. | |
virtual void | _sendMessageAndGetReply (const SICK_MSG_CLASS &send_message, SICK_MSG_CLASS &recv_message, const uint8_t *const byte_sequence, const unsigned int byte_sequence_length, const unsigned int byte_interval, const unsigned int timeout_value, const unsigned int num_tries) throw ( SickTimeoutException, SickIOException) |
void | _setBlockingIO () const throw ( SickIOException ) |
A simple method for setting blocking I/O. | |
void | _setNonBlockingIO () const throw ( SickIOException ) |
A simple method for setting non-blocking I/O. | |
virtual void | _setupConnection ()=0 |
void | _startListening () throw ( SickThreadException ) |
Activates the buffer monitor for the driver. | |
void | _stopListening () throw ( SickThreadException ) |
Activates the buffer monitor for the driver. | |
virtual void | _teardownConnection ()=0 |
Protected Attributes | |
SICK_MONITOR_CLASS * | _sick_buffer_monitor |
int | _sick_fd |
bool | _sick_initialized |
bool | _sick_monitor_running |
Provides an abstract parent for all Sick LIDAR devices.
Definition at line 53 of file SickLIDAR.hh.
SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::SickLIDAR | ( | ) |
Initializes the buffer monitor.
The primary constructor
Definition at line 132 of file SickLIDAR.hh.
SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::~SickLIDAR | ( | ) | [virtual] |
Destructor tears down buffer monitor.
A virtual destructor
Definition at line 149 of file SickLIDAR.hh.
double SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_computeElapsedTime | ( | const struct timeval & | beg_time, |
const struct timeval & | end_time | ||
) | const [inline, protected] |
An inline function for computing elapsed time
Definition at line 115 of file SickLIDAR.hh.
bool SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_monitorRunning | ( | ) | const [inline, protected] |
Indicates whether there is a monitor currently running
Definition at line 93 of file SickLIDAR.hh.
void SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_recvMessage | ( | SICK_MSG_CLASS & | sick_message, |
const unsigned int | timeout_value | ||
) | const throw ( SickTimeoutException ) [protected] |
Attempt to acquire the latest available message from the device.
Acquire the next message from the message container
&sick_message | A reference to the container that will hold the most recent message |
timeout_value | The time in secs to wait before throwing a timeout error |
Definition at line 301 of file SickLIDAR.hh.
void SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_recvMessage | ( | SICK_MSG_CLASS & | sick_message, |
const uint8_t *const | byte_sequence, | ||
const unsigned int | byte_sequence_length, | ||
const unsigned int | timeout_value | ||
) | const throw ( SickTimeoutException ) [protected] |
Attempt to acquire a message having a payload beginning w/ the given byte sequence.
Search the stream for a payload with a particular "header" byte string
&sick_message | A reference to the container that will hold the most recent message |
*byte_sequence | The byte sequence that is expected to lead off the payload in the packet (e.g. service codes, etc...) |
byte_sequence_length | The number of bytes in the given byte_sequence |
timeout_value | The time in usecs to wait before throwing a timeout error |
NOTE: This method is intended to be a helper for _sendMessageAndGetReply
Definition at line 337 of file SickLIDAR.hh.
void SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_sendMessage | ( | const SICK_MSG_CLASS & | sick_message, |
const unsigned int | byte_interval | ||
) | const throw ( SickIOException ) [protected] |
Sends a message to the Sick device.
Send a message to the Sick LD (allows specifying min time between transmitted bytes)
&sick_message | A reference to the well-formed message that is to be sent to the Sick |
byte_interval | Minimum time in microseconds between transmitted bytes |
Definition at line 258 of file SickLIDAR.hh.
void SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_sendMessageAndGetReply | ( | const SICK_MSG_CLASS & | send_message, |
SICK_MSG_CLASS & | recv_message, | ||
const uint8_t *const | byte_sequence, | ||
const unsigned int | byte_sequence_length, | ||
const unsigned int | byte_interval, | ||
const unsigned int | timeout_value, | ||
const unsigned int | num_tries | ||
) | throw ( SickTimeoutException, SickIOException) [protected, virtual] |
Sends a request to the Sick and acquires looks for the reply
sick_send_frame | A sick frame to be sent to the LMS |
sick_receive_frame | A sick frame to hold the response (expected or unexpected) of the LMS |
num_tries | The number of times to send the frame in the event the LMS fails to reply |
timeout | The epoch to wait before considering a sent frame lost |
Definition at line 396 of file SickLIDAR.hh.
void SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_setBlockingIO | ( | ) | const throw ( SickIOException ) [protected] |
A simple method for setting blocking I/O.
Make the associated file descriptor non blocking
Definition at line 218 of file SickLIDAR.hh.
void SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_setNonBlockingIO | ( | ) | const throw ( SickIOException ) [protected] |
A simple method for setting non-blocking I/O.
Make the associated file descriptor non blocking
Definition at line 237 of file SickLIDAR.hh.
virtual void SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_setupConnection | ( | ) | [protected, pure virtual] |
A method for setting up a general connection
Implemented in SickToolbox::SickLMS2xx, SickToolbox::SickLD, and SickToolbox::SickLMS1xx.
void SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_startListening | ( | ) | throw ( SickThreadException ) [protected] |
Activates the buffer monitor for the driver.
Starts the driver listening for messages
Definition at line 162 of file SickLIDAR.hh.
void SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_stopListening | ( | ) | throw ( SickThreadException ) [protected] |
Activates the buffer monitor for the driver.
Stops the driver from listening
Definition at line 190 of file SickLIDAR.hh.
virtual void SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_teardownConnection | ( | ) | [protected, pure virtual] |
A method for tearing down a connection to the Sick
Implemented in SickToolbox::SickLMS2xx, SickToolbox::SickLD, and SickToolbox::SickLMS1xx.
bool SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::IsInitialized | ( | ) | [inline] |
Indicates whether device is initialized
Definition at line 61 of file SickLIDAR.hh.
SICK_MONITOR_CLASS* SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_sick_buffer_monitor [protected] |
A pointer to the driver's buffer monitor
Definition at line 75 of file SickLIDAR.hh.
int SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_sick_fd [protected] |
Sick device file descriptor
Definition at line 69 of file SickLIDAR.hh.
bool SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_sick_initialized [protected] |
A flag to indicated whether the device is properly initialized
Definition at line 72 of file SickLIDAR.hh.
bool SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_sick_monitor_running [protected] |
Indicates whether the Sick buffer monitor is running
Definition at line 78 of file SickLIDAR.hh.