From ceadca919f8eab9c2b678b2f03ed1c52fdc3a9b3 Mon Sep 17 00:00:00 2001 From: Nicolo' Genesio Date: Wed, 9 May 2018 15:19:20 +0200 Subject: [PATCH 1/2] yarpserver: abort if `rossrv` or `tcpros` or `xmlrpc` are not found when launched with `--ros` option It fixes #722 --- src/libYARP_serversql/src/yarpserver.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libYARP_serversql/src/yarpserver.cpp b/src/libYARP_serversql/src/yarpserver.cpp index 0b60c569d9b..9aad03ea8f6 100644 --- a/src/libYARP_serversql/src/yarpserver.cpp +++ b/src/libYARP_serversql/src/yarpserver.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -166,6 +167,17 @@ class NameServerContainer : public ComposedNameService } if (options.check("ros") || NetworkBase::getEnvironment("YARP_USE_ROS")!="") { + yarp::os::Bottle lst = yarp::os::Carriers::listCarriers(); + std::string lstStr(lst.toString().c_str()); + if (lstStr.find("rossrv") == std::string::npos || + lstStr.find("tcpros") == std::string::npos || + lstStr.find("xmlrpc") == std::string::npos) { + fprintf(stderr,"Missing one or more required carriers "); + fprintf(stderr,"for yarpserver --ros (rossrv, tcpros, xmlrpc).\n"); + fprintf(stderr,"Run 'yarp connect --list-carriers' to see carriers on your machine\n"); + fprintf(stderr,"Aborting.\n"); + return false; + } ConstString addr = NetworkBase::getEnvironment("ROS_MASTER_URI"); Contact c = Contact::fromString(addr.c_str()); if (c.isValid()) { From 93ae90e8dc603700c900364ad39d544242b6c4f2 Mon Sep 17 00:00:00 2001 From: Nicolo' Genesio Date: Wed, 9 May 2018 15:23:44 +0200 Subject: [PATCH 2/2] Update release notes --- doc/release/v2_3_72_1.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/release/v2_3_72_1.md b/doc/release/v2_3_72_1.md index 0b1e3a7fd18..5e451e7cdb9 100644 --- a/doc/release/v2_3_72_1.md +++ b/doc/release/v2_3_72_1.md @@ -34,6 +34,12 @@ Bug Fixes * Fixed `RGBDSensorWrapper` compatibilty with `frameGrabberGui2`. * Fixed joint remapping in method `getRefVelocity()`. +#### `YARP_serversql` + +* Added check if `rossrv`, `tcpros` and `xmlrpc` are installed when +yarpserver is launched with `--ros` option. (#722) + + #### `YARP_OS` * Added timeout parameter in `TcpConnector::connect()` to unify behaviour with the