# Replaying Recorded Data

During software development it is common to test software and algorithms on pre-recorded real-world and simulated data. ROS enables this ability through the use of .bag files. Each .bag contains the topics which were selected to be recorded at the time the file was created.

# ROS Dataset Locations

The AVC team typically stores recorded datasets in on the NAS, which is mounted to most AVC servers and Docker environments under /mnt. External datasets (such as BDD100K, NuScenes, etc.) are mounted under /mnt/datasets-external while internal datasets, produced by the SOAR team, are available under /mnt/datasets and /mnt/dataset-dropbox.

# Playing ROS Bag Data

To play the ROS bag data, a system with ROS installed must be used. The most convenient way to do this for most will be through the use of the AVC vehicle docker. Once inside the docker, simply start roscore, then run:

rosbag play --clock path-to-desired.bag

This will play the rosbag, allowing the system to act as if it is ingesting real time data.

If a large number of bag files are included in the folder (i.e. bag_1.bag, bag_2.bag, ... bag_n.bag)and you would like to run over all of them, use:

rosbag play --clock bag_*.bag

Finally, to loop continuously, as is often desirable when testing, use the -l flag:

rosbag play --clock -l bag_*.bag

# Visualizing Using Rviz

First, start up rviz to graphically display data.

rosrun rviz rviz

Once the /tf_static topic is published (through either of the methods above), the fixed frame may be selected. To do so, select the the drop-down in the upper left corner of the window under "Displays > Global Options > Fixed Frame" and select "base_link".

Next, below the "Displays" window should be a button which says "Add", select this, then select the "By Topic" tab – if the ROS bag is playing, topics should be listed in this tab. Lidar objects will be viewable as "PointCloud2" objects, and cameras as "Images" and so on.