Skip to content

Commit

Permalink
Use UDP carrier in streaming output, use Contactable::addOutput
Browse files Browse the repository at this point in the history
Closes #120.
  • Loading branch information
PeterBowman committed Dec 5, 2017
1 parent 1cf9cd1 commit 082597a
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions libraries/YarpPlugins/CartesianControlClient/DeviceDriverImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include <string>

#include <yarp/os/Network.h>
#include <yarp/os/Time.h>

#include <ColorDebug.hpp>
Expand All @@ -24,8 +23,13 @@ bool roboticslab::CartesianControlClient::open(yarp::os::Searchable& config)
while (tries++ < 10)
{
std::string suffix = config.check("transform") ? "/rpc_transform:s" : "/rpc:s";
yarp::os::Network::connect(local + "/rpc:c", remote + suffix);
if (rpcClient.getOutputCount() > 0) break;
rpcClient.addOutput(remote + suffix);

if (rpcClient.getOutputCount() > 0)
{
break;
}

CD_DEBUG("Wait to connect to remote RPC server, try %d...\n", tries);
yarp::os::Time::delay(0.5);
}
Expand All @@ -42,8 +46,13 @@ bool roboticslab::CartesianControlClient::open(yarp::os::Searchable& config)

while (tries++ < 10)
{
yarp::os::Network::connect(local + "/command:o", remote + "/command:i");
if (commandPort.getOutputCount() > 0) break;
commandPort.addOutput(remote + "/command:i", "udp");

if (commandPort.getOutputCount() > 0)
{
break;
}

CD_DEBUG("Wait to connect to remote command server, try %d...\n", tries);
yarp::os::Time::delay(0.5);
}
Expand Down

0 comments on commit 082597a

Please sign in to comment.