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

Update Paexo wearable device with motor control through yarp #124

Merged
merged 13 commits into from
Jul 12, 2021
10 changes: 7 additions & 3 deletions devices/Paexo/src/Paexo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ struct PaexoData
class Paexo::PaexoImpl
{
public:

yarp::os::Network network;

mutable std::mutex mutex;
yarp::dev::ISerialDevice* iSerialDevice = nullptr;

Expand Down Expand Up @@ -439,9 +442,10 @@ bool Paexo::open(yarp::os::Searchable& config)
// Initialize yarp control ports

// Check yarp network initialization
if (!yarp::os::Network::isNetworkInitialized()) {
yInfo() << LogPrefix << "Initializing yarp network";
yarp::os::Network();
pImpl->network = yarp::os::Network();
if (!yarp::os::Network::initialized() || !yarp::os::Network::checkNetwork(5.0)) {
yError() << LogPrefix << "YARP server wasn't found active.";
return false;
}

yInfo() << LogPrefix << "Initiailizing PaexoMotorControlPort for " << leftActuatorName;
Expand Down