YARP
Yet Another Robot Platform
MultipleAnalogSensorsInterfaces.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_DEV_MULTIPLEANALOGSENSORSINTERFACES_H
10 #define YARP_DEV_MULTIPLEANALOGSENSORSINTERFACES_H
11 
12 #include <cassert>
13 #include <string>
14 
15 #include <yarp/dev/api.h>
16 #include <yarp/sig/Vector.h>
17 
18 namespace yarp
19 {
20  namespace dev
21  {
22  class IThreeAxisGyroscopes;
23  class IThreeAxisLinearAccelerometers;
24  class IThreeAxisMagnetometers;
25  class IPositionSensors;
26  class IOrientationSensors;
27  class ITemperatureSensors;
28  class ISixAxisForceTorqueSensors;
29  class IContactLoadCellArrays;
30  class IEncoderArrays;
31  class ISkinPatches;
32 
37  {
38  MAS_OK=0,
40  MAS_OVF=2,
43  MAS_UNKNOWN=5
44  };
45  }
46 }
47 
64 {
65 public:
69  virtual size_t getNrOfThreeAxisGyroscopes() const = 0;
70 
76  virtual yarp::dev::MAS_status getThreeAxisGyroscopeStatus(size_t sens_index) const = 0;
77 
84  virtual bool getThreeAxisGyroscopeName(size_t sens_index, std::string &name) const = 0;
85 
92  virtual bool getThreeAxisGyroscopeFrameName(size_t sens_index, std::string &frameName) const = 0;
93 
102  virtual bool getThreeAxisGyroscopeMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
103 
105 };
106 
107 
118 {
119 public:
123  virtual size_t getNrOfThreeAxisLinearAccelerometers() const = 0;
124 
128  virtual yarp::dev::MAS_status getThreeAxisLinearAccelerometerStatus(size_t sens_index) const = 0;
129 
134  virtual bool getThreeAxisLinearAccelerometerName(size_t sens_index, std::string &name) const = 0;
135 
140  virtual bool getThreeAxisLinearAccelerometerFrameName(size_t sens_index, std::string &frameName) const = 0;
141 
150  virtual bool getThreeAxisLinearAccelerometerMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
151 
153 };
154 
165 {
166 public:
170  virtual size_t getNrOfThreeAxisMagnetometers() const = 0;
171 
175  virtual yarp::dev::MAS_status getThreeAxisMagnetometerStatus(size_t sens_index) const = 0;
176 
181  virtual bool getThreeAxisMagnetometerName(size_t sens_index, std::string &name) const = 0;
182 
187  virtual bool getThreeAxisMagnetometerFrameName(size_t sens_index, std::string &frameName) const = 0;
188 
197  virtual bool getThreeAxisMagnetometerMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
198 
200 };
201 
216 {
217 public:
221  virtual size_t getNrOfPositionSensors() const = 0;
222 
226  virtual yarp::dev::MAS_status getPositionSensorStatus(size_t sens_index) const = 0;
227 
232  virtual bool getPositionSensorName(size_t sens_index, std::string& name) const = 0;
233 
242  virtual bool getPositionSensorFrameName(size_t sens_index, std::string& frameName) const = 0;
243 
252  virtual bool getPositionSensorMeasure(size_t sens_index, yarp::sig::Vector& xyz, double& timestamp) const = 0;
253 
255  {
256  }
257 };
258 
274 {
275 public:
279  virtual size_t getNrOfOrientationSensors() const = 0;
280 
284  virtual yarp::dev::MAS_status getOrientationSensorStatus(size_t sens_index) const = 0;
285 
290  virtual bool getOrientationSensorName(size_t sens_index, std::string &name) const = 0;
291 
300  virtual bool getOrientationSensorFrameName(size_t sens_index, std::string &frameName) const = 0;
301 
349  virtual bool getOrientationSensorMeasureAsRollPitchYaw(size_t sens_index, yarp::sig::Vector& rpy, double& timestamp) const = 0;
350 
352 };
353 
354 
365 {
366 public:
370  virtual size_t getNrOfTemperatureSensors() const = 0;
371 
375  virtual yarp::dev::MAS_status getTemperatureSensorStatus(size_t sens_index) const = 0;
376 
380  virtual bool getTemperatureSensorName(size_t sens_index, std::string &name) const = 0;
381 
385  virtual bool getTemperatureSensorFrameName(size_t sens_index, std::string &frameName) const = 0;
386 
391  virtual bool getTemperatureSensorMeasure(size_t sens_index, double& out, double& timestamp) const = 0;
392 
401  virtual bool getTemperatureSensorMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
402 
403 
405 };
406 
419 {
420 public:
424  virtual size_t getNrOfSixAxisForceTorqueSensors() const = 0;
425 
429  virtual yarp::dev::MAS_status getSixAxisForceTorqueSensorStatus(size_t sens_index) const = 0;
430 
434  virtual bool getSixAxisForceTorqueSensorName(size_t sens_index, std::string &name) const = 0;
435 
439  virtual bool getSixAxisForceTorqueSensorFrameName(size_t sens_index, std::string &frameName) const = 0;
440 
449  virtual bool getSixAxisForceTorqueSensorMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
450 
452 };
453 
467 {
468 public:
472  virtual size_t getNrOfContactLoadCellArrays() const = 0;
473 
477  virtual yarp::dev::MAS_status getContactLoadCellArrayStatus(size_t sens_index) const = 0;
478 
483  virtual bool getContactLoadCellArrayName(size_t sens_index, std::string &name) const = 0;
484 
494  virtual bool getContactLoadCellArrayMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
495 
499  virtual size_t getContactLoadCellArraySize(size_t sens_index) const = 0;
500 
501 
503 };
504 
520 {
521 public:
525  virtual size_t getNrOfEncoderArrays() const = 0;
526 
530  virtual yarp::dev::MAS_status getEncoderArrayStatus(size_t sens_index) const = 0;
531 
535  virtual bool getEncoderArrayName(size_t sens_index, std::string &name) const = 0;
536 
545  virtual bool getEncoderArrayMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
546 
550  virtual size_t getEncoderArraySize(size_t sens_index) const = 0;
551 
552 
553  virtual ~IEncoderArrays(){}
554 };
555 
569 {
570 public:
574  virtual size_t getNrOfSkinPatches() const = 0;
575 
579  virtual yarp::dev::MAS_status getSkinPatchStatus(size_t sens_index) const = 0;
580 
584  virtual bool getSkinPatchName(size_t sens_index, std::string &name) const = 0;
585 
594  virtual bool getSkinPatchMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const = 0;
595 
599  virtual size_t getSkinPatchSize(size_t sens_index) const = 0;
600 
601 
602  virtual ~ISkinPatches(){}
603 };
604 
605 #endif
yarp::dev::IThreeAxisLinearAccelerometers::getThreeAxisLinearAccelerometerFrameName
virtual bool getThreeAxisLinearAccelerometerFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
yarp::dev::ISixAxisForceTorqueSensors::getSixAxisForceTorqueSensorStatus
virtual yarp::dev::MAS_status getSixAxisForceTorqueSensorStatus(size_t sens_index) const =0
Get the status of the specified sensor.
yarp::dev::ISixAxisForceTorqueSensors::getSixAxisForceTorqueSensorName
virtual bool getSixAxisForceTorqueSensorName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
yarp::dev::IContactLoadCellArrays::getContactLoadCellArraySize
virtual size_t getContactLoadCellArraySize(size_t sens_index) const =0
Get the size of the specified contact load cell array.
yarp::dev::ISkinPatches::getSkinPatchStatus
virtual yarp::dev::MAS_status getSkinPatchStatus(size_t sens_index) const =0
Get the status of the specified sensor.
Vector.h
contains the definition of a Vector type
yarp::dev::IThreeAxisGyroscopes::getThreeAxisGyroscopeMeasure
virtual bool getThreeAxisGyroscopeMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the gyroscope.
yarp::dev::MAS_OVF
@ MAS_OVF
The sensor reached an overflow.
Definition: MultipleAnalogSensorsInterfaces.h:40
yarp::dev::MAS_WAITING_FOR_FIRST_READ
@ MAS_WAITING_FOR_FIRST_READ
The sensor is read through the network, and the device is waiting to receive the first measurement.
Definition: MultipleAnalogSensorsInterfaces.h:42
yarp::dev::ISkinPatches::getSkinPatchMeasure
virtual bool getSkinPatchMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
yarp::dev::IPositionSensors::getPositionSensorFrameName
virtual bool getPositionSensorFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
yarp::dev::IEncoderArrays::getEncoderArraySize
virtual size_t getEncoderArraySize(size_t sens_index) const =0
Get the size of the specified encoder array.
yarp::dev::IThreeAxisMagnetometers
Device interface to one or multiple three axis magnetometers.
Definition: MultipleAnalogSensorsInterfaces.h:165
yarp::dev::IThreeAxisGyroscopes
Device interface to one or multiple three axis gyroscopes.
Definition: MultipleAnalogSensorsInterfaces.h:64
yarp::dev::IOrientationSensors
Device interface to one or multiple orientation sensors, such as IMUs with on board estimation algori...
Definition: MultipleAnalogSensorsInterfaces.h:274
yarp::dev::IThreeAxisGyroscopes::getThreeAxisGyroscopeName
virtual bool getThreeAxisGyroscopeName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
yarp::dev::ISixAxisForceTorqueSensors::~ISixAxisForceTorqueSensors
virtual ~ISixAxisForceTorqueSensors()
Definition: MultipleAnalogSensorsInterfaces.h:451
yarp::dev::IEncoderArrays::getNrOfEncoderArrays
virtual size_t getNrOfEncoderArrays() const =0
Get the number of encoder arrays exposed by this device.
yarp::dev::IThreeAxisMagnetometers::getNrOfThreeAxisMagnetometers
virtual size_t getNrOfThreeAxisMagnetometers() const =0
Get the number of magnetometers exposed by this device.
yarp::dev::IContactLoadCellArrays::~IContactLoadCellArrays
virtual ~IContactLoadCellArrays()
Definition: MultipleAnalogSensorsInterfaces.h:502
yarp::dev::IContactLoadCellArrays::getContactLoadCellArrayStatus
virtual yarp::dev::MAS_status getContactLoadCellArrayStatus(size_t sens_index) const =0
Get the status of the specified sensor.
yarp::dev::IEncoderArrays::getEncoderArrayName
virtual bool getEncoderArrayName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
yarp::dev::MAS_UNKNOWN
@ MAS_UNKNOWN
The sensor is in an unknown state.
Definition: MultipleAnalogSensorsInterfaces.h:43
yarp::dev::IPositionSensors::getPositionSensorMeasure
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.
yarp::sig::VectorOf< double >
yarp::dev::ISkinPatches
Device interface to one or more groups (patches) of tactile sensors (skin).
Definition: MultipleAnalogSensorsInterfaces.h:569
yarp::dev::ISixAxisForceTorqueSensors
Device interface to one or multiple six axis force torque sensor.
Definition: MultipleAnalogSensorsInterfaces.h:419
yarp::dev::IPositionSensors::getPositionSensorStatus
virtual yarp::dev::MAS_status getPositionSensorStatus(size_t sens_index) const =0
Get the status of the specified sensor.
yarp::dev::IPositionSensors::~IPositionSensors
virtual ~IPositionSensors()
Definition: MultipleAnalogSensorsInterfaces.h:254
yarp::dev::IOrientationSensors::getOrientationSensorFrameName
virtual bool getOrientationSensorFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
yarp::dev::ISixAxisForceTorqueSensors::getSixAxisForceTorqueSensorMeasure
virtual bool getSixAxisForceTorqueSensorMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
yarp::dev::IThreeAxisMagnetometers::~IThreeAxisMagnetometers
virtual ~IThreeAxisMagnetometers()
Definition: MultipleAnalogSensorsInterfaces.h:199
yarp::dev::ITemperatureSensors::getTemperatureSensorMeasure
virtual bool getTemperatureSensorMeasure(size_t sens_index, double &out, double &timestamp) const =0
Get the last reading of the specified sensor.
yarp::dev::IThreeAxisLinearAccelerometers
Device interface to one or multiple three axis linear accelerometers.
Definition: MultipleAnalogSensorsInterfaces.h:118
yarp::dev::IOrientationSensors::~IOrientationSensors
virtual ~IOrientationSensors()
Definition: MultipleAnalogSensorsInterfaces.h:351
yarp::dev::ITemperatureSensors::getNrOfTemperatureSensors
virtual size_t getNrOfTemperatureSensors() const =0
Get the number of temperature sensors exposed by this device.
yarp::dev::IContactLoadCellArrays::getContactLoadCellArrayName
virtual bool getContactLoadCellArrayName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
yarp::dev::IThreeAxisMagnetometers::getThreeAxisMagnetometerStatus
virtual yarp::dev::MAS_status getThreeAxisMagnetometerStatus(size_t sens_index) const =0
Get the status of the specified sensor.
yarp::dev::IOrientationSensors::getOrientationSensorName
virtual bool getOrientationSensorName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
yarp::dev::IThreeAxisMagnetometers::getThreeAxisMagnetometerName
virtual bool getThreeAxisMagnetometerName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
yarp::dev::IEncoderArrays
Device interface to one or multiple arrays of encoders.
Definition: MultipleAnalogSensorsInterfaces.h:520
yarp::dev::IPositionSensors::getNrOfPositionSensors
virtual size_t getNrOfPositionSensors() const =0
Get the number of position sensors exposed by this device.
yarp::dev::ISkinPatches::getSkinPatchSize
virtual size_t getSkinPatchSize(size_t sens_index) const =0
Get the size of the specified skin patch.
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::IContactLoadCellArrays::getNrOfContactLoadCellArrays
virtual size_t getNrOfContactLoadCellArrays() const =0
Get the number of contact load cell array exposed by this device.
yarp::dev::IThreeAxisMagnetometers::getThreeAxisMagnetometerMeasure
virtual bool getThreeAxisMagnetometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
yarp::dev::IThreeAxisGyroscopes::getThreeAxisGyroscopeStatus
virtual yarp::dev::MAS_status getThreeAxisGyroscopeStatus(size_t sens_index) const =0
Get the status of the specified sensor.
yarp::dev::IOrientationSensors::getOrientationSensorMeasureAsRollPitchYaw
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.
yarp::dev::ISkinPatches::getSkinPatchName
virtual bool getSkinPatchName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
yarp::dev::ITemperatureSensors::getTemperatureSensorStatus
virtual yarp::dev::MAS_status getTemperatureSensorStatus(size_t sens_index) const =0
Get the status of the specified sensor.
yarp::dev::ISixAxisForceTorqueSensors::getSixAxisForceTorqueSensorFrameName
virtual bool getSixAxisForceTorqueSensorFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
yarp::dev::IThreeAxisGyroscopes::getThreeAxisGyroscopeFrameName
virtual bool getThreeAxisGyroscopeFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
yarp::dev::ISixAxisForceTorqueSensors::getNrOfSixAxisForceTorqueSensors
virtual size_t getNrOfSixAxisForceTorqueSensors() const =0
Get the number of six axis force torque sensors exposed by this device.
yarp::dev::IEncoderArrays::~IEncoderArrays
virtual ~IEncoderArrays()
Definition: MultipleAnalogSensorsInterfaces.h:553
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::dev::MAS_status
MAS_status
Status of a given analog sensor exposed by a multiple analog sensors interface.
Definition: MultipleAnalogSensorsInterfaces.h:37
yarp::dev::ITemperatureSensors::getTemperatureSensorMeasure
virtual bool getTemperatureSensorMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
yarp::dev::ITemperatureSensors
Device interface to one or multiple temperature sensors.
Definition: MultipleAnalogSensorsInterfaces.h:365
yarp::dev::IPositionSensors
Device interface to one or multiple position sensors, such as UWB localization sensors.
Definition: MultipleAnalogSensorsInterfaces.h:216
yarp::dev::ISkinPatches::~ISkinPatches
virtual ~ISkinPatches()
Definition: MultipleAnalogSensorsInterfaces.h:602
yarp::dev::IThreeAxisLinearAccelerometers::getThreeAxisLinearAccelerometerStatus
virtual yarp::dev::MAS_status getThreeAxisLinearAccelerometerStatus(size_t sens_index) const =0
Get the status of the specified sensor.
yarp::dev::MAS_TIMEOUT
@ MAS_TIMEOUT
The sensor is read through the network, and the latest measurement was received before an implementat...
Definition: MultipleAnalogSensorsInterfaces.h:41
yarp::dev::IOrientationSensors::getNrOfOrientationSensors
virtual size_t getNrOfOrientationSensors() const =0
Get the number of orientation sensors exposed by this device.
yarp::dev::IThreeAxisGyroscopes::~IThreeAxisGyroscopes
virtual ~IThreeAxisGyroscopes()
Definition: MultipleAnalogSensorsInterfaces.h:104
yarp::dev::IThreeAxisLinearAccelerometers::~IThreeAxisLinearAccelerometers
virtual ~IThreeAxisLinearAccelerometers()
Definition: MultipleAnalogSensorsInterfaces.h:152
yarp::dev::MAS_ERROR
@ MAS_ERROR
The sensor is in generic error state.
Definition: MultipleAnalogSensorsInterfaces.h:39
yarp::dev::IThreeAxisGyroscopes::getNrOfThreeAxisGyroscopes
virtual size_t getNrOfThreeAxisGyroscopes() const =0
Get the number of three axis gyroscopes exposed by this sensor.
yarp::dev::IEncoderArrays::getEncoderArrayStatus
virtual yarp::dev::MAS_status getEncoderArrayStatus(size_t sens_index) const =0
Get the status of the specified sensor.
yarp::dev::ITemperatureSensors::getTemperatureSensorName
virtual bool getTemperatureSensorName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
yarp::dev::IThreeAxisLinearAccelerometers::getThreeAxisLinearAccelerometerName
virtual bool getThreeAxisLinearAccelerometerName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
yarp::dev::IOrientationSensors::getOrientationSensorStatus
virtual yarp::dev::MAS_status getOrientationSensorStatus(size_t sens_index) const =0
Get the status of the specified sensor.
yarp::dev::ISkinPatches::getNrOfSkinPatches
virtual size_t getNrOfSkinPatches() const =0
Get the number of skin patches exposed by this device.
yarp::dev::IContactLoadCellArrays::getContactLoadCellArrayMeasure
virtual bool getContactLoadCellArrayMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
yarp::dev::IThreeAxisLinearAccelerometers::getThreeAxisLinearAccelerometerMeasure
virtual bool getThreeAxisLinearAccelerometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
yarp::dev::IPositionSensors::getPositionSensorName
virtual bool getPositionSensorName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
yarp::dev::ITemperatureSensors::getTemperatureSensorFrameName
virtual bool getTemperatureSensorFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
yarp::dev::ITemperatureSensors::~ITemperatureSensors
virtual ~ITemperatureSensors()
Definition: MultipleAnalogSensorsInterfaces.h:404
api.h
yarp::dev::IEncoderArrays::getEncoderArrayMeasure
virtual bool getEncoderArrayMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
yarp::dev::IContactLoadCellArrays
Device interface to one or multiple contact load cell arrays.
Definition: MultipleAnalogSensorsInterfaces.h:467
yarp::dev::IThreeAxisLinearAccelerometers::getNrOfThreeAxisLinearAccelerometers
virtual size_t getNrOfThreeAxisLinearAccelerometers() const =0
Get the number of three axis linear accelerometers exposed by this device.
yarp::dev::IThreeAxisMagnetometers::getThreeAxisMagnetometerFrameName
virtual bool getThreeAxisMagnetometerFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
yarp::dev::MAS_OK
@ MAS_OK
The sensor is working correctly.
Definition: MultipleAnalogSensorsInterfaces.h:38