9 #ifndef C2DRangeFinderAbstract_H 10 #define C2DRangeFinderAbstract_H 133 bool& outThereIsObservation,
135 bool& hardwareError);
146 bool& outThereIsObservation,
148 bool& hardwareError) = 0;
155 virtual bool turnOn() = 0;
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
virtual void doProcessSimple(bool &outThereIsObservation, mrpt::obs::CObservation2DRangeScan &outObservation, bool &hardwareError)=0
Specific laser scanner "software drivers" must process here new data from the I/O stream...
mrpt::obs::CObservation2DRangeScan m_lastObservation
utils::CStream * m_stream
The I/O channel (will be nullptr if not bound).
mrpt::gui::CDisplayWindow3D::Ptr m_win
virtual bool turnOn()=0
Enables the scanning mode (which may depend on the specific laser device); this must be called before...
std::mutex m_csChangeStream
For being thread-safe.
void filterByExclusionAreas(mrpt::obs::CObservation2DRangeScan &obs) const
Mark as invalid those points which (x,y) coordinates fall within the exclusion polygons.
std::shared_ptr< CObservation2DRangeScan > Ptr
void filterByExclusionAngles(mrpt::obs::CObservation2DRangeScan &obs) const
Mark as invalid those ranges in a set of forbiden angle ranges.
This class allows loading and storing values and vectors of different types from a configuration text...
void getObservation(bool &outThereIsObservation, mrpt::obs::CObservation2DRangeScan &outObservation, bool &hardwareError)
Get the last observation from the sensor, if available, and unmarks it as being "the last one" (thus ...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
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 ...
virtual ~C2DRangeFinderAbstract()
Destructor.
void showPreview(bool enable=true)
Enables GUI visualization in real-time.
C2DRangeFinderAbstract()
Default constructor.
std::shared_ptr< CDisplayWindow3D > Ptr
void bindIO(mrpt::utils::CStream *streamIO)
Binds the object to a given I/O channel.
void loadCommonParams(const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
Should be call by derived classes at "loadConfig" (loads exclusion areas AND exclusion angles)...
GLsizei const GLchar ** string
mrpt::obs::CObservation2DRangeScan::TListExclusionAreasWithRanges m_lstExclusionPolys
A list of optional exclusion polygons, in coordinates relative to the vehicle, that is...
mrpt::obs::CObservation2DRangeScan::Ptr m_nextObservation
A dynamic object used as buffer in doProcess.
This is the base, abstract class for "software drivers" interfaces to 2D scanners (laser range finder...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
std::vector< std::pair< mrpt::math::CPolygon, std::pair< double, double > > > TListExclusionAreasWithRanges
Used in filterByExclusionAreas.
bool m_showPreview
If true, shows a 3D window with a preview of the grabber data.
void doProcess()
Main method for a CGenericSensor.
void processPreview(const mrpt::obs::CObservation2DRangeScan &obs)
Must be called inside the capture method to allow optional GUI preview of scans.
std::mutex m_csLastObservation
virtual bool turnOff()=0
Disables the scanning mode (this can be used to turn the device in low energy mode, if available)
bool m_lastObservationIsNew