From ac150e27f611553ea4eaea0d2f747ac77507f063 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 29 Feb 2024 16:14:30 +0100 Subject: [PATCH 1/4] Fix compatibility with YARP 3.10 --- devices/Paexo/src/Paexo.cpp | 5 ----- wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp | 11 ++++++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/devices/Paexo/src/Paexo.cpp b/devices/Paexo/src/Paexo.cpp index 6d379b4..e58ddb2 100644 --- a/devices/Paexo/src/Paexo.cpp +++ b/devices/Paexo/src/Paexo.cpp @@ -60,8 +60,6 @@ class Paexo::PaexoImpl std::unique_ptr cmdPro; yarp::os::RpcServer rpcPort; - std::string serialComPortName; - // Paexo data buffer PaexoData paexoData; @@ -806,9 +804,6 @@ bool Paexo::attach(yarp::dev::PolyDriver* poly) yInfo() << LogPrefix << "ISerialDevice interface viewed correctly"; } - // Get the comport name of the serial device - pImpl->serialComPortName = poly->getValue("comport").asString(); - // TODO: Check if the ISerialDevice interface is configured correctly // I do not see any method to check this diff --git a/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp b/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp index ddcc672..423d009 100644 --- a/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp +++ b/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp @@ -20,7 +20,7 @@ constexpr double DefaultPeriod = 0.01; class IWearActuatorsWrapper::impl : public wearable::msg::WearableActuatorCommand { public: - std::string attachedWearableDeviceName; + std::string attachedWearableDeviceKey; std::string actuatorCommandInputPortName; yarp::os::BufferedPort actuatorCommandInputPort; @@ -94,7 +94,7 @@ void IWearActuatorsWrapper::onRead(msg::WearableActuatorCommand& wearableActuato // Check if the commanded actuator name is available if (pImpl->actuatorsMap.find(info.name) == pImpl->actuatorsMap.end()) { - yWarning() << "Requested actuator with name " << info.name << " is not available in " << pImpl->attachedWearableDeviceName << " wearable device \n \t Ignoring wearable actuation command."; + yWarning() << "Requested actuator with name " << info.name << " is not available in " << pImpl->attachedWearableDeviceKey << " wearable device \n \t Ignoring wearable actuation command."; } else // process the wearable actuator command { @@ -153,8 +153,6 @@ bool IWearActuatorsWrapper::attach(yarp::dev::PolyDriver* poly) return false; } - pImpl->attachedWearableDeviceName = poly->getValue("device").asString(); - if (pImpl->iWear || !poly->view(pImpl->iWear) || !pImpl->iWear) { yError() << LogPrefix << "Failed to view the IWear interface from the PolyDriver."; return false; @@ -162,7 +160,7 @@ bool IWearActuatorsWrapper::attach(yarp::dev::PolyDriver* poly) // Check and add all the available actuators - yInfo() << LogPrefix << "Finding available actuators from " << pImpl->attachedWearableDeviceName << " wearable deive ..."; + yInfo() << LogPrefix << "Finding available actuators from " << pImpl->attachedWearableDeviceKey << " wearable deive ..."; for (const auto& a : pImpl->iWear->getHapticActuators()) { @@ -226,6 +224,9 @@ bool IWearActuatorsWrapper::attachAll(const yarp::dev::PolyDriverList& driverLis yError() << LogPrefix << "Passed PolyDriverDescriptor is nullptr."; return false; } + + // Save key that identifies the driver + driver->key; return attach(driver->poly); } From 25ba104cbc5d06219ba447ca022908aac5e98ef1 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 29 Feb 2024 16:19:58 +0100 Subject: [PATCH 2/4] Update IWearActuatorsWrapper.cpp --- wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp b/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp index 423d009..f3a8163 100644 --- a/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp +++ b/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp @@ -20,7 +20,7 @@ constexpr double DefaultPeriod = 0.01; class IWearActuatorsWrapper::impl : public wearable::msg::WearableActuatorCommand { public: - std::string attachedWearableDeviceKey; + std::string attachedWearableDeviceKey = "defaultIWearActuatorsWrapperDevice" std::string actuatorCommandInputPortName; yarp::os::BufferedPort actuatorCommandInputPort; From ae2c775b230ce8ebb390c9223e7049d97b085e66 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 29 Feb 2024 16:37:44 +0100 Subject: [PATCH 3/4] fixup --- wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp b/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp index f3a8163..883e3af 100644 --- a/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp +++ b/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp @@ -226,7 +226,7 @@ bool IWearActuatorsWrapper::attachAll(const yarp::dev::PolyDriverList& driverLis } // Save key that identifies the driver - driver->key; + pImpl->attachedWearableDeviceKey = driver->key; return attach(driver->poly); } From 870b27651a6702241d37db31bea6d1a9223ff91e Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 29 Feb 2024 16:47:34 +0100 Subject: [PATCH 4/4] fixup --- wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp b/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp index 883e3af..fb3f0ef 100644 --- a/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp +++ b/wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp @@ -20,7 +20,7 @@ constexpr double DefaultPeriod = 0.01; class IWearActuatorsWrapper::impl : public wearable::msg::WearableActuatorCommand { public: - std::string attachedWearableDeviceKey = "defaultIWearActuatorsWrapperDevice" + std::string attachedWearableDeviceKey = "defaultIWearActuatorsWrapperDevice"; std::string actuatorCommandInputPortName; yarp::os::BufferedPort actuatorCommandInputPort;