From c46c1852974776038a75b7c0e542ccb2917d7c7f Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Mon, 19 Sep 2022 17:40:20 +0200 Subject: [PATCH] Implement VirtualAnalogRemapper::getAxes to fix compilation with YARP 3.8 (#160) * Implement VirtualAnalogRemapper::getAxes * Update CHANGELOG.md * Fix VirtualAnalogRemapper::getAxes implementation --- CHANGELOG.md | 2 +- .../virtualAnalogRemapper/VirtualAnalogRemapper.cpp | 12 ++++++++++++ .../virtualAnalogRemapper/VirtualAnalogRemapper.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf53fd8..1fc1fb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed ### Fixed -- Implement VirtualAnalogClient::getAxes to fix compilation against YARP 3.8 (https://github.com/robotology/whole-body-estimators/pull/159). +- Implement `VirtualAnalogClient::getAxes` and `VirtualAnalogRemapper::getAxes` to fix compilation against YARP 3.8 (https://github.com/robotology/whole-body-estimators/pull/159, https://github.com/robotology/whole-body-estimators/pull/160). ## [0.9.0] - 2022-08-31 diff --git a/devices/virtualAnalogRemapper/VirtualAnalogRemapper.cpp b/devices/virtualAnalogRemapper/VirtualAnalogRemapper.cpp index 74d1a06..fd498f5 100644 --- a/devices/virtualAnalogRemapper/VirtualAnalogRemapper.cpp +++ b/devices/virtualAnalogRemapper/VirtualAnalogRemapper.cpp @@ -343,3 +343,15 @@ bool VirtualAnalogRemapper::getJointType(int axis, JointTypeEnum& type) } return ret; } + +bool VirtualAnalogRemapper::getAxes(int* ax) +{ + if( !ax ) + { + yError() << "VirtualAnalogRemapper: getAxes failed : invalid argument passed"; + return false; + } + + *ax = this->m_axesNames.size(); + return true; +} diff --git a/devices/virtualAnalogRemapper/VirtualAnalogRemapper.h b/devices/virtualAnalogRemapper/VirtualAnalogRemapper.h index 0a78353..818949b 100644 --- a/devices/virtualAnalogRemapper/VirtualAnalogRemapper.h +++ b/devices/virtualAnalogRemapper/VirtualAnalogRemapper.h @@ -129,6 +129,7 @@ class VirtualAnalogRemapper: public DeviceDriver, /** IAxisInfo methods (documented in IVirtualAnalogSensor class) */ virtual bool getAxisName(int axis, std::string& name); virtual bool getJointType(int axis, yarp::dev::JointTypeEnum& type); + virtual bool getAxes(int* ax); /** IMultipleWrapper methods (documented in IMultipleWrapper */ virtual bool attachAll(const PolyDriverList &p);