[Documentation] [TitleIndex] [WordIndex


Using ROS tools like rosrecord and rosplay, users can record and playback bag files containing ROS messages. For diagnostics bag files, we use tools in the diagnostic_analysis package to convert these bag files into CSV files. The export_csv.py tool converts these bag files into CSV files, with a separate CSV file for each diagnostics_msgs/DiagnosticStatus name. These CSV files can be analyzed with off-the-shelf spreadsheet software.

Larger bag files can be too large for common spreadsheet software (which support at most 65,536 rows). For large files, sparse_csv.py can thin or convert these files into smaller CSV files for analysis.

Non-Diagnostics Bagfiles

If you have any messages that aren't on the "/diagnostics" topic, they will be discarded.

Discarding message on topic: /turtle1/pose
Discarding message on topic: /turtle1/color_sensor
Discarding message on topic: /turtle1/pose
Discarding message on topic: /turtle1/color_sensor

The PR2 diagnostics toolchain uses diagnostic_msgs/DiagnosticArray messages on the "/diagnostics" topic, which is what this package is designed for. Only bag files of this type will work with the diagnostic_analysis package. To play other bag files, use rostopic.

Command-line Tools


export_csv.py [bag-files]...


Each "name" in the diagnostic status messages will have its own file. This means you'll see one file for the Power Board, another for EtherCAT Master, etc...


sparse_csv.py <csv-file> -m (--max)

sparse_csv.py <csv-file> -l LENGTH (--length)

sparse_csv.py <csv-file> -s SKIP (--skip)


  1. Analyzing Diagnostic Logs Off-Line

    This tutorial uses the diagnostic_analysis package to analyze a robot log file. These files are generated automatically by the robots when they're running and contain the entire diagnostics history of the robot. You can convert these log files into CSV files (comma separated value) that can be opened with any spreadsheet editor. This only works with diagnostic_msgs/DiagnosticArray messages on the /diagnostics topic, used in the PR2 diagnostic toolchain.

2024-07-13 13:15