Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with YARP 3.10 #206

Merged
merged 4 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions devices/Paexo/src/Paexo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ class Paexo::PaexoImpl
std::unique_ptr<CmdParser> cmdPro;
yarp::os::RpcServer rpcPort;

std::string serialComPortName;

// Paexo data buffer
PaexoData paexoData;

Expand Down Expand Up @@ -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

Expand Down
11 changes: 6 additions & 5 deletions wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ constexpr double DefaultPeriod = 0.01;
class IWearActuatorsWrapper::impl : public wearable::msg::WearableActuatorCommand
{
public:
std::string attachedWearableDeviceName;
std::string attachedWearableDeviceKey = "defaultIWearActuatorsWrapperDevice"

std::string actuatorCommandInputPortName;
yarp::os::BufferedPort<wearable::msg::WearableActuatorCommand> actuatorCommandInputPort;
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -153,16 +153,14 @@ 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;
}

// 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())
{
Expand Down Expand Up @@ -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;
S-Dafarra marked this conversation as resolved.
Show resolved Hide resolved

return attach(driver->poly);
}
Expand Down
Loading