trikRuntime
trikControl::ObjectSensor Class Reference

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

#include <objectSensor.h>

Inheritance diagram for trikControl::ObjectSensor:
Collaboration diagram for trikControl::ObjectSensor:

Public Slots

void init (bool showOnDisplay) override
 
void detect () override
 
QVector< int > read () override
 
void stop () override
 
QVector< int > getDetectParameters () const override
 
- Public Slots inherited from trikControl::ObjectSensorInterface
virtual void init (bool showOnDisplay)=0
 Initializes a camera. More...
 
virtual void detect ()=0
 Detects the color of an object in center of current frame and memorizes it. More...
 
virtual QVector< int > read ()=0
 Returns x, y coordinates and size of an object in a form of vector [x; y; size]. More...
 
virtual void stop ()=0
 Stops detection until init() will be called again. More...
 
virtual QVector< int > getDetectParameters () const =0
 Get values returned by last "detect" operation. More...
 

Public Member Functions

 ObjectSensor (const QString &port, const trikKernel::Configurer &configurer, trikHal::HardwareAbstractionInterface &hardwareAbstraction)
 Constructor. More...
 
 ~ObjectSensor () 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::ObjectSensorInterface
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 object sensor for real robot.

Constructor & Destructor Documentation

ObjectSensor::ObjectSensor ( 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.
ObjectSensor::~ObjectSensor ( )
override

Member Function Documentation

void ObjectSensor::detect ( )
overrideslot
QVector< int > ObjectSensor::getDetectParameters ( ) const
overrideslot
void ObjectSensor::init ( bool  showOnDisplay)
overrideslot
QVector< int > ObjectSensor::read ( )
overrideslot
ObjectSensor::Status ObjectSensor::status ( ) const
overridevirtual

Returns current status of the device.

Implements trikControl::DeviceInterface.

void ObjectSensor::stop ( )
overrideslot
Todo:
Correctly stop starting sensors.

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