Skip to content

Commit

Permalink
make actuator ports optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehsan Ranjbari committed Jun 21, 2024
1 parent a7a0882 commit 2bb6185
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@ void IWearActuatorsWrapper::run()

bool IWearActuatorsWrapper::open(yarp::os::Searchable& config)
{
if (!config.check("actuatorCommandInputPortName") || !config.find("actuatorCommandInputPortName").isString()) {
yError() << LogPrefix << "actuatorCommandInputPortName parameter not found";
if (!config.check("actuatorCommandInputPortName") || !config.check("gloveActuatorCommandInputPortName"))
{
yError() << LogPrefix << "No actuator command input ports found.";
return false;
}

// Find and configure yarp port related to the actuator commands
if (!config.find("actuatorCommandInputPortName").isString()) {
yWarning() << LogPrefix << "actuatorCommandInputPortName parameter not found. Haptic feedback will not be available.";
}
if (!config.check("gloveActuatorCommandInputPortName") || !config.find("gloveActuatorCommandInputPortName").isString()) {
yWarning() << LogPrefix << "gloveActuatorCommandInputPortName parameter not found! The port will not be opened.";
}
Expand Down

0 comments on commit 2bb6185

Please sign in to comment.