YARP
Yet Another Robot Platform
MultipleAnalogSensorsInterfaces.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_DEV_MULTIPLEANALOGSENSORSINTERFACES_H
7 #define YARP_DEV_MULTIPLEANALOGSENSORSINTERFACES_H
8 
9 #include <cassert>
10 #include <string>
11 
12 #include <yarp/dev/api.h>
13 #include <yarp/sig/Vector.h>
14 
15 namespace yarp
16 {
17  namespace dev
18  {
19  class IThreeAxisGyroscopes;
20  class IThreeAxisLinearAccelerometers;
21  class IThreeAxisMagnetometers;
22  class IPositionSensors;
23  class IOrientationSensors;
24  class ITemperatureSensors;
25  class ISixAxisForceTorqueSensors;
26  class IContactLoadCellArrays;
27  class IEncoderArrays;
28  class ISkinPatches;
29 
34  {
35  MAS_OK=0,
37  MAS_OVF=2,
40  MAS_UNKNOWN=5
41  };
42  }
43 }
44 
61 {
62 public:
66  virtual size_t getNrOfThreeAxisGyroscopes() const = 0;
67 
73  virtual yarp::dev::MAS_status getThreeAxisGyroscopeStatus(size_t sens_index) const = 0;
74 
81  virtual bool getThreeAxisGyroscopeName(size_t sens_index, std::string &name) const = 0;
82 
89  virtual bool getThreeAxisGyroscopeFrameName(size_t sens_index, std::string &frameName) const = 0;
90 
99  virtual bool getThreeAxisGyroscopeMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
100 
102 };
103 
104 
115 {
116 public:
120  virtual size_t getNrOfThreeAxisLinearAccelerometers() const = 0;
121 
125  virtual yarp::dev::MAS_status getThreeAxisLinearAccelerometerStatus(size_t sens_index) const = 0;
126 
131  virtual bool getThreeAxisLinearAccelerometerName(size_t sens_index, std::string &name) const = 0;
132 
137  virtual bool getThreeAxisLinearAccelerometerFrameName(size_t sens_index, std::string &frameName) const = 0;
138 
147  virtual bool getThreeAxisLinearAccelerometerMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
148 
150 };
151 
162 {
163 public:
167  virtual size_t getNrOfThreeAxisMagnetometers() const = 0;
168 
172  virtual yarp::dev::MAS_status getThreeAxisMagnetometerStatus(size_t sens_index) const = 0;
173 
178  virtual bool getThreeAxisMagnetometerName(size_t sens_index, std::string &name) const = 0;
179 
184  virtual bool getThreeAxisMagnetometerFrameName(size_t sens_index, std::string &frameName) const = 0;
185 
194  virtual bool getThreeAxisMagnetometerMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
195 
197 };
198 
213 {
214 public:
218  virtual size_t getNrOfPositionSensors() const = 0;
219 
223  virtual yarp::dev::MAS_status getPositionSensorStatus(size_t sens_index) const = 0;
224 
229  virtual bool getPositionSensorName(size_t sens_index, std::string& name) const = 0;
230 
239  virtual bool getPositionSensorFrameName(size_t sens_index, std::string& frameName) const = 0;
240 
249  virtual bool getPositionSensorMeasure(size_t sens_index, yarp::sig::Vector& xyz, double& timestamp) const = 0;
250 
252  {
253  }
254 };
255 
271 {
272 public:
276  virtual size_t getNrOfOrientationSensors() const = 0;
277 
281  virtual yarp::dev::MAS_status getOrientationSensorStatus(size_t sens_index) const = 0;
282 
287  virtual bool getOrientationSensorName(size_t sens_index, std::string &name) const = 0;
288 
297  virtual bool getOrientationSensorFrameName(size_t sens_index, std::string &frameName) const = 0;
298 
346  virtual bool getOrientationSensorMeasureAsRollPitchYaw(size_t sens_index, yarp::sig::Vector& rpy, double& timestamp) const = 0;
347 
349 };
350 
351 
362 {
363 public:
367  virtual size_t getNrOfTemperatureSensors() const = 0;
368 
372  virtual yarp::dev::MAS_status getTemperatureSensorStatus(size_t sens_index) const = 0;
373 
377  virtual bool getTemperatureSensorName(size_t sens_index, std::string &name) const = 0;
378 
382  virtual bool getTemperatureSensorFrameName(size_t sens_index, std::string &frameName) const = 0;
383 
388  virtual bool getTemperatureSensorMeasure(size_t sens_index, double& out, double& timestamp) const = 0;
389 
398  virtual bool getTemperatureSensorMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
399 
400 
402 };
403 
416 {
417 public:
421  virtual size_t getNrOfSixAxisForceTorqueSensors() const = 0;
422 
426  virtual yarp::dev::MAS_status getSixAxisForceTorqueSensorStatus(size_t sens_index) const = 0;
427 
431  virtual bool getSixAxisForceTorqueSensorName(size_t sens_index, std::string &name) const = 0;
432 
436  virtual bool getSixAxisForceTorqueSensorFrameName(size_t sens_index, std::string &frameName) const = 0;
437 
446  virtual bool getSixAxisForceTorqueSensorMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
447 
449 };
450 
464 {
465 public:
469  virtual size_t getNrOfContactLoadCellArrays() const = 0;
470 
474  virtual yarp::dev::MAS_status getContactLoadCellArrayStatus(size_t sens_index) const = 0;
475 
480  virtual bool getContactLoadCellArrayName(size_t sens_index, std::string &name) const = 0;
481 
491  virtual bool getContactLoadCellArrayMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
492 
496  virtual size_t getContactLoadCellArraySize(size_t sens_index) const = 0;
497 
498 
500 };
501 
517 {
518 public:
522  virtual size_t getNrOfEncoderArrays() const = 0;
523 
527  virtual yarp::dev::MAS_status getEncoderArrayStatus(size_t sens_index) const = 0;
528 
532  virtual bool getEncoderArrayName(size_t sens_index, std::string &name) const = 0;
533 
542  virtual bool getEncoderArrayMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
543 
547  virtual size_t getEncoderArraySize(size_t sens_index) const = 0;
548 
549 
550  virtual ~IEncoderArrays(){}
551 };
552 
566 {
567 public:
571  virtual size_t getNrOfSkinPatches() const = 0;
572 
576  virtual yarp::dev::MAS_status getSkinPatchStatus(size_t sens_index) const = 0;
577 
581  virtual bool getSkinPatchName(size_t sens_index, std::string &name) const = 0;
582 
591  virtual bool getSkinPatchMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
592 
596  virtual size_t getSkinPatchSize(size_t sens_index) const = 0;
597 
598 
599  virtual ~ISkinPatches(){}
600 };
601 
602 #endif
contains the definition of a Vector type
Device interface to one or multiple contact load cell arrays.
virtual yarp::dev::MAS_status getContactLoadCellArrayStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual bool getContactLoadCellArrayName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual size_t getContactLoadCellArraySize(size_t sens_index) const =0
Get the size of the specified contact load cell array.
virtual bool getContactLoadCellArrayMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
virtual size_t getNrOfContactLoadCellArrays() const =0
Get the number of contact load cell array exposed by this device.
Device interface to one or multiple arrays of encoders.
virtual bool getEncoderArrayMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
virtual size_t getEncoderArraySize(size_t sens_index) const =0
Get the size of the specified encoder array.
virtual size_t getNrOfEncoderArrays() const =0
Get the number of encoder arrays exposed by this device.
virtual yarp::dev::MAS_status getEncoderArrayStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual bool getEncoderArrayName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
Device interface to one or multiple orientation sensors, such as IMUs with on board estimation algori...
virtual bool getOrientationSensorFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
virtual yarp::dev::MAS_status getOrientationSensorStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual bool getOrientationSensorName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual size_t getNrOfOrientationSensors() const =0
Get the number of orientation sensors exposed by this device.
virtual bool getOrientationSensorMeasureAsRollPitchYaw(size_t sens_index, yarp::sig::Vector &rpy, double &timestamp) const =0
Get the last reading of the orientation sensor as roll pitch yaw.
Device interface to one or multiple position sensors, such as UWB localization sensors.
virtual bool getPositionSensorMeasure(size_t sens_index, yarp::sig::Vector &xyz, double &timestamp) const =0
Get the last reading of the position sensor as x y z.
virtual bool getPositionSensorName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual size_t getNrOfPositionSensors() const =0
Get the number of position sensors exposed by this device.
virtual yarp::dev::MAS_status getPositionSensorStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual bool getPositionSensorFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
Device interface to one or multiple six axis force torque sensor.
virtual bool getSixAxisForceTorqueSensorFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
virtual size_t getNrOfSixAxisForceTorqueSensors() const =0
Get the number of six axis force torque sensors exposed by this device.
virtual yarp::dev::MAS_status getSixAxisForceTorqueSensorStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual bool getSixAxisForceTorqueSensorName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual bool getSixAxisForceTorqueSensorMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
Device interface to one or more groups (patches) of tactile sensors (skin).
virtual bool getSkinPatchName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual size_t getNrOfSkinPatches() const =0
Get the number of skin patches exposed by this device.
virtual size_t getSkinPatchSize(size_t sens_index) const =0
Get the size of the specified skin patch.
virtual yarp::dev::MAS_status getSkinPatchStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual bool getSkinPatchMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
Device interface to one or multiple temperature sensors.
virtual bool getTemperatureSensorFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
virtual bool getTemperatureSensorName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual yarp::dev::MAS_status getTemperatureSensorStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual bool getTemperatureSensorMeasure(size_t sens_index, double &out, double &timestamp) const =0
Get the last reading of the specified sensor.
virtual size_t getNrOfTemperatureSensors() const =0
Get the number of temperature sensors exposed by this device.
virtual bool getTemperatureSensorMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
Device interface to one or multiple three axis gyroscopes.
virtual yarp::dev::MAS_status getThreeAxisGyroscopeStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual bool getThreeAxisGyroscopeName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual size_t getNrOfThreeAxisGyroscopes() const =0
Get the number of three axis gyroscopes exposed by this sensor.
virtual bool getThreeAxisGyroscopeFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
virtual bool getThreeAxisGyroscopeMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the gyroscope.
Device interface to one or multiple three axis linear accelerometers.
virtual bool getThreeAxisLinearAccelerometerName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual size_t getNrOfThreeAxisLinearAccelerometers() const =0
Get the number of three axis linear accelerometers exposed by this device.
virtual bool getThreeAxisLinearAccelerometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
virtual yarp::dev::MAS_status getThreeAxisLinearAccelerometerStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual bool getThreeAxisLinearAccelerometerFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
Device interface to one or multiple three axis magnetometers.
virtual bool getThreeAxisMagnetometerName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual size_t getNrOfThreeAxisMagnetometers() const =0
Get the number of magnetometers exposed by this device.
virtual yarp::dev::MAS_status getThreeAxisMagnetometerStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual bool getThreeAxisMagnetometerFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
virtual bool getThreeAxisMagnetometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
MAS_status
Status of a given analog sensor exposed by a multiple analog sensors interface.
@ MAS_UNKNOWN
The sensor is in an unknown state.
@ MAS_TIMEOUT
The sensor is read through the network, and the latest measurement was received before an implementat...
@ MAS_ERROR
The sensor is in generic error state.
@ MAS_WAITING_FOR_FIRST_READ
The sensor is read through the network, and the device is waiting to receive the first measurement.
@ MAS_OK
The sensor is working correctly.
@ MAS_OVF
The sensor reached an overflow.
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18