|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.|
Using the Robot MonitorDescription: The Robot Monitor is used to view the aggregated diagnostics of a robot. It's useful to view diagnostics data to diagnose and debug hardware and driver problems.
Tutorial Level: BEGINNER
The rqt_robot_monitor package (robot_monitor before Groovy) is designed to view robot diagnostics data. The Robot Monitor tool listens to the analyzed data from the diagnostic_aggregator. Using Robot Monitor, users can observe, analyze and report problems with hardware, devices or drivers.
Robot Monitor is part of the pr2_dashboard.
Starting the Robot Monitor
Install ROS on your machine, if you haven't already, then:
$ apt-get install ros-%YOUR_ROS_DISTRO%-rqt-robot-monitor
If you're on ROS that's earlier than Groovy:
$ rosdep install robot_monitor $ rosmake robot_monitor
Setup and Connection
Setting ROS Master
First, make sure your ROS Master is pointed at the right place.
$ echo $ROS_MASTER_URI
should print something like:
If "localhost" isn't the name of your robot, set your master.
$ export ROS_MASTER_URI=http://COMPUTER_NAME:11311/
You may need to make sure that your robot is properly configured for the Robot Monitor. If you're using a Willow Garage PR2, the robot will already be configured, and you can skip this step. If you're not sure about your robot, use the following procedure to check it.
In order to use the Robot Monitor, the robot must have the diagnostic_aggregator running. If your robot is a Willow Garage PR2, it will have the aggregation tool running automatically. If you're not sure, check:
$ rostopic list | grep diagnostics
If you see "/diagnostics_agg" in the output, the aggregator is running.
If you do not see "/diagnostics_agg", you'll have to set up a diagnostic_aggregator on the robot. See the Configuring Diagnostic Aggregators tutorial for details.
Using the Robot Monitor
After you set your Master, type:
$ rosrun rqt_robot_monitor rqt_robot_monitor $ rosrun robot_monitor robot_monitor ## Ealier than Groovy
in the same terminal.
The Robot Monitor will start up and display the incoming data from the robot.
In the bottom window, use the tree control to expand or collapse sub items in each category.
To see an item in more detail, double click, and a viewer will pop up. Multiple views can be used for different items.
For easy copy-and-pasting, take a "snapshot" of the item. A new window will pop up with the frozen state.
When finished with the item, close the viewer.
Rewinding and Playback
Using the timeline at the bottom of the Robot Monitor panel, you can go back to a recent message to view intermittent errors. Simply drag the dial along the timeline. All status viewers will update with the timeline change. When you're using the timeline tool, the Robot Monitor will pause, and won't update.
To resume "live" viewing, click the "Pause" button.
Using a Status Viewer, you can rewind and play back a single item at a time. Use the timeline tool in that status viewer to drag to a previous message. For easy copy-and-pasting, take a "snapshot".
Press "Pause" to resume live viewing. The snapshot window will stay open until you close it.
If this is a robot you'll be using often and you use bash, it might be nice to set an alias for that Master. Add the following line to your ~/.bashrc.ros file:
$ alias NAME='export ROS_MASTER_URI=http://COMPUTER_NAME:11311/'
Replace NAME and COMPUTER_NAME with appropriate nickname and computer name of your machines.
Some users like to set an alias for the Robot Monitor, too. If you will be using this robot often, it may be nice to set an alias to make start up easier. If you already set up an alias for your computer, it may be nice to to do so for the robot monitor as well.
$ alias viewer='rosrun rqt_robot_monitor rqt_robot_monitor'
Will open a Robot Monitor that subscribes to /diagnostics_agg from computer "COMPUTER_NAME".