YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
MultipleAnalogSensorsRemapper.cpp
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
7
8#include <map>
9
11#include <yarp/os/LogStream.h>
12#include <yarp/os/Searchable.h>
13
14using namespace yarp::os;
15using namespace yarp::dev;
16
17namespace {
18YARP_LOG_COMPONENT(MULTIPLEANALOGSENSORSREMAPPER, "yarp.device.multipleanalogsensorsremapper")
19}
20
21const size_t MAS_NrOfSensorTypes{12};
22static_assert(MAS_SensorType::ThreeAxisAngularAccelerometers+1 == MAS_NrOfSensorTypes, "Consistency error between MAS_NrOfSensorTypes and MAS_SensorType");
23
27inline std::string MAS_getTagFromEnum(const MAS_SensorType type)
28{
29 switch(type)
30 {
32 return "ThreeAxisGyroscopes";
33 break;
35 return "ThreeAxisLinearAccelerometers";
36 break;
38 return "ThreeAxisAngularAccelerometers";
39 break;
41 return "ThreeAxisMagnetometers";
42 break;
44 return "OrientationSensors";
45 break;
47 return "TemperatureSensors";
48 break;
50 return "SixAxisForceTorqueSensors";
51 break;
53 return "ContactLoadCellArrays";
54 break;
55 case EncoderArrays:
56 return "EncoderArrays";
57 break;
58 case SkinPatches:
59 return "SkinPatches";
60 break;
61 case PositionSensors:
62 return "PositionSensors";
63 break;
65 return "LinearVelocitySensors";
66 break;
67 default:
68 assert(false);
69 return "MAS_getTagFromEnum_notExpectedEnum";
70 break;
71 }
72}
73
78
80{
81 Property prop;
82 prop.fromString(config.toString());
83
84 m_verbose = (prop.check("verbose","if present, give detailed output"));
85 if (m_verbose)
86 {
87 yCInfo(MULTIPLEANALOGSENSORSREMAPPER, "Running with verbose output\n");
88 }
89
90 if(!parseOptions(prop))
91 {
92 return false;
93 }
94
95 return true;
96}
97
98// Return an empty list if the key is not found, and an error (false) if the key was found but it is not a list of strings
99bool getVectorOfStringFromListInConfig(const std::string& key, const yarp::os::Searchable& config, std::vector<std::string> & vectorOfStrings)
100{
102 prop.fromString(config.toString());
103 bool keyExists = prop.check(key);
104
106 if (!propList && keyExists)
107 {
108 yCError(MULTIPLEANALOGSENSORSREMAPPER) << "Error parsing parameters: if present " << key << " should be followed by a list of strings.\n";
109 return false;
110 }
111
112 if (!propList && !keyExists)
113 {
114 vectorOfStrings.resize(0);
115 return true;
116 }
117
118 vectorOfStrings.resize(propList->size());
119 for (size_t ax=0; ax < propList->size(); ax++)
120 {
121 vectorOfStrings[ax] = propList->get(ax).asString();
122 }
123
124 return true;
125}
126
127bool MultipleAnalogSensorsRemapper::parseOptions(const Property& prop)
128{
129 bool ok = true;
130
131 m_remappedSensors.resize(MAS_NrOfSensorTypes);
132
133 for (size_t i = 0; i < MAS_NrOfSensorTypes; i++)
134 {
135 auto sensType = static_cast<MAS_SensorType>(i);
136 std::string optionName = MAS_getTagFromEnum(sensType) +"Names";
137 ok = getVectorOfStringFromListInConfig(optionName , prop, m_remappedSensors[i]);
138 if (!ok)
139 {
140 yCError(MULTIPLEANALOGSENSORSREMAPPER) << optionName << "should be followed by a list of string.";
141 return false;
142 }
143 }
144
145 return ok;
146}
147
148// Note: as soon as we support only C++17, we can switch to using std::invoke
149// See https://isocpp.org/wiki/faq/pointers-to-members#fnptr-vs-memfnptr-types
150#define MAS_CALL_MEMBER_FN(object, ptrToMember) ((*object).*(ptrToMember))
151
152
153template<typename Interface>
154bool MultipleAnalogSensorsRemapper::genericAttachAll(const MAS_SensorType sensorType,
155 std::vector<Interface *>& subDeviceVec,
159{
160 std::map<std::string, SensorInSubDevice> sensorLocationMap;
161
162 subDeviceVec.resize(polylist.size());
163
164 for(int p=0; p<polylist.size(); p++)
165 {
166 // If this fails it is ok, this just means that this devices does not expose this kind of sensors
167 polylist[p]->poly->view(subDeviceVec[p]);
168
169 if (subDeviceVec[p])
170 {
171 size_t nrOfSensorsInSubDevice = 0;
173 if (!retnum)
174 {
175 yCError(MULTIPLEANALOGSENSORSREMAPPER) << "Failure in reading number of sensors of type " << MAS_getTagFromEnum(sensorType) << " in device " << polylist[p]->key;
176 return false;
177 }
178 for (size_t s=0; s < nrOfSensorsInSubDevice; s++)
179 {
180 std::string name;
181 bool ok = MAS_CALL_MEMBER_FN(subDeviceVec[p], getNameMethodPtr)(s,name);
182 if (!ok)
183 {
184 yCError(MULTIPLEANALOGSENSORSREMAPPER) << "Failure in getting a name in the device " << polylist[p]->key;
185 return false;
186 }
187
188 // If the name is already in the map, raise an error
189 if (sensorLocationMap.find(name) != sensorLocationMap.end())
190 {
191 SensorInSubDevice deviceWithSameName = sensorLocationMap.find(name)->second;
193 << "Sensor ambiguity: sensor with name"
194 << name
195 << "present on both device"
196 << polylist[p]->key
197 << polylist[deviceWithSameName.subDevice]->key;
198 return false;
199 }
200
201 sensorLocationMap[name] = SensorInSubDevice(p, s);
202 }
203 }
204 }
205
206 // Fill the indices map given the name of all the subdevices
207 std::vector<SensorInSubDevice>& sensIndicesMap = m_indicesMap[static_cast<size_t>(sensorType)];
208 sensIndicesMap.resize(m_remappedSensors[sensorType].size());
209 for(size_t i=0; i < m_remappedSensors[sensorType].size(); i++)
210 {
211 std::string name = m_remappedSensors[sensorType][i];
212 if (sensorLocationMap.find(name) == sensorLocationMap.end())
213 {
214 yCError(MULTIPLEANALOGSENSORSREMAPPER) << "Impossible to find sensor name" << name << ", exiting.";
215 yCError(MULTIPLEANALOGSENSORSREMAPPER) << " Names of available sensors are:";
217 {
219 }
220 return false;
221 }
222
223 sensIndicesMap[i] = sensorLocationMap.find(name)->second;
224 }
225
226 return true;
227}
228
229
230
232{
233 bool ok = true;
234 m_indicesMap.resize(MAS_NrOfSensorTypes);
235 ok = ok && genericAttachAll(ThreeAxisGyroscopes, m_iThreeAxisGyroscopes, polylist,
237 ok = ok && genericAttachAll(ThreeAxisLinearAccelerometers, m_iThreeAxisLinearAccelerometers, polylist,
239 ok = ok && genericAttachAll(ThreeAxisAngularAccelerometers, m_iThreeAxisAngularAccelerometers, polylist,
241 ok = ok && genericAttachAll(ThreeAxisMagnetometers, m_iThreeAxisMagnetometers, polylist,
243 ok = ok && genericAttachAll(PositionSensors, m_iPositionSensors, polylist,
245 ok = ok && genericAttachAll(LinearVelocitySensors, m_iLinearVelocitySensors, polylist,
247 ok = ok && genericAttachAll(OrientationSensors, m_iOrientationSensors, polylist,
249 ok = ok && genericAttachAll(TemperatureSensors, m_iTemperatureSensors, polylist,
251 ok = ok && genericAttachAll(SixAxisForceTorqueSensors, m_iSixAxisForceTorqueSensors, polylist,
253 ok = ok && genericAttachAll(ContactLoadCellArrays, m_iContactLoadCellArrays, polylist,
255 ok = ok && genericAttachAll(EncoderArrays, m_iEncoderArrays, polylist,
257 ok = ok && genericAttachAll(SkinPatches, m_iSkinPatches, polylist,
259
260 return ok;
261}
262
264{
265 m_iThreeAxisGyroscopes.resize(0);
266 m_iThreeAxisLinearAccelerometers.resize(0);
267 m_iThreeAxisAngularAccelerometers.resize(0);
268 m_iThreeAxisMagnetometers.resize(0);
269 m_iPositionSensors.resize(0);
270 m_iLinearVelocitySensors.resize(0);
271 m_iOrientationSensors.resize(0);
272 m_iTemperatureSensors.resize(0);
273 m_iSixAxisForceTorqueSensors.resize(0);
274 m_iContactLoadCellArrays.resize(0);
275 m_iEncoderArrays.resize(0);
276 m_iSkinPatches.resize(0);
277 m_indicesMap.resize(0);
278 return true;
279}
280
281
282template<typename Interface>
283MAS_status MultipleAnalogSensorsRemapper::genericGetStatus(const MAS_SensorType sensorType,
284 size_t& sens_index,
285 const std::vector<Interface *>& subDeviceVec,
287{
288 size_t nrOfAvailableSensors = m_indicesMap[sensorType].size();
290 {
291 if (m_verbose)
292 {
293 yCError(MULTIPLEANALOGSENSORSREMAPPER, "genericGetStatus sens_index %zu out of range of available sensors (%zu).", sens_index, nrOfAvailableSensors);
294 }
295 return MAS_ERROR;
296 }
297
298 SensorInSubDevice subDeviceSensor = m_indicesMap[sensorType][sens_index];
299 return MAS_CALL_MEMBER_FN(subDeviceVec[subDeviceSensor.subDevice], methodPtr)(subDeviceSensor.indexInSubDevice);
300}
301
302template<typename Interface>
303ReturnValue MultipleAnalogSensorsRemapper::genericGetName(const MAS_SensorType sensorType,
304 size_t& sens_index, std::string &name,
305 const std::vector<Interface *>& subDeviceVec,
307{
308 size_t nrOfAvailableSensors = m_indicesMap[sensorType].size();
310 {
311 if (m_verbose)
312 {
313 yCError(MULTIPLEANALOGSENSORSREMAPPER, "genericGetName sens_index %zu out of range of available sensors (%zu).", sens_index, nrOfAvailableSensors);
314 }
316 }
317
318 SensorInSubDevice subDeviceSensor = m_indicesMap[sensorType][sens_index];
319 return MAS_CALL_MEMBER_FN(subDeviceVec[subDeviceSensor.subDevice], methodPtr)(subDeviceSensor.indexInSubDevice, name);
320}
321
322template<typename Interface>
323ReturnValue MultipleAnalogSensorsRemapper::genericGetFrameName(const MAS_SensorType sensorType,
324 size_t& sens_index, std::string &name,
325 const std::vector<Interface *>& subDeviceVec,
327{
328 size_t nrOfAvailableSensors = m_indicesMap[sensorType].size();
330 {
331 if (m_verbose)
332 {
333 yCError(MULTIPLEANALOGSENSORSREMAPPER, "genericGetFrameName sens_index %zu out of range of available sensors (%zu).", sens_index, nrOfAvailableSensors);
334 }
336 }
337
338 SensorInSubDevice subDeviceSensor = m_indicesMap[sensorType][sens_index];
339 return MAS_CALL_MEMBER_FN(subDeviceVec[subDeviceSensor.subDevice], methodPtr)(subDeviceSensor.indexInSubDevice, name);
340}
341
342
343template<typename Interface>
344ReturnValue MultipleAnalogSensorsRemapper::genericGetMeasure(const MAS_SensorType sensorType,
345 size_t& sens_index, yarp::sig::Vector& out, double& timestamp,
346 const std::vector<Interface *>& subDeviceVec,
348{
349 size_t nrOfAvailableSensors = m_indicesMap[sensorType].size();
351 {
352 if (m_verbose)
353 {
354 yCError(MULTIPLEANALOGSENSORSREMAPPER, "genericGetMeasure sens_index %zu out of range of available sensors (%zu).", sens_index, nrOfAvailableSensors);
355 }
357 }
358
359 SensorInSubDevice subDeviceSensor = m_indicesMap[sensorType][sens_index];
360 return MAS_CALL_MEMBER_FN(subDeviceVec[subDeviceSensor.subDevice], methodPtr)(subDeviceSensor.indexInSubDevice, out, timestamp);
361}
362
363template<typename Interface>
364size_t MultipleAnalogSensorsRemapper::genericGetSize(const MAS_SensorType sensorType,
365 size_t& sens_index,
366 const std::vector<Interface *>& subDeviceVec,
368{
369 size_t nrOfAvailableSensors = m_indicesMap[sensorType].size();
371 {
372 if (m_verbose)
373 {
374 yCError(MULTIPLEANALOGSENSORSREMAPPER, "genericGetSize sens_index %zu out of range of available sensors (%zu).", sens_index, nrOfAvailableSensors);
375 }
376 return MAS_ERROR;
377 }
378
379 SensorInSubDevice subDeviceSensor = m_indicesMap[sensorType][sens_index];
380 return MAS_CALL_MEMBER_FN(subDeviceVec[subDeviceSensor.subDevice], methodPtr)(subDeviceSensor.indexInSubDevice);
381}
382
383/*
384All the sensor specific methods (excluding the IOrientationSensor and the ISkinPatches) are just an instantiation of the following template (note: we avoid code generation for the sake of readability):
385
386size_t MultipleAnalogSensorsRemapper::getNrOf{{SensorTag}}s() const
387{
388 return m_indicesMap[{{SensorTag}}s].size();
389}
390
391MAS_status MultipleAnalogSensorsRemapper::get{{SensorTag}}Status(size_t sens_index) const
392{
393 return genericGetStatus({{SensorTag}}s, sens_index, m_i{{SensorTag}}s, &I{{SensorTag}}s::get{{SensorTag}}Status);
394}
395
396bool MultipleAnalogSensorsRemapper::get{{SensorTag}}Name(size_t sens_index, std::string& name) const
397{
398 return genericGetName({{SensorTag}}s, sens_index, name, m_i{{SensorTag}}s, &I{{SensorTag}}s::get{{SensorTag}}Name);
399}
400
401bool MultipleAnalogSensorsRemapper::get{{SensorTag}}Measure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const
402{
403 return genericGetMeasure({{SensorTag}}s, sens_index, out, timestamp, m_i{{SensorTag}}s, &I{{SensorTag}}s::get{{SensorTag}}Measure);
404}
405
406For the sensors (EncoderArray and SkinPatch) of which the measurements can change size, we also have:
407size_t MultipleAnalogSensorsRemapper::get{{SensorTag}}Size(size_t sens_index) const
408{
409 return genericGetSize({{SensorTag}}s, sens_index, m_i{{SensorTag}}s, &I{{SensorTag}}s::get{{SensorTag}}Size);
410}
411
412*/
413
415{
416 num = m_indicesMap[ThreeAxisGyroscopes].size();
417 return ReturnValue_ok;
418}
419
424
426{
427 return genericGetName(ThreeAxisGyroscopes, sens_index, name, m_iThreeAxisGyroscopes, &IThreeAxisGyroscopes::getThreeAxisGyroscopeName);
428}
430{
431 return genericGetFrameName(ThreeAxisGyroscopes, sens_index, frameName, m_iThreeAxisGyroscopes, &IThreeAxisGyroscopes::getThreeAxisGyroscopeFrameName);
432}
433
435{
436 return genericGetMeasure(ThreeAxisGyroscopes, sens_index, out, timestamp, m_iThreeAxisGyroscopes, &IThreeAxisGyroscopes::getThreeAxisGyroscopeMeasure);
437}
438
444
449
454
459
464
470
475
480
485
490
492{
493 num = m_indicesMap[ThreeAxisMagnetometers].size();
494 return ReturnValue_ok;
495}
496
501
503{
504 return genericGetName(ThreeAxisMagnetometers, sens_index, name, m_iThreeAxisMagnetometers, &IThreeAxisMagnetometers::getThreeAxisMagnetometerName);
505}
506
508{
509 return genericGetFrameName(ThreeAxisMagnetometers, sens_index, frameName, m_iThreeAxisMagnetometers, &IThreeAxisMagnetometers::getThreeAxisMagnetometerFrameName);
510}
511
513{
514 return genericGetMeasure(ThreeAxisMagnetometers, sens_index, out, timestamp, m_iThreeAxisMagnetometers, &IThreeAxisMagnetometers::getThreeAxisMagnetometerMeasure);
515}
516
518{
519 num = m_indicesMap[PositionSensors].size();
520 return ReturnValue_ok;
521}
522
527
529{
530 return genericGetName(PositionSensors, sens_index, name, m_iPositionSensors, &IPositionSensors::getPositionSensorName);
531}
532
534{
535 return genericGetFrameName(PositionSensors, sens_index, frameName, m_iPositionSensors, &IPositionSensors::getPositionSensorFrameName);
536}
537
539{
540 return genericGetMeasure(PositionSensors, sens_index, out, timestamp, m_iPositionSensors, &IPositionSensors::getPositionSensorMeasure);
541}
542
544{
545 num = m_indicesMap[LinearVelocitySensors].size();
546 return ReturnValue_ok;
547}
548
553
555{
556 return genericGetName(LinearVelocitySensors, sens_index, name, m_iLinearVelocitySensors, &ILinearVelocitySensors::getLinearVelocitySensorName);
557}
558
560{
561 return genericGetFrameName(LinearVelocitySensors, sens_index, frameName, m_iLinearVelocitySensors, &ILinearVelocitySensors::getLinearVelocitySensorFrameName);
562}
563
565{
566 return genericGetMeasure(LinearVelocitySensors, sens_index, out, timestamp, m_iLinearVelocitySensors, &ILinearVelocitySensors::getLinearVelocitySensorMeasure);
567}
568
570{
571 num = m_indicesMap[OrientationSensors].size();
572 return ReturnValue_ok;
573}
574
579
581{
582 return genericGetName(OrientationSensors, sens_index, name, m_iOrientationSensors, &IOrientationSensors::getOrientationSensorName);
583}
584
586{
587 return genericGetFrameName(OrientationSensors, sens_index, frameName, m_iOrientationSensors, &IOrientationSensors::getOrientationSensorFrameName);
588}
589
594
596{
597 num = m_indicesMap[TemperatureSensors].size();
598 return ReturnValue_ok;
599}
600
605
607{
608 return genericGetName(TemperatureSensors, sens_index, name, m_iTemperatureSensors, &ITemperatureSensors::getTemperatureSensorName);
609}
610
612{
613 return genericGetFrameName(TemperatureSensors, sens_index, frameName, m_iTemperatureSensors, &ITemperatureSensors::getTemperatureSensorFrameName);
614}
615
617{
618 return genericGetMeasure(TemperatureSensors, sens_index, out, timestamp, m_iTemperatureSensors, &ITemperatureSensors::getTemperatureSensorMeasure);
619}
620
622{
623 yarp::sig::Vector dummy(1);
624 ReturnValue ok = genericGetMeasure(TemperatureSensors, sens_index, dummy, timestamp, m_iTemperatureSensors, &ITemperatureSensors::getTemperatureSensorMeasure);
625 out = dummy[0];
626 return ok;
627}
628
634
639
644
646{
647 return genericGetFrameName(SixAxisForceTorqueSensors, sens_index, frameName, m_iSixAxisForceTorqueSensors, &ISixAxisForceTorqueSensors::getSixAxisForceTorqueSensorFrameName);
648}
649
651{
652 return genericGetMeasure(SixAxisForceTorqueSensors, sens_index, out, timestamp, m_iSixAxisForceTorqueSensors, &ISixAxisForceTorqueSensors::getSixAxisForceTorqueSensorMeasure);
653}
654
656{
657 num = m_indicesMap[ContactLoadCellArrays].size();
658 return ReturnValue_ok;
659}
660
665
667{
668 return genericGetName(ContactLoadCellArrays, sens_index, name, m_iContactLoadCellArrays, &IContactLoadCellArrays::getContactLoadCellArrayName);
669}
670
672{
673 return genericGetMeasure(ContactLoadCellArrays, sens_index, out, timestamp, m_iContactLoadCellArrays, &IContactLoadCellArrays::getContactLoadCellArrayMeasure);
674}
675
680
682{
683 num = m_indicesMap[EncoderArrays].size();
684 return ReturnValue_ok;
685}
686
691
693{
694 return genericGetName(EncoderArrays, sens_index, name, m_iEncoderArrays, &IEncoderArrays::getEncoderArrayName);
695}
696
698{
699 return genericGetMeasure(EncoderArrays, sens_index, out, timestamp, m_iEncoderArrays, &IEncoderArrays::getEncoderArrayMeasure);
700}
701
703{
704 return genericGetSize(EncoderArrays, sens_index, m_iEncoderArrays, &IEncoderArrays::getEncoderArraySize);
705}
706
708{
709 num = m_indicesMap[SkinPatches].size();
710 return ReturnValue_ok;
711}
712
717
719{
720 return genericGetName(SkinPatches, sens_index, name, m_iSkinPatches, &ISkinPatches::getSkinPatchName);
721}
722
724{
725 return genericGetMeasure(SkinPatches, sens_index, out, timestamp, m_iSkinPatches, &ISkinPatches::getSkinPatchMeasure);
726}
727
729{
730 return genericGetSize(SkinPatches, sens_index, m_iSkinPatches, &ISkinPatches::getSkinPatchSize);
731}
size_t size_t
const size_t MAS_NrOfSensorTypes
#define MAS_CALL_MEMBER_FN(object, ptrToMember)
bool getVectorOfStringFromListInConfig(const std::string &key, const yarp::os::Searchable &config, std::vector< std::string > &vectorOfStrings)
std::string MAS_getTagFromEnum(const MAS_SensorType type)
Internal identifier of the type of sensors.
MAS_SensorType
Internal identifier of the type of sensors.
@ ThreeAxisAngularAccelerometers
@ ThreeAxisLinearAccelerometers
#define ReturnValue_ok
Definition ReturnValue.h:82
#define ReturnValue_error_input_out_of_bounds
Definition ReturnValue.h:89
yarp::dev::ReturnValue getSixAxisForceTorqueSensorFrameName(size_t sens_index, std::string &frame) const override
Get the name of the frame of the specified sensor.
yarp::dev::ReturnValue getNrOfThreeAxisMagnetometers(size_t &num) const override
Get the number of magnetometers exposed by this device.
yarp::dev::ReturnValue getOrientationSensorName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
yarp::dev::ReturnValue getNrOfLinearVelocitySensors(size_t &num) const override
Get the number of linear velocity sensors exposed by this device.
size_t getContactLoadCellArraySize(size_t sens_index) const override
Get the size of the specified contact load cell array.
yarp::dev::ReturnValue getThreeAxisMagnetometerFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
yarp::dev::ReturnValue getLinearVelocitySensorFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
yarp::dev::ReturnValue getThreeAxisGyroscopeMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the gyroscope.
yarp::dev::ReturnValue getNrOfThreeAxisAngularAccelerometers(size_t &num) const override
Get the number of three axis angular accelerometers exposed by this device.
yarp::dev::ReturnValue getNrOfEncoderArrays(size_t &num) const override
Get the number of encoder arrays exposed by this device.
yarp::dev::ReturnValue 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.
yarp::dev::ReturnValue getSixAxisForceTorqueSensorName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
yarp::dev::ReturnValue getNrOfContactLoadCellArrays(size_t &num) const override
Get the number of contact load cell array 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 getThreeAxisMagnetometerStatus(size_t sens_index) const override
Get the status of the specified sensor.
yarp::dev::ReturnValue getOrientationSensorFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
bool detachAll() override
Detach the object (you must have first called attach).
yarp::dev::MAS_status getOrientationSensorStatus(size_t sens_index) const override
Get the status of the specified sensor.
yarp::dev::ReturnValue getThreeAxisAngularAccelerometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the specified sensor.
bool attachAll(const yarp::dev::PolyDriverList &p) override
MultipeWrapper methods.
yarp::dev::ReturnValue getContactLoadCellArrayName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
yarp::dev::ReturnValue getTemperatureSensorName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
yarp::dev::MAS_status getThreeAxisAngularAccelerometerStatus(size_t sens_index) const override
Get the status of the specified sensor.
yarp::dev::ReturnValue getNrOfTemperatureSensors(size_t &num) const override
Get the number of temperature sensors exposed by this device.
yarp::dev::ReturnValue getSixAxisForceTorqueSensorMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the specified sensor.
yarp::dev::ReturnValue getNrOfOrientationSensors(size_t &num) const override
Get the number of orientation sensors exposed by this device.
yarp::dev::ReturnValue getThreeAxisLinearAccelerometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the specified sensor.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::dev::ReturnValue getThreeAxisLinearAccelerometerFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
yarp::dev::MAS_status getPositionSensorStatus(size_t sens_index) const override
Get the status of the specified sensor.
yarp::dev::ReturnValue getNrOfSkinPatches(size_t &num) const override
Get the number of skin patches exposed by this device.
size_t getEncoderArraySize(size_t sens_index) const override
Get the size of the specified encoder array.
yarp::dev::ReturnValue getThreeAxisAngularAccelerometerFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
yarp::dev::ReturnValue getThreeAxisLinearAccelerometerName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
yarp::dev::ReturnValue getContactLoadCellArrayMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the specified sensor.
yarp::dev::ReturnValue 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.
yarp::dev::MAS_status getSkinPatchStatus(size_t sens_index) const override
Get the status of the specified sensor.
yarp::dev::MAS_status getEncoderArrayStatus(size_t sens_index) const override
Get the status of the specified sensor.
yarp::dev::ReturnValue getSkinPatchName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
yarp::dev::ReturnValue getPositionSensorName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
yarp::dev::MAS_status getThreeAxisLinearAccelerometerStatus(size_t sens_index) const override
Get the status of the specified sensor.
yarp::dev::ReturnValue getNrOfSixAxisForceTorqueSensors(size_t &num) const override
Get the number of six axis force torque sensors exposed by this device.
yarp::dev::ReturnValue 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::ReturnValue getNrOfPositionSensors(size_t &num) const override
Get the number of position sensors exposed by this device.
yarp::dev::ReturnValue getThreeAxisGyroscopeFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
yarp::dev::MAS_status getSixAxisForceTorqueSensorStatus(size_t sens_index) const override
Get the status of the specified sensor.
yarp::dev::ReturnValue getThreeAxisAngularAccelerometerName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
yarp::dev::ReturnValue getPositionSensorFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
yarp::dev::ReturnValue getEncoderArrayMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the specified sensor.
yarp::dev::MAS_status getContactLoadCellArrayStatus(size_t sens_index) const override
Get the status of the specified sensor.
yarp::dev::MAS_status getTemperatureSensorStatus(size_t sens_index) const override
Get the status of the specified sensor.
yarp::dev::ReturnValue getNrOfThreeAxisGyroscopes(size_t &num) const override
Get the number of three axis gyroscopes exposed by this sensor.
size_t getSkinPatchSize(size_t sens_index) const override
Get the size of the specified skin patch.
yarp::dev::ReturnValue getSkinPatchMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the specified sensor.
yarp::dev::ReturnValue getNrOfThreeAxisLinearAccelerometers(size_t &num) const override
Get the number of three axis linear accelerometers exposed by this device.
yarp::dev::ReturnValue getThreeAxisGyroscopeName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
yarp::dev::ReturnValue getThreeAxisMagnetometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Get the last reading of the specified sensor.
yarp::dev::ReturnValue getThreeAxisMagnetometerName(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.
yarp::dev::ReturnValue getLinearVelocitySensorName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
yarp::dev::ReturnValue getTemperatureSensorMeasure(size_t sens_index, double &out, double &timestamp) const override
Get the last reading of the specified sensor.
yarp::dev::ReturnValue getEncoderArrayName(size_t sens_index, std::string &name) const override
Get the name of the specified sensor.
yarp::dev::ReturnValue getTemperatureSensorFrameName(size_t sens_index, std::string &frameName) const override
Get the name of the frame of the specified sensor.
virtual yarp::dev::MAS_status getContactLoadCellArrayStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual yarp::dev::ReturnValue getContactLoadCellArrayMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading 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 yarp::dev::ReturnValue getContactLoadCellArrayName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual yarp::dev::ReturnValue getNrOfContactLoadCellArrays(size_t &num) const =0
Get the number of contact load cell array exposed by this device.
virtual yarp::dev::ReturnValue getEncoderArrayName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual yarp::dev::ReturnValue getNrOfEncoderArrays(size_t &num) const =0
Get the number of encoder arrays exposed by this device.
virtual size_t getEncoderArraySize(size_t sens_index) const =0
Get the size of the specified encoder array.
virtual yarp::dev::MAS_status getEncoderArrayStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual yarp::dev::ReturnValue getEncoderArrayMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
virtual yarp::dev::ReturnValue getLinearVelocitySensorFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
virtual yarp::dev::ReturnValue getNrOfLinearVelocitySensors(size_t &num) const =0
Get the number of linear velocity sensors exposed by this device.
virtual yarp::dev::ReturnValue getLinearVelocitySensorMeasure(size_t sens_index, yarp::sig::Vector &xyz, double &timestamp) const =0
Get the last reading of the linear velocity sensor as x y z.
virtual yarp::dev::ReturnValue getLinearVelocitySensorName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual yarp::dev::MAS_status getLinearVelocitySensorStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual yarp::dev::ReturnValue 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.
virtual yarp::dev::MAS_status getOrientationSensorStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual yarp::dev::ReturnValue getOrientationSensorFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
virtual yarp::dev::ReturnValue getNrOfOrientationSensors(size_t &num) const =0
Get the number of orientation sensors exposed by this device.
virtual yarp::dev::ReturnValue getOrientationSensorName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual yarp::dev::MAS_status getPositionSensorStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual yarp::dev::ReturnValue getPositionSensorName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual yarp::dev::ReturnValue 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 yarp::dev::ReturnValue getPositionSensorFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
virtual yarp::dev::ReturnValue getNrOfPositionSensors(size_t &num) const =0
Get the number of position sensors exposed by this device.
virtual yarp::dev::ReturnValue getSixAxisForceTorqueSensorMeasure(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 getSixAxisForceTorqueSensorStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual yarp::dev::ReturnValue getSixAxisForceTorqueSensorName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual yarp::dev::ReturnValue getSixAxisForceTorqueSensorFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
virtual yarp::dev::ReturnValue getNrOfSixAxisForceTorqueSensors(size_t &num) const =0
Get the number of six axis force torque sensors exposed by this device.
virtual yarp::dev::ReturnValue getSkinPatchMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
virtual yarp::dev::ReturnValue getSkinPatchName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
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 yarp::dev::ReturnValue getNrOfSkinPatches(size_t &num) const =0
Get the number of skin patches exposed by this device.
virtual yarp::dev::MAS_status getTemperatureSensorStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual yarp::dev::ReturnValue getTemperatureSensorFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
virtual yarp::dev::ReturnValue getTemperatureSensorMeasure(size_t sens_index, double &out, double &timestamp) const =0
Get the last reading of the specified sensor.
virtual yarp::dev::ReturnValue getNrOfTemperatureSensors(size_t &num) const =0
Get the number of temperature sensors exposed by this device.
virtual yarp::dev::ReturnValue getTemperatureSensorName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual yarp::dev::MAS_status getThreeAxisAngularAccelerometerStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual yarp::dev::ReturnValue getNrOfThreeAxisAngularAccelerometers(size_t &num) const =0
Get the number of three axis angular accelerometers exposed by this device.
virtual yarp::dev::ReturnValue getThreeAxisAngularAccelerometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
virtual yarp::dev::ReturnValue getThreeAxisAngularAccelerometerName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual yarp::dev::ReturnValue getThreeAxisAngularAccelerometerFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
virtual yarp::dev::ReturnValue getThreeAxisGyroscopeFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
virtual yarp::dev::MAS_status getThreeAxisGyroscopeStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual yarp::dev::ReturnValue getThreeAxisGyroscopeName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual yarp::dev::ReturnValue getNrOfThreeAxisGyroscopes(size_t &num) const =0
Get the number of three axis gyroscopes exposed by this sensor.
virtual yarp::dev::ReturnValue getThreeAxisGyroscopeMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the gyroscope.
virtual yarp::dev::ReturnValue getThreeAxisLinearAccelerometerName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
virtual yarp::dev::MAS_status getThreeAxisLinearAccelerometerStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual yarp::dev::ReturnValue getThreeAxisLinearAccelerometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const =0
Get the last reading of the specified sensor.
virtual yarp::dev::ReturnValue getThreeAxisLinearAccelerometerFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
virtual yarp::dev::ReturnValue getNrOfThreeAxisLinearAccelerometers(size_t &num) const =0
Get the number of three axis linear accelerometers exposed by this device.
virtual yarp::dev::ReturnValue getThreeAxisMagnetometerFrameName(size_t sens_index, std::string &frameName) const =0
Get the name of the frame of the specified sensor.
virtual yarp::dev::ReturnValue getThreeAxisMagnetometerMeasure(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 getThreeAxisMagnetometerStatus(size_t sens_index) const =0
Get the status of the specified sensor.
virtual yarp::dev::ReturnValue getNrOfThreeAxisMagnetometers(size_t &num) const =0
Get the number of magnetometers exposed by this device.
virtual yarp::dev::ReturnValue getThreeAxisMagnetometerName(size_t sens_index, std::string &name) const =0
Get the name of the specified sensor.
A simple collection of objects that can be described and transmitted in a portable way.
Definition Bottle.h:64
A mini-server for performing network communication in the background.
A class for storing options and configuration information.
Definition Property.h:32
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
void fromString(const std::string &txt, bool wipe=true)
Interprets a string as a list of properties.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
A base class for nested structures that can be searched.
Definition Searchable.h:31
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
virtual Bottle * asList() const
Get list value.
Definition Value.cpp:246
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
STL namespace.
For streams capable of holding different kinds of content, check what they actually have.
MAS_status
Status of a given analog sensor exposed by a multiple analog sensors interface.
@ MAS_ERROR
The sensor is in generic error state.
An interface to the operating system, including Port based communication.
The main, catch-all namespace for YARP.
Definition dirs.h:16