trikRuntime
trikControl::ObjectSensorInterface 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 <objectSensorInterface.h>

Inheritance diagram for trikControl::ObjectSensorInterface:
Collaboration diagram for trikControl::ObjectSensorInterface:

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 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...
 

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::ObjectSensorInterface::detect ( )
pure virtualslot

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

virtual QVector<int> trikControl::ObjectSensorInterface::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::ObjectSensorInterface::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::ObjectSensorInterface::read ( )
pure virtualslot

Returns x, y coordinates and size of an object in a form of vector [x; y; size].

Returns 0 in every field if detect() was not called.

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

Stops detection until init() will be called again.

void trikControl::ObjectSensorInterface::stopped ( )
signal

Emitted when sensor is stopped successfully.


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