trikRuntime
|
Interface representing TRIK controller board and devices installed on it, also provides access to peripherals like motors and sensors. More...
#include <brickInterface.h>
Public Slots | |
virtual void | configure (const QString &portName, const QString &deviceName)=0 |
Configures given device on given port. More... | |
virtual void | playSound (const QString &soundFileName)=0 |
Plays given music file on a speaker (in format accepted by aplay or cvlc utilities). More... | |
virtual void | playTone (int hzFreq, int msDuration)=0 |
Generates sound with given frequency and given duration, plays it on a speaker. More... | |
virtual void | say (const QString &text)=0 |
Uses text synthesis to say given text on a speaker. More... | |
virtual void | stop ()=0 |
Stops all motors and shuts down all current activity. More... | |
virtual trikControl::MotorInterface * | motor (const QString &port)=0 |
Returns reference to motor of a given type on a given port. More... | |
virtual trikControl::PwmCaptureInterface * | pwmCapture (const QString &port)=0 |
Returns reference to PWM signal capture device on a given port. More... | |
virtual trikControl::SensorInterface * | sensor (const QString &port)=0 |
Returns reference to sensor on a given port. More... | |
virtual QStringList | motorPorts (MotorInterface::Type type) const =0 |
Retruns list of ports for motors of a given type. More... | |
virtual QStringList | pwmCapturePorts () const =0 |
Returns list of PWM signal capture device ports. More... | |
virtual QStringList | sensorPorts (SensorInterface::Type type) const =0 |
Returns list of ports for sensors of a given type. More... | |
virtual QStringList | encoderPorts () const =0 |
Returns list of encoder ports. More... | |
virtual trikControl::VectorSensorInterface * | accelerometer ()=0 |
Returns on-board accelerometer. More... | |
virtual trikControl::GyroSensorInterface * | gyroscope ()=0 |
Returns on-board gyroscope. More... | |
virtual trikControl::LineSensorInterface * | lineSensor (const QString &port)=0 |
Returns high-level line detector sensor using camera on given port (video0 or video1). More... | |
virtual trikControl::ColorSensorInterface * | colorSensor (const QString &port)=0 |
Returns high-level color sensor using camera on given port (video0 or video1). More... | |
virtual trikControl::ObjectSensorInterface * | objectSensor (const QString &port)=0 |
Returns high-level object detector sensor using camera on given port (video0 or video1). More... | |
virtual trikControl::I2cDeviceInterface * | i2c (int bus, int address)=0 |
Returns i2c device object. More... | |
virtual QVector< uint8_t > | getStillImage ()=0 |
Returns QVector<uin8_t> with image using camera on given port (video0 or video1). More... | |
virtual trikControl::SoundSensorInterface * | soundSensor (const QString &port)=0 |
Returns high-level sound detector sensor using microphones. More... | |
virtual trikControl::EncoderInterface * | encoder (const QString &port)=0 |
Returns encoder on given port. More... | |
virtual trikControl::BatteryInterface * | battery ()=0 |
Returns battery. More... | |
virtual trikControl::KeysInterface * | keys ()=0 |
Returns keys on a control brick. More... | |
virtual trikControl::DisplayInterface * | display ()=0 |
Returns class that provides drawing on display. More... | |
virtual trikControl::LedInterface * | led ()=0 |
Returns LED control class. More... | |
virtual trikControl::GamepadInterface * | gamepad ()=0 |
Returns handler for Android gamepad. More... | |
virtual trikControl::FifoInterface * | fifo (const QString &port)=0 |
Returns custom FIFO file which can be used as sensor. More... | |
virtual trikControl::MarkerInterface * | marker ()=0 |
Returns marker. More... | |
virtual trikControl::EventDeviceInterface * | eventDevice (const QString &deviceFile)=0 |
Returns custom event device that can be used as a sensor, for example, for custom gamepad support. More... | |
virtual void | stopEventDevice (const QString &deviceFile)=0 |
Stops listening given event device and destroys its watcher object. More... | |
Signals | |
void | stopped () |
Emitted when all deferred deinitialization is completed and brick completely stopped. More... | |
Public Member Functions | |
virtual void | reset ()=0 |
Do reset (stop motors, reset keys, clear screen, etc). More... | |
virtual DisplayWidgetInterface * | graphicsWidget ()=0 |
Returns a widget on which display output is drawn. More... | |
virtual QString | configVersion () const =0 |
Returns version of system configuration file. More... | |
Interface representing TRIK controller board and devices installed on it, also provides access to peripherals like motors and sensors.
|
pure virtualslot |
Returns on-board accelerometer.
|
pure virtualslot |
Returns battery.
|
pure virtualslot |
Returns high-level color sensor using camera on given port (video0 or video1).
|
pure virtualslot |
Configures given device on given port.
Port must be listed in model-config.xml, device shall be listed in system-config.xml, and device shall be able to be configured on a port (it is also described in system-config.xml). Previously configured device is properly shut down, and new device is created and initialized on a port. Method blocks caller thread until device is created. Note that this method does not initialize devices like camera sensors, "init" shall be called for them separately when they are configured (it is consistent with Brick constructor behavior).
|
pure virtual |
Returns version of system configuration file.
Implemented in trikControl::Brick.
|
pure virtualslot |
Returns class that provides drawing on display.
|
pure virtualslot |
Returns encoder on given port.
|
pure virtualslot |
Returns list of encoder ports.
|
pure virtualslot |
Returns custom event device that can be used as a sensor, for example, for custom gamepad support.
Creates new event device on first access to a file, then returns already opened device. Ownership retained by brick.
|
pure virtualslot |
Returns custom FIFO file which can be used as sensor.
|
pure virtualslot |
Returns handler for Android gamepad.
|
pure virtualslot |
Returns QVector<uin8_t> with image using camera on given port (video0 or video1).
|
pure virtual |
Returns a widget on which display output is drawn.
Implemented in trikControl::Brick.
|
pure virtualslot |
Returns on-board gyroscope.
|
pure virtualslot |
Returns i2c device object.
|
pure virtualslot |
Returns keys on a control brick.
|
pure virtualslot |
Returns LED control class.
|
pure virtualslot |
Returns high-level line detector sensor using camera on given port (video0 or video1).
|
pure virtualslot |
Returns marker.
|
pure virtualslot |
Returns reference to motor of a given type on a given port.
|
pure virtualslot |
Retruns list of ports for motors of a given type.
|
pure virtualslot |
Returns high-level object detector sensor using camera on given port (video0 or video1).
|
pure virtualslot |
Plays given music file on a speaker (in format accepted by aplay or cvlc utilities).
|
pure virtualslot |
Generates sound with given frequency and given duration, plays it on a speaker.
|
pure virtualslot |
Returns reference to PWM signal capture device on a given port.
|
pure virtualslot |
Returns list of PWM signal capture device ports.
|
pure virtual |
Do reset (stop motors, reset keys, clear screen, etc).
We should call it before executing any script with this instance.
Implemented in trikControl::Brick.
|
pure virtualslot |
Uses text synthesis to say given text on a speaker.
|
pure virtualslot |
Returns reference to sensor on a given port.
|
pure virtualslot |
Returns list of ports for sensors of a given type.
|
pure virtualslot |
Returns high-level sound detector sensor using microphones.
|
pure virtualslot |
Stops all motors and shuts down all current activity.
|
pure virtualslot |
Stops listening given event device and destroys its watcher object.
|
signal |
Emitted when all deferred deinitialization is completed and brick completely stopped.
Note that if there is no deferred deinitialization (no video sensors are on, for example), signal will NOT be emitted.