YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
FakeAnalogSensor.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_DEVICE_FAKE_ANALOGSENSOR
7#define YARP_DEVICE_FAKE_ANALOGSENSOR
8
10
11#include <yarp/dev/all.h>
13
14#include <mutex>
16
31{
32private:
33
34 std::mutex mutex;
35
36 std::string name; // device name
37 short status;
38 double timeStamp;
40
41public:
42 FakeAnalogSensor(double period = 0.02);
43
45
46 bool open(yarp::os::Searchable& config) override;
47 bool close() override;
48
49 //IAnalogSensor interface
50 int getChannels() override;
51 int getState(int ch) override;
52 int read(yarp::sig::Vector &out) override;
53
54 int calibrateSensor() override;
55 int calibrateSensor(const yarp::sig::Vector& v) override;
56
57 int calibrateChannel(int ch) override;
58 int calibrateChannel(int ch, double v) override;
59
60 // RateThread interface
61 void run() override;
62 bool threadInit() override;
63 void threadRelease() override;
64};
65
66
67#endif // YARP_DEVICE_FAKE_ANALOGSENSOR
analog sensor interface
This class is the parameters parser for class FakeAnalogSensor.
fakeAnalogSensor: Fake analog sensor device for testing purpose and reference for new analog devices
bool threadInit() override
Initialization method.
void run() override
Loop function.
int calibrateChannel(int ch) override
Calibrates one single channel.
bool close() override
Close the DeviceDriver.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
int getChannels() override
Get the number of channels of the sensor.
int calibrateSensor() override
Calibrates the whole sensor.
int read(yarp::sig::Vector &out) override
Read a vector from the sensor.
void threadRelease() override
Release method.
int getState(int ch) override
Check the state value of a given channel.
Interface implemented by all device drivers.
A generic interface to sensors (gyro, a/d converters).
An abstraction for a periodic thread.
A base class for nested structures that can be searched.
Definition Searchable.h:31