#include <mrpt/hwdrivers/C2DRangeFinderAbstract.h>
Public Member Functions | |
C2DRangeFinderAbstract () | |
Default constructor. | |
virtual | ~C2DRangeFinderAbstract () |
Destructor. | |
void | bindIO (CStream *streamIO) |
Binds the object to a given I/O channel. | |
void | getObservation (bool &outThereIsObservation, mrpt::slam::CObservation2DRangeScan &outObservation, bool &hardwareError) |
Get the last observation from the sensor, if available, and unmarks it as being "the last one" (thus a new scan must arrive or subsequent calls will find no new observations). | |
void | doProcess () |
Main method for a CGenericSensor. | |
virtual void | doProcessSimple (bool &outThereIsObservation, mrpt::slam::CObservation2DRangeScan &outObservation, bool &hardwareError)=0 |
Specific laser scanner "software drivers" must process here new data from the I/O stream, and, if a whole scan has arrived, return it. | |
virtual bool | turnOn ()=0 |
Enables the scanning mode (which may depend on the specific laser device); this must be called before asking for observations to assure that the protocol has been initializated. | |
virtual bool | turnOff ()=0 |
Disables the scanning mode (this can be used to turn the device in low energy mode, if available). | |
Protected Attributes | |
utils::CStream * | m_stream |
The I/O channel (will be NULL if not bound). | |
Private Attributes | |
mrpt::slam::CObservation2DRangeScan | m_lastObservation |
bool | m_lastObservationIsNew |
bool | m_hardwareError |
synch::CCriticalSection | m_csChangeStream |
For being thread-safe. | |
synch::CCriticalSection | m_csLastObservation |
mrpt::slam::CObservation2DRangeScanPtr | m_nextObservation |
A dynamic object used as buffer in doProcess. |
Physical devices may be interfaced through a serial port, a USB connection,etc. but this class abstract those details throught the "binding" of the specific scanner driver to a given I/O channel, which must be set by calling "hwdrivers::C2DRangeFinderAbstract::bindIO". See also the derived classes.
Definition at line 53 of file C2DRangeFinderAbstract.h.
mrpt::hwdrivers::C2DRangeFinderAbstract::C2DRangeFinderAbstract | ( | ) |
Default constructor.
virtual mrpt::hwdrivers::C2DRangeFinderAbstract::~C2DRangeFinderAbstract | ( | ) | [virtual] |
Destructor.
void mrpt::hwdrivers::C2DRangeFinderAbstract::bindIO | ( | CStream * | streamIO | ) |
Binds the object to a given I/O channel.
The stream object must not be deleted before the destruction of this class.
void mrpt::hwdrivers::C2DRangeFinderAbstract::doProcess | ( | ) | [virtual] |
virtual void mrpt::hwdrivers::C2DRangeFinderAbstract::doProcessSimple | ( | bool & | outThereIsObservation, | |
mrpt::slam::CObservation2DRangeScan & | outObservation, | |||
bool & | hardwareError | |||
) | [pure virtual] |
Specific laser scanner "software drivers" must process here new data from the I/O stream, and, if a whole scan has arrived, return it.
This method MUST BE CALLED in a timely fashion by the user to allow the proccessing of incoming data. It can be run in a different thread safely.
Implemented in mrpt::hwdrivers::CHokuyoURG, and mrpt::hwdrivers::CSickLaserUSB.
void mrpt::hwdrivers::C2DRangeFinderAbstract::getObservation | ( | bool & | outThereIsObservation, | |
mrpt::slam::CObservation2DRangeScan & | outObservation, | |||
bool & | hardwareError | |||
) |
Get the last observation from the sensor, if available, and unmarks it as being "the last one" (thus a new scan must arrive or subsequent calls will find no new observations).
virtual bool mrpt::hwdrivers::C2DRangeFinderAbstract::turnOff | ( | ) | [pure virtual] |
Disables the scanning mode (this can be used to turn the device in low energy mode, if available).
Implemented in mrpt::hwdrivers::CHokuyoURG, and mrpt::hwdrivers::CSickLaserUSB.
virtual bool mrpt::hwdrivers::C2DRangeFinderAbstract::turnOn | ( | ) | [pure virtual] |
Enables the scanning mode (which may depend on the specific laser device); this must be called before asking for observations to assure that the protocol has been initializated.
Implemented in mrpt::hwdrivers::CHokuyoURG, and mrpt::hwdrivers::CSickLaserUSB.
Definition at line 62 of file C2DRangeFinderAbstract.h.
bool mrpt::hwdrivers::C2DRangeFinderAbstract::m_hardwareError [private] |
Definition at line 58 of file C2DRangeFinderAbstract.h.
mrpt::slam::CObservation2DRangeScan mrpt::hwdrivers::C2DRangeFinderAbstract::m_lastObservation [private] |
Definition at line 56 of file C2DRangeFinderAbstract.h.
Definition at line 57 of file C2DRangeFinderAbstract.h.
mrpt::slam::CObservation2DRangeScanPtr mrpt::hwdrivers::C2DRangeFinderAbstract::m_nextObservation [private] |
A dynamic object used as buffer in doProcess.
Definition at line 64 of file C2DRangeFinderAbstract.h.
The I/O channel (will be NULL if not bound).
Reimplemented from mrpt::utils::CDebugOutputCapable.
Definition at line 69 of file C2DRangeFinderAbstract.h.
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN:exported at Mon Jan 12 13:00:16 UTC 2009 |