ros / ros_comm

ROS communications-related packages, including core client libraries (roscpp, rospy, roslisp) and graph introspection tools (rostopic, rosnode, rosservice, rosparam).
http://wiki.ros.org/ros_comm
761 stars 912 forks source link

Create public Python function for rostopic list in rostopic package #946

Open gordonbrander opened 7 years ago

gordonbrander commented 7 years ago

Currently, the only function rostopic has for listing topics is private, and it is only useful for the cli usecase because it calls print.

rosgraph.Master("/rostopic").getSystemState() may be used instead of rostopic, but this seems like an abuse of an API which is meant for graph image generation.

I would like to propose that a public rostopic.list function be added to the rostopic package, listing all topic names (and perhaps types).

mikepurvis commented 7 years ago

I don't disagree with you, but FWIW, what you suggest is exactly how rosbridge handles inspecting the system:

https://github.com/RobotWebTools/rosbridge_suite/blob/a7a2e1a473a1da1acf252d2496fa7db0f211a29f/rosapi/src/rosapi/proxy.py#L49-L56

zbynekwinkler commented 4 years ago

Should this be closed since get_topic_list() has been merged?