ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Can you try running the following script? (save to check.py, run "python check.py")

import time
import xmlrpclib
import socket
import traceback
import roslib.scriptutil
from ros import rosnode

def check(n):
    master = roslib.scriptutil.get_master()
    try:
        socket.setdefaulttimeout(3.0)
        node_api = rosnode.get_api_uri(master, n)
        if not node_api:
            print "Master does not have lookup information for node [%s]"%n
            return

        node = xmlrpclib.ServerProxy(node_api)
        start = time.time()
        socket.setdefaulttimeout(3.0)
        code, msg, bus_info = node.getBusInfo('/roswtf')
        end = time.time()
        if (end-start) > 1.:
            print "Communication with node [%s] is very slow"%n
        if code != 1:
            print "Node [%s] would not return bus info"%n
        print "[%s] ok"%(n)
    except socket.error, e:
        pass #ignore as we have rules to catch this
    except Exception, e:
        traceback.print_exc()

check('/rosout')
check('/blub')

Can you try running the following script? (save to check.py, run "python check.py")

import time
import xmlrpclib
import socket
import traceback
import roslib.scriptutil
from ros import rosnode

def check(n):
    master = roslib.scriptutil.get_master()
    try:
        socket.setdefaulttimeout(3.0)
        node_api = rosnode.get_api_uri(master, n)
        if not node_api:
            print "Master does not have lookup information for node [%s]"%n
            return

        node = xmlrpclib.ServerProxy(node_api)
        start = time.time()
        socket.setdefaulttimeout(3.0)
        code, msg, bus_info = node.getBusInfo('/roswtf')
        end = time.time()
        if (end-start) > 1.:
            print "Communication with node [%s] is very slow"%n
        if code != 1:
            print "Node [%s] would not return bus info"%n
        print "[%s] ok"%(n)
    except socket.error, e:
        pass #ignore as we have rules to catch this
    except Exception, e:
        traceback.print_exc()

check('/rosout')
check('/blub')

Update: patch to apply to roswtf/src/roswtf/graph.py to get more debugging information:

Index: graph.py
===================================================================
--- graph.py    (revision 14535)
+++ graph.py    (working copy)
@@ -304,6 +304,8 @@
         except socket.error, e:
             pass #ignore as we have rules to catch this
         except Exception, e:
+            import traceback
+            traceback.print_exc()
             ctx.errors.append(WtfError("Communication with [%s] raised an error: %s"%(n, str(e))))
         finally:
             self.done = True