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

Revision history [back]

Apologies if this is the wrong part of the rviz code that does what you're asking, but I think what you're looking for is ros::master::getTopics() which is used here https://github.com/ros-visualization/rviz/blob/3cdc03a5186a53f644c5abd55b9971457bdffa1c/src/rviz/add_display_dialog.cpp#L124 in rviz to get the list of topics and add them to the display for drop downs (~85% sure this is the right thing, but it was a quick glance, either way this will do what you're asking).

Here's the API docs for that file http://docs.ros.org/en/melodic/api/roscpp/html/master_8h.html and it clearly shows the basic "get info" style calls to get all the topics and nodes on the network graph.