Regilo
A simple C++ library for controlling the Neato XV robot and the Hokuyo scanner.
|
The NeatoController class is used to communicate with the Neato robot. More...
#include <neatocontroller.hpp>
Public Member Functions | |
NeatoController () | |
Default constructor. | |
NeatoController (const std::string &logPath) | |
Constructor with a log file specified by a path. More... | |
NeatoController (std::iostream &logStream) | |
Constructor with a log specified by a stream. More... | |
virtual | ~NeatoController ()=default |
Default destructor. | |
virtual bool | getTestMode () const override |
Get whether the Neato is in the test mode. More... | |
virtual void | setTestMode (bool testMode) override |
Set or unset the test mode. More... | |
virtual bool | getLdsRotation () const override |
Get whether the Neato has LDS rotation on or off. More... | |
virtual void | setLdsRotation (bool ldsRotation) override |
Set LDS rotation on or off. More... | |
virtual void | setMotor (int left, int right, int speed) override |
Set the specified motor to run in a direction at a requested speed. More... | |
virtual std::string | getTime () override |
Get the current scheduler time. More... | |
![]() | |
virtual | ~INeatoController ()=default |
Default destructor. | |
![]() | |
virtual | ~IScanController ()=default |
Default destructor. | |
![]() | |
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< ILog > | getLog ()=0 |
Get the current Log. More... | |
virtual std::shared_ptr< const ILog > | getLog () 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... | |
![]() | |
virtual | ~ScanController ()=default |
Default destructor. | |
virtual ScanData | getScan (bool fromDevice=true) override final |
Get a scan from the device. More... | |
Static Public Attributes | |
static std::string | ON = "on" |
A string that represents the ON value. | |
static std::string | OFF = "off" |
A string that represents the OFF value. | |
static std::string | LDS_SCAN_HEADER = "AngleInDegrees,DistInMM,Intensity,ErrorCodeHEX" |
A header of the LDS scan output. | |
static std::string | LDS_SCAN_FOOTER = "ROTATION_SPEED," |
A footer of the LDS scan output. | |
static std::string | CMD_TEST_MODE = "testmode %s" |
A template for the testmode command. | |
static std::string | CMD_SET_LDS_ROTATION = "setldsrotation %s" |
A template for the setldsrotation command. | |
static std::string | CMD_SET_MOTOR = "setmotor %d %d %d" |
A template for the setmotor command. | |
static std::string | CMD_GET_TIME = "gettime" |
A template for the gettime command. | |
static std::string | CMD_GET_LDS_SCAN = "getldsscan" |
A template for the getldsscan command. | |
Protected Member Functions | |
virtual std::string | getScanCommand () const override |
Get a string that can be used for getting a scan. More... | |
virtual bool | parseScanData (std::istream &in, ScanData &data) override |
Parse the raw scan data. More... | |
Additional Inherited Members | |
![]() | |
std::size_t | lastScanId = 0 |
A scan id (starting from zero) that is used for new scans. | |
The NeatoController class is used to communicate with the Neato robot.
regilo::NeatoController< ProtocolController >::NeatoController | ( | const std::string & | logPath | ) |
Constructor with a log file specified by a path.
logPath | Path to the log file. |
regilo::NeatoController< ProtocolController >::NeatoController | ( | std::iostream & | logStream | ) |
Constructor with a log specified by a stream.
logStream | The log stream. |
|
inlineoverridevirtual |
Get whether the Neato has LDS rotation on or off.
Implements regilo::INeatoController.
|
inlineoverrideprotectedvirtual |
Get a string that can be used for getting a scan.
Implements regilo::ScanController< ProtocolController >.
|
inlineoverridevirtual |
Get whether the Neato is in the test mode.
Implements regilo::INeatoController.
|
overridevirtual |
Get the current scheduler time.
Implements regilo::INeatoController.
|
overrideprotectedvirtual |
Parse the raw scan data.
in | The input stream that stores the raw scan data. |
data | Output for the scanned data. |
Implements regilo::ScanController< ProtocolController >.
|
overridevirtual |
Set LDS rotation on or off.
ldsRotation | True for starting the LIDAR rotation. |
Implements regilo::INeatoController.
|
overridevirtual |
Set the specified motor to run in a direction at a requested speed.
left | Distance in millimeters to drive the left wheel (pos = forward, neg = backward). |
right | Distance in millimeters to drive the right wheel (pos = forward, neg = backward). |
speed | Speed in millimeters/second. |
Implements regilo::INeatoController.
|
overridevirtual |
Set or unset the test mode.
testMode | True for setting the test mode. |
Implements regilo::INeatoController.