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 
18 namespace yarp {
19 namespace dev {
20 
28 {
29 public:
30  enum
31  {
32  AS_OK=0,
33  AS_ERROR=1,
34  AS_OVF=2,
35  AS_TIMEOUT=3
36  };
37 
38  virtual ~IAnalogSensor();
39 
45  virtual int read(yarp::sig::Vector &out)=0;
46 
52  virtual int getState(int ch)=0;
53 
58  virtual int getChannels()=0;
59 
64  virtual int calibrateSensor()=0;
65 
71  virtual int calibrateSensor(const yarp::sig::Vector& value)=0;
72 
78  virtual int calibrateChannel(int ch)=0;
79 
86  virtual int calibrateChannel(int ch, double value)=0;
87 };
88 
89 } // namespace dev
90 } // namespace yarp
91 
92 #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:28
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
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:28
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18