From 81658cb64927cd09413b4747f1fa62a6be9fcbb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke?= Date: Sun, 14 Jan 2024 10:30:50 +0100 Subject: [PATCH] Make rosnode info show topic types of unconnected subscribers --- tools/rosnode/src/rosnode/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/rosnode/src/rosnode/__init__.py b/tools/rosnode/src/rosnode/__init__.py index 91b3e983b4..55132b553c 100644 --- a/tools/rosnode/src/rosnode/__init__.py +++ b/tools/rosnode/src/rosnode/__init__.py @@ -498,7 +498,7 @@ def topic_type(t, pub_topics): # go through the master system state first try: state = master.getSystemState() - pub_topics = master.getPublishedTopics('/') + topic_types = master.getTopicTypes() except socket.error: raise ROSNodeIOException("Unable to communicate with master!") pubs = sorted([t for t, l in state[0] if node_name in l]) @@ -508,12 +508,12 @@ def topic_type(t, pub_topics): buff = "Node [%s]"%node_name if pubs: buff += "\nPublications: \n" - buff += '\n'.join([" * %s [%s]"%(l, topic_type(l, pub_topics)) for l in pubs]) + '\n' + buff += '\n'.join([" * %s [%s]"%(l, topic_type(l, topic_types)) for l in pubs]) + '\n' else: buff += "\nPublications: None\n" if subs: buff += "\nSubscriptions: \n" - buff += '\n'.join([" * %s [%s]"%(l, topic_type(l, pub_topics)) for l in subs]) + '\n' + buff += '\n'.join([" * %s [%s]"%(l, topic_type(l, topic_types)) for l in subs]) + '\n' else: buff += "\nSubscriptions: None\n" if srvs: