When our system is running, we might have several nodes and even more topics publishing messages and connected by subscription among nodes. Also, we might have some nodes providing services as well. For large systems, it is important to have some tools that let us see what is running at a given time. ROS provides us with some basic but powerful tools to do so, and also to detect a failure in any part of the nodes graph; that is, the architecture that emerges from the connection of ROS nodes using topics.
In our honest opinion, we should start with the most basic level of introspection. We are going to see how to obtain the list of nodes running, and topics and services available at a given time. Although extremely simple, this is very useful and robust.
To obtain the list of nodes running use:
rosnode list
The topics of all nodes are listed using:
rostopic list
And, similarly, all services are shown by:
rosservice list
We recommend...