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()) {