Regilo
A simple C++ library for controlling the Neato XV robot and the Hokuyo scanner.
regilo::ScanController< ProtocolController > Class Template Referenceabstract

The ScanController class implements parsing of scanned laser data. More...

#include <scancontroller.hpp>

Inheritance diagram for regilo::ScanController< ProtocolController >:
regilo::IScanController regilo::IController regilo::HokuyoController< ProtocolController > regilo::NeatoController< ProtocolController >

Public Member Functions

virtual ~ScanController ()=default
 Default destructor.
 
virtual ScanData getScan (bool fromDevice=true) override final
 Get a scan from the device. More...
 
- Public Member Functions inherited from regilo::IScanController
virtual ~IScanController ()=default
 Default destructor.
 
- Public Member Functions inherited from regilo::IController
virtual ~IController ()=default
 Default destructor.
 
virtual void connect (const std::string &endpoint)=0
 Connect the controller to a device. More...
 
virtual bool isConnected () const =0
 Test if the controller is connected. More...
 
virtual std::string getEndpoint () const =0
 Get the endpoint of device. More...
 
virtual std::shared_ptr< ILoggetLog ()=0
 Get the current Log. More...
 
virtual std::shared_ptr< const ILoggetLog () const =0
 Get the current Log (a const variant). More...
 
virtual void setLog (std::shared_ptr< ILog > log)=0
 Set a Log (it can be shared between more controllers). More...
 
virtual std::string sendCommand (const std::string &command)=0
 Send a command to the device. More...
 

Protected Member Functions

virtual std::string getScanCommand () const =0
 Get a string that can be used for getting a scan. More...
 
virtual bool parseScanData (std::istream &in, ScanData &data)=0
 Parse the raw scan data. More...
 

Protected Attributes

std::size_t lastScanId = 0
 A scan id (starting from zero) that is used for new scans.
 

Detailed Description

template<typename ProtocolController>
class regilo::ScanController< ProtocolController >

The ScanController class implements parsing of scanned laser data.

Member Function Documentation

template<typename ProtocolController >
ScanData regilo::ScanController< ProtocolController >::getScan ( bool  fromDevice = true)
finaloverridevirtual

Get a scan from the device.

Parameters
fromDeviceSpecify if you want to get a scan from the device (true) or log (false). Default: true.
Returns
ScanData

Implements regilo::IScanController.

template<typename ProtocolController >
virtual std::string regilo::ScanController< ProtocolController >::getScanCommand ( ) const
protectedpure virtual

Get a string that can be used for getting a scan.

Returns
A command for getting a scan.

Implemented in regilo::NeatoController< ProtocolController >, and regilo::HokuyoController< ProtocolController >.

template<typename ProtocolController >
virtual bool regilo::ScanController< ProtocolController >::parseScanData ( std::istream &  in,
ScanData data 
)
protectedpure virtual

Parse the raw scan data.

Parameters
inThe input stream that stores the raw scan data.
dataOutput for the scanned data.
Returns
True if the parsing ends without an error.

Implemented in regilo::NeatoController< ProtocolController >, and regilo::HokuyoController< ProtocolController >.


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