trikRuntime
trikControl::LineSensorInterface Class Referenceabstract

Uses virtual line sensor to detect x coordinate of a center of an object that was in camera's field of view when "detect" method was called. More...

#include <lineSensorInterface.h>

Inheritance diagram for trikControl::LineSensorInterface:
Collaboration diagram for trikControl::LineSensorInterface:

Public Slots

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 current raw x coordinate of detected object. Sensor returns 0 if detect() was not called. 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...
 

Signals

void stopped ()
 Emitted when sensor is stopped successfully. More...
 

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...
 
- Public Member Functions inherited from trikControl::DeviceInterface
 DeviceInterface ()=default
 
virtual ~DeviceInterface ()=default
 
virtual Status status () const =0
 Returns current status of the device. 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

Uses virtual line sensor to detect x coordinate of a center of an object that was in camera's field of view when "detect" method was called.

Used mainly to follow the line.

Member Function Documentation

virtual void trikControl::LineSensorInterface::detect ( )
pure virtualslot

Detects the color of an object in center of current frame and memorizes it.

virtual QVector<int> trikControl::LineSensorInterface::getDetectParameters ( ) const
pure virtualslot

Get values returned by last "detect" operation.

Returned vector has 6 components - hue, saturation and value of a dominant color (got by "detect") and hue, saturation and value tolerance factors.

virtual void trikControl::LineSensorInterface::init ( bool  showOnDisplay)
pure virtualslot

Initializes a camera.

Parameters
showOnDisplay- true if we want an image from a camera to be drawn on robot display.
virtual QVector<int> trikControl::LineSensorInterface::read ( )
pure virtualslot

Returns current raw x coordinate of detected object. Sensor returns 0 if detect() was not called.

virtual void trikControl::LineSensorInterface::stop ( )
pure virtualslot

Stops detection until init() will be called again.

void trikControl::LineSensorInterface::stopped ( )
signal

Emitted when sensor is stopped successfully.


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