trikRuntime
trikControl::RangeSensor Class Reference

TRIK range sensor. More...

#include <rangeSensor.h>

Inheritance diagram for trikControl::RangeSensor:
Collaboration diagram for trikControl::RangeSensor:

Public Slots

void init ()
 Initializes sensor and begins receiving events from it. More...
 
int read () override
 Returns current raw reading of a sensor. More...
 
int readRawData () override
 Returns current real raw reading of a sensor. More...
 
void stop ()
 Stops sensor until init() will be called again. More...
 
- Public Slots inherited from trikControl::SensorInterface
virtual int read ()=0
 Returns current reading of a sensor. More...
 
virtual int readRawData ()=0
 Returns current raw reading of a sensor. More...
 

Signals

void newData (int distance, int rawDistance, const trikKernel::TimeVal &eventTime)
 Emitted when new data is received from a sensor. More...
 

Public Member Functions

 RangeSensor (const QString &port, const trikKernel::Configurer &configurer, ModuleLoader &moduleLoader, const trikHal::HardwareAbstractionInterface &hardwareAbstraction)
 Constructor. More...
 
 ~RangeSensor () override
 
Status status () const override
 Returns current status of the device. More...
 
int minValue () const override
 Gets minimal possible value for sensor reading received by read() slot. More...
 
int maxValue () const override
 Gets maximal possible value for sensor reading received by read() slot. More...
 
- Public Member Functions inherited from trikControl::DeviceInterface
 DeviceInterface ()=default
 
virtual ~DeviceInterface ()=default
 

Additional Inherited Members

- Public Types inherited from trikControl::SensorInterface
enum  Type { Type::analogSensor, Type::digitalSensor, Type::specialSensor }
 
- Public Types inherited from trikControl::DeviceInterface
enum  Status {
  Status::permanentFailure, Status::temporaryFailure, Status::off, Status::starting,
  Status::ready, Status::stopping
}
 Device status. 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

TRIK range sensor.

Constructor & Destructor Documentation

RangeSensor::RangeSensor ( const QString &  port,
const trikKernel::Configurer configurer,
ModuleLoader moduleLoader,
const trikHal::HardwareAbstractionInterface hardwareAbstraction 
)

Constructor.

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

Member Function Documentation

void RangeSensor::init ( )
slot

Initializes sensor and begins receiving events from it.

int RangeSensor::maxValue ( ) const
overridevirtual

Gets maximal possible value for sensor reading received by read() slot.

Implements trikControl::SensorInterface.

int RangeSensor::minValue ( ) const
overridevirtual

Gets minimal possible value for sensor reading received by read() slot.

Implements trikControl::SensorInterface.

void trikControl::RangeSensor::newData ( int  distance,
int  rawDistance,
const trikKernel::TimeVal eventTime 
)
signal

Emitted when new data is received from a sensor.

int RangeSensor::read ( )
overrideslot

Returns current raw reading of a sensor.

int RangeSensor::readRawData ( )
overrideslot

Returns current real raw reading of a sensor.

RangeSensor::Status RangeSensor::status ( ) const
overridevirtual

Returns current status of the device.

Implements trikControl::DeviceInterface.

void RangeSensor::stop ( )
slot

Stops sensor until init() will be called again.


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