#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 Member Functions | |
void | loadExclusionAreas (const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection) |
Should be call by derived classes at "loadConfig" (loads exclusion areas AND exclusion angles). | |
void | filterByExclusionAreas (mrpt::slam::CObservation2DRangeScan &obs) const |
Mark as invalid those points which (x,y) coordinates fall within the exclusion polygons. | |
void | filterByExclusionAngles (mrpt::slam::CObservation2DRangeScan &obs) const |
Mark as invalid those ranges in a set of forbiden angle ranges. | |
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. | |
std::vector< mrpt::math::CPolygon > | m_lstExclusionPolys |
A list of optional exclusion polygons, in coordinates relative to the vehicle, that is, taking into account the "sensorPose". | |
std::vector< std::pair< double, double > > | m_lstExclusionAngles |
A list of pairs of angles <init,end> such as all sensor ranges falling in those forbiden angles will be marked as invalid. |
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.
There is support for "exclusion polygons", areas where points, if detected, should be marked as invalid. Those areas are useful in cases where the scanner always detects part of the vehicle itself, and those points want to be ignored.
Definition at line 59 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::filterByExclusionAngles | ( | mrpt::slam::CObservation2DRangeScan & | obs | ) | const [protected] |
void mrpt::hwdrivers::C2DRangeFinderAbstract::filterByExclusionAreas | ( | mrpt::slam::CObservation2DRangeScan & | obs | ) | const [protected] |
Mark as invalid those points which (x,y) coordinates fall within the exclusion polygons.
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).
void mrpt::hwdrivers::C2DRangeFinderAbstract::loadExclusionAreas | ( | const mrpt::utils::CConfigFileBase & | configSource, | |
const std::string & | iniSection | |||
) | [protected] |
Should be call by derived classes at "loadConfig" (loads exclusion areas AND exclusion angles).
This loads a sequence of vertices of a polygon given by its (x,y) coordinates relative to the vehicle, that is, taking into account the "sensorPose".
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 68 of file C2DRangeFinderAbstract.h.
bool mrpt::hwdrivers::C2DRangeFinderAbstract::m_hardwareError [private] |
Definition at line 64 of file C2DRangeFinderAbstract.h.
mrpt::slam::CObservation2DRangeScan mrpt::hwdrivers::C2DRangeFinderAbstract::m_lastObservation [private] |
Definition at line 62 of file C2DRangeFinderAbstract.h.
Definition at line 63 of file C2DRangeFinderAbstract.h.
std::vector<std::pair<double,double> > mrpt::hwdrivers::C2DRangeFinderAbstract::m_lstExclusionAngles [private] |
A list of pairs of angles <init,end> such as all sensor ranges falling in those forbiden angles will be marked as invalid.
Definition at line 73 of file C2DRangeFinderAbstract.h.
std::vector<mrpt::math::CPolygon> mrpt::hwdrivers::C2DRangeFinderAbstract::m_lstExclusionPolys [private] |
A list of optional exclusion polygons, in coordinates relative to the vehicle, that is, taking into account the "sensorPose".
Definition at line 72 of file C2DRangeFinderAbstract.h.
mrpt::slam::CObservation2DRangeScanPtr mrpt::hwdrivers::C2DRangeFinderAbstract::m_nextObservation [private] |
A dynamic object used as buffer in doProcess.
Definition at line 70 of file C2DRangeFinderAbstract.h.
The I/O channel (will be NULL if not bound).
Reimplemented from mrpt::utils::CDebugOutputCapable.
Definition at line 79 of file C2DRangeFinderAbstract.h.
Page generated by Doxygen 1.5.7.1 for MRPT 0.7.1 SVN: at Mon Aug 17 22:58:25 EDT 2009 |