|Note: This tutorial assumes that you have completed the previous tutorials: ROS tutorials.|
|Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.|
Starting the Runtime MonitorDescription: The runtime_monitor is a useful tool for monitoring the state of your robot. It subscribes to the "/diagnostics" topic and displays the data into a simple, easy to use, format.
Tutorial Level: BEGINNER
The Runtime Monitor (in the runtime_monitor package) displays raw diagnostics data by listening to the "/diagnostics" topic. It's useful for viewing diagnostics data in real time.
Install ROS if you haven't already, then build the Runtime Monitor:
$ rosdep install runtime_monitor $ rosmake runtime_monitor
Setting the correct master
First, make sure your ROS master is pointed at the right place.
$ echo $ROS_MASTER_URI
It should give you something like:
If "localhost" isn't the name of your robot, set your master:
$ export ROS_MASTER_URI=http://COMPUTER_NAME:11311/
If this is a robot you'll be using often, it might be nice to set an alias for that master. Add the following line to your "~/.bashrc.ros":
$ alias NAME='export ROS_MASTER_URI=http://COMPUTER_NAME:11311/'
Replace NAME and COMPUTER_NAME with appropriate nickname and computer name of your machines.
Starting the monitor
It's easy with rosrun:
$ rosrun runtime_monitor monitor
In the left side of the screen, the diagnostics data will be displayed by name. They will be categorized according to status, as "Stale", "Error", "Warning" or "OK".
To view the complete state of an item, click on it, and the data will appear in the right window. By scrolling around in the window, you can track view the status, and watch for changes.
Resetting the Monitor
After an item stops publishing diagnostics for about 5 seconds, it will move to the "Stale" header in the left side of the monitor. To clear stale items, use the "Monitor >> Reset Monitor" in the menu. The monitor will quickly repopulate with all current items.
In some cases, diagnostics will not be published on "/diagnostics". To change the topic, use the "Monitor >> Change Topic" option in the menu.
IMPORTANT: The runtime monitor can only listen to topics of type "diagnostics_msgs/DiagnosticArray".
Some users like to set an alias for the runtime monitor, too.
$ alias runtime='rosrun runtime_monitor monitor'
Will open a runtime monitor that subscribes to /diagnostics from computer "COMPUTER_NAME".