Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS > Class Template Referenceabstract

Provides an abstract parent for all Sick LIDAR devices. More...

#include <SickLIDAR.hh>

Public Member Functions

bool IsInitialized ()
 
 SickLIDAR ()
 Initializes the buffer monitor. More...
 
virtual ~SickLIDAR ()
 Destructor tears down buffer monitor. More...
 

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. More...
 
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. More...
 
void _sendMessage (const SICK_MSG_CLASS &sick_message, const unsigned int byte_interval) const throw ( SickIOException )
 Sends a message to the Sick device. More...
 
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. More...
 
void _setNonBlockingIO () const throw ( SickIOException )
 A simple method for setting non-blocking I/O. More...
 
virtual void _setupConnection ()=0
 
void _startListening () throw ( SickThreadException )
 Activates the buffer monitor for the driver. More...
 
void _stopListening () throw ( SickThreadException )
 Activates the buffer monitor for the driver. More...
 
virtual void _teardownConnection ()=0
 

Protected Attributes

SICK_MONITOR_CLASS * _sick_buffer_monitor
 
int _sick_fd
 
bool _sick_initialized
 
bool _sick_monitor_running
 

Detailed Description

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
class SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >

Provides an abstract parent for all Sick LIDAR devices.

Definition at line 53 of file SickLIDAR.hh.

Constructor & Destructor Documentation

template<class SICK_MONITOR_CLASS , class SICK_MSG_CLASS >
SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::SickLIDAR ( )

Initializes the buffer monitor.

The primary constructor

Definition at line 132 of file SickLIDAR.hh.

template<class SICK_MONITOR_CLASS , class SICK_MSG_CLASS >
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.

Member Function Documentation

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
double SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_computeElapsedTime ( const struct timeval &  beg_time,
const struct timeval &  end_time 
) const
inlineprotected

An inline function for computing elapsed time

Definition at line 115 of file SickLIDAR.hh.

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
bool SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_monitorRunning ( ) const
inlineprotected

Indicates whether there is a monitor currently running

Definition at line 93 of file SickLIDAR.hh.

template<class SICK_MONITOR_CLASS , class SICK_MSG_CLASS>
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

Parameters
&sick_messageA reference to the container that will hold the most recent message
timeout_valueThe time in secs to wait before throwing a timeout error
Returns
True if a new message was received, False otherwise

Definition at line 301 of file SickLIDAR.hh.

template<class SICK_MONITOR_CLASS , class SICK_MSG_CLASS>
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

Parameters
&sick_messageA reference to the container that will hold the most recent message
*byte_sequenceThe byte sequence that is expected to lead off the payload in the packet (e.g. service codes, etc...)
byte_sequence_lengthThe number of bytes in the given byte_sequence
timeout_valueThe time in usecs to wait before throwing a timeout error
Returns
True if a new message was received, False otherwise

NOTE: This method is intended to be a helper for _sendMessageAndGetReply

Definition at line 337 of file SickLIDAR.hh.

template<class SICK_MONITOR_CLASS , class SICK_MSG_CLASS>
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)

Parameters
&sick_messageA reference to the well-formed message that is to be sent to the Sick
byte_intervalMinimum time in microseconds between transmitted bytes

Definition at line 258 of file SickLIDAR.hh.

template<class SICK_MONITOR_CLASS , class SICK_MSG_CLASS>
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
)
protectedvirtual

Sends a request to the Sick and acquires looks for the reply

Parameters
sick_send_frameA sick frame to be sent to the LMS
sick_receive_frameA sick frame to hold the response (expected or unexpected) of the LMS
num_triesThe number of times to send the frame in the event the LMS fails to reply
timeoutThe epoch to wait before considering a sent frame lost
Returns
True if the message was sent and the expected reply was received

Definition at line 396 of file SickLIDAR.hh.

template<class SICK_MONITOR_CLASS , class SICK_MSG_CLASS >
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.

template<class SICK_MONITOR_CLASS , class SICK_MSG_CLASS >
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.

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
virtual void SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_setupConnection ( )
protectedpure virtual

A method for setting up a general connection

Implemented in SickToolbox::SickLMS2xx, SickToolbox::SickLD, and SickToolbox::SickLMS1xx.

template<class SICK_MONITOR_CLASS , class SICK_MSG_CLASS >
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.

template<class SICK_MONITOR_CLASS , class SICK_MSG_CLASS >
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.

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
virtual void SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_teardownConnection ( )
protectedpure virtual

A method for tearing down a connection to the Sick

Implemented in SickToolbox::SickLMS2xx, SickToolbox::SickLD, and SickToolbox::SickLMS1xx.

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
bool SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::IsInitialized ( )
inline

Indicates whether device is initialized

Definition at line 61 of file SickLIDAR.hh.

Member Data Documentation

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
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.

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
int SickToolbox::SickLIDAR< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_sick_fd
protected

Sick device file descriptor

Definition at line 69 of file SickLIDAR.hh.

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
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.

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
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.


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


sicktoolbox
Author(s): Jason Derenick , Thomas Miller
autogenerated on Tue Sep 10 2019 03:37:34