trikRuntime
trikControl::ColorSensor Class Reference

Implementation of color sensor for real robot. More...

#include <colorSensor.h>

Inheritance diagram for trikControl::ColorSensor:
Collaboration diagram for trikControl::ColorSensor:

Public Slots

void init (bool showOnDisplay) override
 
QVector< int > read (int m, int n) override
 
void stop () override
 
- Public Slots inherited from trikControl::ColorSensorInterface
virtual void init (bool showOnDisplay)=0
 Initializes a camera. More...
 
virtual QVector< int > read (int m, int n)=0
 Returns dominant color in given cell of a grid as a vector [R; G; B] in RGB color scale. More...
 
virtual void stop ()=0
 Stops detection until init() will be called again. More...
 

Public Member Functions

 ColorSensor (const QString &port, const trikKernel::Configurer &configurer, trikHal::HardwareAbstractionInterface &hardwareAbstraction)
 Constructor. More...
 
 ~ColorSensor () override
 
Status status () const override
 Returns current status of the device. More...
 
- Public Member Functions inherited from trikControl::DeviceInterface
 DeviceInterface ()=default
 
virtual ~DeviceInterface ()=default
 

Additional Inherited Members

- Public Types inherited from trikControl::DeviceInterface
enum  Status {
  Status::permanentFailure, Status::temporaryFailure, Status::off, Status::starting,
  Status::ready, Status::stopping
}
 Device status. More...
 
- Signals inherited from trikControl::ColorSensorInterface
void stopped ()
 Emitted when sensor is stopped successfully. More...
 
- Static Public Member Functions inherited from trikControl::DeviceInterface
static Status combine (const DeviceInterface &underlying, const DeviceInterface::Status &dependent)
 Helper method to return status of a device relying on other device to work. More...
 

Detailed Description

Implementation of color sensor for real robot.

Constructor & Destructor Documentation

ColorSensor::ColorSensor ( const QString &  port,
const trikKernel::Configurer configurer,
trikHal::HardwareAbstractionInterface hardwareAbstraction 
)

Constructor.

Parameters
port- port on which this sensor is configured.
configurer- configurer object containing preparsed XML files with sensor parameters.
ColorSensor::~ColorSensor ( )
override

Member Function Documentation

void ColorSensor::init ( bool  showOnDisplay)
overrideslot
QVector< int > ColorSensor::read ( int  m,
int  n 
)
overrideslot
ColorSensor::Status ColorSensor::status ( ) const
overridevirtual

Returns current status of the device.

Implements trikControl::DeviceInterface.

void ColorSensor::stop ( )
overrideslot

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