YARP
Yet Another Robot Platform
IAnalogSensor.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2019 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 
20 namespace yarp {
21  namespace dev {
22  class IAnalogSensor;
23  }
24 }
25 
33 {
34 public:
35  enum
36  {
37  AS_OK=0,
38  AS_ERROR=1,
39  AS_OVF=2,
40  AS_TIMEOUT=3
41  };
42 
43  virtual ~IAnalogSensor(){}
44 
50  virtual int read(yarp::sig::Vector &out)=0;
51 
57  virtual int getState(int ch)=0;
58 
63  virtual int getChannels()=0;
64 
69  virtual int calibrateSensor()=0;
70 
76  virtual int calibrateSensor(const yarp::sig::Vector& value)=0;
77 
83  virtual int calibrateChannel(int ch)=0;
84 
91  virtual int calibrateChannel(int ch, double value)=0;
92 };
93 
94 #endif // YARP_DEV_IANALOGSENSOR_H
#define YARP_dev_API
Definition: api.h:19
constexpr yarp::conf::vocab32_t VOCAB_IANALOG
Definition: IAnalogSensor.h:17
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:516
std::int32_t vocab32_t
Definition: numeric.h:52
Provides:
Definition: Vector.h:32
The main, catch-all namespace for YARP.
Definition: numeric.h:47
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
contains the definition of a Vector type
A generic interface to sensors (gyro, a/d converters).
Definition: IAnalogSensor.h:32