YARP
Yet Another Robot Platform
IAnalogSensor.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_DEV_IANALOGSENSOR_H
11 #define YARP_DEV_IANALOGSENSOR_H
12 
13 #include <yarp/os/Vocab.h>
14 #include <yarp/dev/api.h>
15 #include <yarp/sig/Vector.h>
16 
18 
21 namespace yarp {
22 namespace dev {
23 
31 {
32 public:
33  enum
34  {
35  AS_OK=0,
36  AS_ERROR=1,
37  AS_OVF=2,
38  AS_TIMEOUT=3
39  };
40 
41  virtual ~IAnalogSensor();
42 
48  virtual int read(yarp::sig::Vector &out)=0;
49 
55  virtual int getState(int ch)=0;
56 
61  virtual int getChannels()=0;
62 
67  virtual int calibrateSensor()=0;
68 
74  virtual int calibrateSensor(const yarp::sig::Vector& value)=0;
75 
81  virtual int calibrateChannel(int ch)=0;
82 
89  virtual int calibrateChannel(int ch, double value)=0;
90 };
91 
92 } // namespace dev
93 } // namespace yarp
94 
95 #endif // YARP_DEV_IANALOGSENSOR_H
yarp::dev::IAnalogSensor::~IAnalogSensor
virtual ~IAnalogSensor()
yarp::os::createVocab
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
yarp::dev::IAnalogSensor::getState
virtual int getState(int ch)=0
Check the state value of a given channel.
Vector.h
contains the definition of a Vector type
yarp::dev::IAnalogSensor::calibrateSensor
virtual int calibrateSensor()=0
Calibrates the whole sensor.
yarp::dev::IAnalogSensor::calibrateSensor
virtual int calibrateSensor(const yarp::sig::Vector &value)=0
Calibrates the whole sensor, using an vector of calibration values.
yarp::dev::IAnalogSensor::calibrateChannel
virtual int calibrateChannel(int ch, double value)=0
Calibrates one single channel, using a calibration value.
yarp::sig::VectorOf< double >
yarp::dev::IAnalogSensor::read
virtual int read(yarp::sig::Vector &out)=0
Read a vector from the sensor.
yarp::dev::IAnalogSensor::calibrateChannel
virtual int calibrateChannel(int ch)=0
Calibrates one single channel.
yarp::dev::IAnalogSensor
A generic interface to sensors (gyro, a/d converters).
Definition: IAnalogSensor.h:31
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::conf::vocab32_t
std::int32_t vocab32_t
Definition: numeric.h:52
Vocab.h
yarp::dev::IAnalogSensor::getChannels
virtual int getChannels()=0
Get the number of channels of the sensor.
api.h
VOCAB_IANALOG
constexpr yarp::conf::vocab32_t VOCAB_IANALOG
Definition: IAnalogSensor.h:17