Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions blue_interface/rosbridge_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,23 @@ def id_counter(self):
self._id_counter += 1
return self._id_counter

def get_topics(self, callback=None, errback=None):
"""Retrieve list of topics in ROS.
Note:
To make this a blocking call, pass ``None`` to the ``callback`` parameter .
Returns:
list: List of topics if blocking, otherwise ``None``.
"""
service = _Service(self, '/rosapi/topics', 'rosapi/Topics')

result = service.request({}, callback)

if callback:
return

assert 'topics' in result
return result['topics']

def publisher(self, topic_name, message_type, latch=False, queue_size=1):
"""Create a _Publisher object if the given topic hasn't been advertised, otherwise return the existing
publisher that is currently advertising the topic.
Expand Down