Main Content

Control ROS or ROS 2 Bag File Playback

After loading the bag file and creating visualizers for desired message types, you can play the ROS or ROS 2 bag file. There are various options that control the playback of the bag file. All these options can be found in the Playback panel at the bottom of the app.

Playback panel of ROS Bag Viewer

Reference Topic

Reference Topic is the topic whose frequency determines the bag file playback. The app displays all the messages in the topic that you select as the main signal and displays other messages based on the timestamps of the main signal. You can select a specific topic as the main signal using the Reference Topic drop down. If you want to display all messages for all the topics specified among the visualizers, select the topic with the highest frequency as the main signal. In this case, the app repeats messages for the lower frequency topics among the visualizers while displaying all messages from the highest frequency topic.

By default, the option for Reference Topic is Automatic. When you specify this option, based on the visualizers present in the current instance, the app selects the main signal automatically using this algorithm:

Algorithm for automatic main signal option

If you select the Automatic option, the app selects the lowest frequency topic as the main signal when there are multiple visualizers of the same data type in the app instance. The app also has a hierarchy preference for topics specified among image visualizers, followed by topics in point cloud, laser scan, odometry visualizers. When the lowest frequency topic is selected as the main signal, the app skips messages from other higher frequency topics specified among the visualizers while displaying all the messages from the lowest frequency topic.

Elapsed Time and Timestamp

In the Playback panel, by default, the app displays the elapsed time values along the slider tick labels. Elapsed Time denotes the time difference between the Start Time and Current Time on the Playback Panel. It is represented in seconds and the app displays the current value of the elapsed time in the numeric field next to the Elapsed Time Time drop down. You can enter a specific value of elapsed time in this field and the app displays the latest messages corresponding to that time in all the visualizers. Alternatively, you can drag the slider to visualize all messages at a specific time value.

If you select the Timestamp option from the drop down, the app displays the time stamp values associated with the bag file along the slider tick labels. Timestamp is the current time of playing messages from a particular topic in a rosbag file. It is represented in hh:mm:ss format on the playback panel and displays the epoch convention in the numeric field. Similar to the Elapsed Time option, you can seek through the bag file using the numeric field in the Timestamp window or the slider. The visualizers update with the latest messages received at the selected timestamp.

Playback Options

After you play the bag file and start visualizing message data, you can change the playback direction by clicking on the forward or backward button. If you wish to step through the messages in the bag file instead, you must first pause the bag file playback and then use the forward or backward step button. You can also set the speed in the Playback Speed drop-down for both message playback as well as pause-and-step-through.

Next Steps

Visualize Messages from Live ROS or ROS 2 Topics

See Also