17 #include <QtCore/QObject> 18 #include <QtCore/QString> 19 #include <QtCore/QReadWriteLock> 20 #include <QtCore/QVector> 21 #include <QReadWriteLock> 48 void init(
bool showOnDisplay);
62 QString sensorName()
const override;
64 void onNewData(
const QString &dataLine)
override;
67 QVector<int> mReading{0, 0, 0};
70 QVector<int> mReadingBuffer{0, 0, 0};
73 qreal mToleranceFactor = 1.0;
76 bool mShowOnDisplay =
true;
79 QVector<int> mDetectParametersBuffer{0, 0, 0, 0, 0, 0};
82 QVector<int> mDetectParameters{0, 0, 0, 0, 0, 0};
84 QReadWriteLock mReadingLock;
86 mutable QReadWriteLock mDetectParametersLock;
QVector< int > read()
Returns current raw x coordinate of detected object.
Definition: lineSensorWorker.cpp:41
void detect()
Detects the color of an object in center of current frame and memorizes it.
Definition: lineSensorWorker.cpp:36
Helper class to track device state (off, starting, ready, stopping, fail).
Definition: deviceState.h:26
Definition: trikCommunicator.h:27
Worker object that processes line sensor output and updates stored reading.
Definition: lineSensorWorker.h:29
void init()
Launch sensor.
Definition: abstractVirtualSensorWorker.cpp:61
LineSensorWorker(const QString &script, const QString &inputFile, const QString &outputFile, qreal toleranceFactor, DeviceState &state, trikHal::HardwareAbstractionInterface &hardwareAbstraction)
Constructor.
Definition: lineSensorWorker.cpp:19
Base class for all virtual sensor workers.
Definition: abstractVirtualSensorWorker.h:38
QVector< int > getDetectParameters() const
Get values returned by last "detect" operation.
Definition: lineSensorWorker.cpp:47
script
Definition: system.py:83
~LineSensorWorker() override
Definition: lineSensorWorker.cpp:26
Hardware abstraction, provides devices that are used to communicate with robot hardware or emulate it...
Definition: hardwareAbstractionInterface.h:29