YARP
Yet Another Robot Platform
IAnalogSensor.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_DEV_IANALOGSENSOR_H
8#define YARP_DEV_IANALOGSENSOR_H
9
10#include <yarp/os/Vocab.h>
11#include <yarp/dev/api.h>
12#include <yarp/sig/Vector.h>
13
15
18namespace yarp::dev {
19
27{
28public:
29 enum
30 {
31 AS_OK=0,
32 AS_ERROR=1,
33 AS_OVF=2,
34 AS_TIMEOUT=3
35 };
36
37 virtual ~IAnalogSensor();
38
44 virtual int read(yarp::sig::Vector &out)=0;
45
51 virtual int getState(int ch)=0;
52
57 virtual int getChannels()=0;
58
63 virtual int calibrateSensor()=0;
64
70 virtual int calibrateSensor(const yarp::sig::Vector& value)=0;
71
77 virtual int calibrateChannel(int ch)=0;
78
85 virtual int calibrateChannel(int ch, double value)=0;
86};
87
88} // namespace yarp::dev
89
90#endif // YARP_DEV_IANALOGSENSOR_H
constexpr yarp::conf::vocab32_t VOCAB_IANALOG
Definition: IAnalogSensor.h:14
contains the definition of a Vector type
A generic interface to sensors (gyro, a/d converters).
Definition: IAnalogSensor.h:27
virtual int calibrateSensor()=0
Calibrates the whole sensor.
virtual int getState(int ch)=0
Check the state value of a given channel.
virtual int read(yarp::sig::Vector &out)=0
Read a vector from the sensor.
virtual int getChannels()=0
Get the number of channels of the sensor.
virtual int calibrateChannel(int ch)=0
Calibrates one single channel.
virtual int calibrateSensor(const yarp::sig::Vector &value)=0
Calibrates the whole sensor, using an vector of calibration values.
virtual int calibrateChannel(int ch, double value)=0
Calibrates one single channel, using a calibration value.
std::int32_t vocab32_t
Definition: numeric.h:78
For streams capable of holding different kinds of content, check what they actually have.
constexpr yarp::conf::vocab32_t createVocab32(char a, char b=0, char c=0, char d=0)
Create a vocab from chars.
Definition: Vocab.h:27
#define YARP_dev_API
Definition: api.h:18