Inspecting the system

When our system is running, we might have several nodes and many more topics publishing messages amongst each other. We might also have nodes providing actions or services. For large systems, it is important to have tools that let us see what is running at a given time. ROS provides basic but very powerful tools with this goal in mind, from the CLI to GUI applications.

Listing nodes, topics, services, and parameters from our perspective, 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:

Obtain the list of all

Command

Nodes running

rosnode list

Topics of all nodes running

rostopic list

Services of all nodes running

rosservice list

Parameters on the server

rosparam list

 

We recommend that you go back to Chapter 2, ROS Architecture and Concepts, to see how these commands also allow us to obtain the message type sent by a particular topic, as well as its fields, using rosmsg show.

Any of these commands can be combined with regular bash commands, such as grep, to look for the desired nodes, topics, services, or parameters. For example, action goal topics can be found using the following command:

    $ rostopic list | grep goal
  

The grep command looks for text or patterns in a list of files or the standard output.

Additionally, ROS provides several GUIs for you to play with topics and services. First, rqt_top shows the nodes running in an interface, similar to a table of processes (ToP), which allows us to rapidly see all the nodes and resources they are using. For the following screenshot, we have used the REEM simulation with the navigation stack running as an example:

On the other hand, rqt_topic provides us with information about topics, including publishers, subscribers, the publishing rate, and messages published. You can view the message fields and select the topics you want to subscribe to in order to analyze their bandwidth and rate (Hz) and see the latest message published; note that latched topics do not usually publish continuously, so you will not see any information about them. The following screenshot shows this:

Similarly, rqt_publisher allows us to manage multiple instances of rostopic pub commands in a single interface. It also supports Python expressions for the published messages and fixed values. In the following screenshot, we will see two example topics being published (we will see the messages using rostopic echo <topic> in two different terminals):

Note that rqt_service_caller does the same thing for multiple instances of rosservice call commands. In the following screenshot, we will call the /move_base/NavfnROS/make_plan service, which is where we have to set up the request; for empty services, this is not needed, due to the /global_localization service from the /amcl node. After clicking on the Call button, we will obtain the response message. For this example, we have used the REEM simulation with the navigation stack running:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.185.170