Skip to content

Commit a485998

Browse files
authored
Fix compatibility with YARP 3.10 (#206)
* Fix compatibility with YARP 3.10
1 parent 3d57b0b commit a485998

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

devices/Paexo/src/Paexo.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ class Paexo::PaexoImpl
6060
std::unique_ptr<CmdParser> cmdPro;
6161
yarp::os::RpcServer rpcPort;
6262

63-
std::string serialComPortName;
64-
6563
// Paexo data buffer
6664
PaexoData paexoData;
6765

@@ -806,9 +804,6 @@ bool Paexo::attach(yarp::dev::PolyDriver* poly)
806804
yInfo() << LogPrefix << "ISerialDevice interface viewed correctly";
807805
}
808806

809-
// Get the comport name of the serial device
810-
pImpl->serialComPortName = poly->getValue("comport").asString();
811-
812807
// TODO: Check if the ISerialDevice interface is configured correctly
813808
// I do not see any method to check this
814809

wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ constexpr double DefaultPeriod = 0.01;
2020
class IWearActuatorsWrapper::impl : public wearable::msg::WearableActuatorCommand
2121
{
2222
public:
23-
std::string attachedWearableDeviceName;
23+
std::string attachedWearableDeviceKey = "defaultIWearActuatorsWrapperDevice";
2424

2525
std::string actuatorCommandInputPortName;
2626
yarp::os::BufferedPort<wearable::msg::WearableActuatorCommand> actuatorCommandInputPort;
@@ -94,7 +94,7 @@ void IWearActuatorsWrapper::onRead(msg::WearableActuatorCommand& wearableActuato
9494
// Check if the commanded actuator name is available
9595
if (pImpl->actuatorsMap.find(info.name) == pImpl->actuatorsMap.end())
9696
{
97-
yWarning() << "Requested actuator with name " << info.name << " is not available in " << pImpl->attachedWearableDeviceName << " wearable device \n \t Ignoring wearable actuation command.";
97+
yWarning() << "Requested actuator with name " << info.name << " is not available in " << pImpl->attachedWearableDeviceKey << " wearable device \n \t Ignoring wearable actuation command.";
9898
}
9999
else // process the wearable actuator command
100100
{
@@ -153,16 +153,14 @@ bool IWearActuatorsWrapper::attach(yarp::dev::PolyDriver* poly)
153153
return false;
154154
}
155155

156-
pImpl->attachedWearableDeviceName = poly->getValue("device").asString();
157-
158156
if (pImpl->iWear || !poly->view(pImpl->iWear) || !pImpl->iWear) {
159157
yError() << LogPrefix << "Failed to view the IWear interface from the PolyDriver.";
160158
return false;
161159
}
162160

163161
// Check and add all the available actuators
164162

165-
yInfo() << LogPrefix << "Finding available actuators from " << pImpl->attachedWearableDeviceName << " wearable deive ...";
163+
yInfo() << LogPrefix << "Finding available actuators from " << pImpl->attachedWearableDeviceKey << " wearable deive ...";
166164

167165
for (const auto& a : pImpl->iWear->getHapticActuators())
168166
{
@@ -226,6 +224,9 @@ bool IWearActuatorsWrapper::attachAll(const yarp::dev::PolyDriverList& driverLis
226224
yError() << LogPrefix << "Passed PolyDriverDescriptor is nullptr.";
227225
return false;
228226
}
227+
228+
// Save key that identifies the driver
229+
pImpl->attachedWearableDeviceKey = driver->key;
229230

230231
return attach(driver->poly);
231232
}

0 commit comments

Comments
 (0)