YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
MultipleAnalogSensorsClient.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_MULTIPLEANALOGSENSORSCLIENT_MULTIPLEANALOGSENSORSCLIENT_H
7#define YARP_DEV_MULTIPLEANALOGSENSORSCLIENT_MULTIPLEANALOGSENSORSCLIENT_H
8
10
12#include "SensorStreamingData.h"
13
15#include <yarp/os/Network.h>
17
19
20#include <mutex>
21
22
37
61{
62 SensorStreamingDataInputPort m_streamingPort;
63 yarp::os::Port m_rpcPort;
64
65 MultipleAnalogSensorsMetadata m_RPCInterface;
66 SensorRPCData m_sensorsMetadata;
67
68 size_t genericGetNrOfSensors(const std::vector<SensorMetadata>& metadataVector,
69 const SensorMeasurements& measurementsVector) const;
70 yarp::dev::MAS_status genericGetStatus() const;
71 bool genericGetName(const std::vector<SensorMetadata>& metadataVector, const std::string& tag,
72 size_t sens_index, std::string &name) const;
73 bool genericGetFrameName(const std::vector<SensorMetadata>& metadataVector, const std::string& tag,
74 size_t sens_index, std::string &frameName) const;
75 bool genericGetMeasure(const std::vector<SensorMetadata>& metadataVector, const std::string& tag,
76 const SensorMeasurements& measurementsVector,
77 size_t sens_index, yarp::sig::Vector& out, double& timestamp) const;
78 size_t genericGetSize(const std::vector<SensorMetadata>& metadataVector,
79 const std::string& tag, const SensorMeasurements& measurementsVector, size_t sens_index) const;
80
81
82public:
83 /* DevideDriver methods */
84 bool open(yarp::os::Searchable& config) override;
85 bool close() override;
86
87 /* IThreeAxisGyroscopes methods */
88 size_t getNrOfThreeAxisGyroscopes() const override;
89 yarp::dev::MAS_status getThreeAxisGyroscopeStatus(size_t sens_index) const override;
90 bool getThreeAxisGyroscopeName(size_t sens_index, std::string &name) const override;
91 bool getThreeAxisGyroscopeFrameName(size_t sens_index, std::string &frameName) const override;
92 bool getThreeAxisGyroscopeMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
93
94 /* IThreeAxisLinearAccelerometers methods */
95 size_t getNrOfThreeAxisLinearAccelerometers() const override;
96 yarp::dev::MAS_status getThreeAxisLinearAccelerometerStatus(size_t sens_index) const override;
97 bool getThreeAxisLinearAccelerometerName(size_t sens_index, std::string &name) const override;
98 bool getThreeAxisLinearAccelerometerFrameName(size_t sens_index, std::string &frameName) const override;
99 bool getThreeAxisLinearAccelerometerMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
100
101 /* IThreeAxisAngularAccelerometers methods */
102 size_t getNrOfThreeAxisAngularAccelerometers() const override;
103 yarp::dev::MAS_status getThreeAxisAngularAccelerometerStatus(size_t sens_index) const override;
104 bool getThreeAxisAngularAccelerometerName(size_t sens_index, std::string &name) const override;
105 bool getThreeAxisAngularAccelerometerFrameName(size_t sens_index, std::string &frameName) const override;
106 bool getThreeAxisAngularAccelerometerMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
107
108 /* IThreeAxisMagnetometers methods */
109 size_t getNrOfThreeAxisMagnetometers() const override;
110 yarp::dev::MAS_status getThreeAxisMagnetometerStatus(size_t sens_index) const override;
111 bool getThreeAxisMagnetometerName(size_t sens_index, std::string &name) const override;
112 bool getThreeAxisMagnetometerFrameName(size_t sens_index, std::string &frameName) const override;
113 bool getThreeAxisMagnetometerMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
114
115 /* IPositionSensors methods */
116 size_t getNrOfPositionSensors() const override;
117 yarp::dev::MAS_status getPositionSensorStatus(size_t sens_index) const override;
118 bool getPositionSensorName(size_t sens_index, std::string& name) const override;
119 bool getPositionSensorFrameName(size_t sens_index, std::string& frameName) const override;
120 bool getPositionSensorMeasure(size_t sens_index, yarp::sig::Vector& xyz, double& timestamp) const override;
121
122 /* ILinearVelocitySensors methods */
123 size_t getNrOfLinearVelocitySensors() const override;
124 yarp::dev::MAS_status getLinearVelocitySensorStatus(size_t sens_index) const override;
125 bool getLinearVelocitySensorName(size_t sens_index, std::string& name) const override;
126 bool getLinearVelocitySensorFrameName(size_t sens_index, std::string& frameName) const override;
127 bool getLinearVelocitySensorMeasure(size_t sens_index, yarp::sig::Vector& xyz, double& timestamp) const override;
128
129 /* IOrientationSensors methods */
130 size_t getNrOfOrientationSensors() const override;
131 yarp::dev::MAS_status getOrientationSensorStatus(size_t sens_index) const override;
132 bool getOrientationSensorName(size_t sens_index, std::string &name) const override;
133 bool getOrientationSensorFrameName(size_t sens_index, std::string &frameName) const override;
134 bool getOrientationSensorMeasureAsRollPitchYaw(size_t sens_index, yarp::sig::Vector& rpy, double& timestamp) const override;
135
136 /* ITemperatureSensors methods */
137 size_t getNrOfTemperatureSensors() const override;
138 yarp::dev::MAS_status getTemperatureSensorStatus(size_t sens_index) const override;
139 bool getTemperatureSensorName(size_t sens_index, std::string &name) const override;
140 bool getTemperatureSensorFrameName(size_t sens_index, std::string &frameName) const override;
141 bool getTemperatureSensorMeasure(size_t sens_index, double& out, double& timestamp) const override;
142 bool getTemperatureSensorMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
143
144 /* ISixAxisForceTorqueSensors */
145 size_t getNrOfSixAxisForceTorqueSensors() const override;
146 yarp::dev::MAS_status getSixAxisForceTorqueSensorStatus(size_t sens_index) const override;
147 bool getSixAxisForceTorqueSensorName(size_t sens_index, std::string &name) const override;
148 bool getSixAxisForceTorqueSensorFrameName(size_t sens_index, std::string &frame) const override;
149 bool getSixAxisForceTorqueSensorMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
150
151 /* IContactLoadCellArrays */
152 size_t getNrOfContactLoadCellArrays() const override;
153 yarp::dev::MAS_status getContactLoadCellArrayStatus(size_t sens_index) const override;
154 bool getContactLoadCellArrayName(size_t sens_index, std::string &name) const override;
155 bool getContactLoadCellArrayMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
156 size_t getContactLoadCellArraySize(size_t sens_index) const override;
157
158 /* IEncoderArrays */
159 size_t getNrOfEncoderArrays() const override;
160 yarp::dev::MAS_status getEncoderArrayStatus(size_t sens_index) const override;
161 bool getEncoderArrayName(size_t sens_index, std::string &name) const override;
162 bool getEncoderArrayMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
163 size_t getEncoderArraySize(size_t sens_index) const override;
164
165 /* ISkinPatches */
166 size_t getNrOfSkinPatches() const override;
167 yarp::dev::MAS_status getSkinPatchStatus(size_t sens_index) const override;
168 bool getSkinPatchName(size_t sens_index, std::string &name) const override;
169 bool getSkinPatchMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
170 size_t getSkinPatchSize(size_t sens_index) const override;
171};
172
173#endif
This class is the parameters parser for class MultipleAnalogSensorsClient.
multipleanalogsensorsclient: The client side of a device exposing MultipleAnalogSensors interfaces.
yarp::dev::MAS_status getContactLoadCellArrayStatus(size_t sens_index) const override
Get the status of the specified sensor.
size_t getNrOfPositionSensors() const override
Get the number of position sensors exposed by this device.
yarp::dev::MAS_status getPositionSensorStatus(size_t sens_index) const override
Get the status of the specified sensor.
bool getPositionSensorName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
bool getSkinPatchName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
bool getThreeAxisLinearAccelerometerFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
size_t getNrOfLinearVelocitySensors() const override
Get the number of linear velocity sensors exposed by this device.
yarp::dev::MAS_status getThreeAxisMagnetometerStatus(size_t sens_index) const override
Get the status of the specified sensor.
bool getTemperatureSensorFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
yarp::dev::MAS_status getThreeAxisAngularAccelerometerStatus(size_t sens_index) const override
Get the status of the specified sensor.
yarp::dev::MAS_status getSixAxisForceTorqueSensorStatus(size_t sens_index) const override
Get the status of the specified sensor.
bool getThreeAxisAngularAccelerometerFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
bool getThreeAxisLinearAccelerometerName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
bool getThreeAxisGyroscopeFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
bool getEncoderArrayName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
bool getThreeAxisAngularAccelerometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the specified sensor.
bool getPositionSensorMeasure(size_t sens_index, yarp::sig::Vector &xyz, double &timestamp) const override
Get the last reading of the position sensor as x y z.
yarp::dev::MAS_status getSkinPatchStatus(size_t sens_index) const override
Get the status of the specified sensor.
bool getThreeAxisLinearAccelerometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the specified sensor.
size_t getNrOfTemperatureSensors() const override
Get the number of temperature sensors exposed by this device.
size_t getNrOfThreeAxisAngularAccelerometers() const override
Get the number of three axis angular accelerometers exposed by this device.
bool getLinearVelocitySensorMeasure(size_t sens_index, yarp::sig::Vector &xyz, double &timestamp) const override
Get the last reading of the linear velocity sensor as x y z.
size_t getEncoderArraySize(size_t sens_index) const override
Get the size of the specified encoder array.
size_t getNrOfEncoderArrays() const override
Get the number of encoder arrays exposed by this device.
bool getSixAxisForceTorqueSensorMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the specified sensor.
bool getThreeAxisAngularAccelerometerName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
bool getLinearVelocitySensorName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
yarp::dev::MAS_status getThreeAxisGyroscopeStatus(size_t sens_index) const override
Get the status of the specified sensor.
size_t getContactLoadCellArraySize(size_t sens_index) const override
Get the size of the specified contact load cell array.
size_t getNrOfSixAxisForceTorqueSensors() const override
Get the number of six axis force torque sensors exposed by this device.
bool getTemperatureSensorMeasure(size_t sens_index, double &out, double &timestamp) const override
Get the last reading of the specified sensor.
size_t getSkinPatchSize(size_t sens_index) const override
Get the size of the specified skin patch.
size_t getNrOfThreeAxisLinearAccelerometers() const override
Get the number of three axis linear accelerometers exposed by this device.
yarp::dev::MAS_status getLinearVelocitySensorStatus(size_t sens_index) const override
Get the status of the specified sensor.
bool close() override
Close the DeviceDriver.
yarp::dev::MAS_status getThreeAxisLinearAccelerometerStatus(size_t sens_index) const override
Get the status of the specified sensor.
bool getLinearVelocitySensorFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
bool getThreeAxisMagnetometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the specified sensor.
yarp::dev::MAS_status getOrientationSensorStatus(size_t sens_index) const override
Get the status of the specified sensor.
bool getEncoderArrayMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the specified sensor.
bool getOrientationSensorMeasureAsRollPitchYaw(size_t sens_index, yarp::sig::Vector &rpy, double &timestamp) const override
Get the last reading of the orientation sensor as roll pitch yaw.
bool getThreeAxisGyroscopeMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the gyroscope.
bool getContactLoadCellArrayName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
yarp::dev::MAS_status getEncoderArrayStatus(size_t sens_index) const override
Get the status of the specified sensor.
bool getContactLoadCellArrayMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the specified sensor.
bool getThreeAxisGyroscopeName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
bool getOrientationSensorName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
bool getPositionSensorFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
bool getTemperatureSensorName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
bool getThreeAxisMagnetometerName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
bool getOrientationSensorFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
bool getSixAxisForceTorqueSensorFrameName(size_t sens_index, std::string &frame) const override
Get the name of the frame of the specified sensor.
size_t getNrOfThreeAxisGyroscopes() const override
Get the number of three axis gyroscopes exposed by this sensor.
size_t getNrOfThreeAxisMagnetometers() const override
Get the number of magnetometers exposed by this device.
size_t getNrOfOrientationSensors() const override
Get the number of orientation sensors exposed by this device.
yarp::dev::MAS_status getTemperatureSensorStatus(size_t sens_index) const override
Get the status of the specified sensor.
bool getSkinPatchMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the specified sensor.
size_t getNrOfSkinPatches() const override
Get the number of skin patches exposed by this device.
size_t getNrOfContactLoadCellArrays() const override
Get the number of contact load cell array exposed by this device.
bool getThreeAxisMagnetometerFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
bool getSixAxisForceTorqueSensorName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
void onRead(SensorStreamingData &v) override
Interface implemented by all device drivers.
Device interface to one or multiple contact load cell arrays.
Device interface to one or multiple arrays of encoders.
Device interface to one or multiple orientation sensors, such as IMUs with on board estimation algori...
Device interface to one or multiple position sensors, such as UWB localization sensors.
Device interface to one or multiple six axis force torque sensor.
Device interface to one or more groups (patches) of tactile sensors (skin).
Device interface to one or multiple temperature sensors.
Device interface to one or multiple three axis gyroscopes.
Device interface to one or multiple three axis linear accelerometers.
Device interface to one or multiple three axis magnetometers.
A mini-server for performing network communication in the background.
A mini-server for network communication.
Definition Port.h:46
A base class for nested structures that can be searched.
Definition Searchable.h:31
MAS_status
Status of a given analog sensor exposed by a multiple analog sensors interface.
@ MAS_WAITING_FOR_FIRST_READ
The sensor is read through the network, and the device is waiting to receive the first measurement.