Rosbag
Recording rosbags are super useful for playback.
Some rosbags
- WATonomous Rosbags
- MIT-PITT-RW Rosbags (private)
https://github.com/ros2/rosbag2
Rosbags come into two formats, .db3
or .mcap
. It seems that Foxglove invented / standardized mcap https://foxglove.dev/blog/introducing-the-mcap-file-format
ββ sensors_2023-01-03_12-46-13_-0500/
ββ sensors_2023-01-03_12-46-13_-0500_0.db3
ββ sensors_2023-01-03_12-46-13_-0500_1.db3
ββ sensors_2023-01-03_12-46-13_-0500_2.db3
ββ sensors_2023-01-03_12-46-13_-0500_3.db3
ββ ...
βββ metadata.yaml
Why was MCAP invented?
The main reason is that ROS messages are not self-contained. One does not know the format of these messages. It is difficult for third-party tools to read. https://foxglove.dev/blog/introducing-the-mcap-file-format https://github.com/ros2/rosbag2/issues/782
MCAP files are alsoΒ completely self-containedΒ β message schemas are embedded in the file, and no additional dependencies are required for decoding.
Recording Rosbags
To record the F1TENTH topics that I am interested in, to debug RRT:
To record all topics
ros2 bag record -o <bag_name> -a
ros2 bag record -o 0.9x_e7_floor5 -a
The -a
flag tells ros to record all topics.
To record a specific topic
Playing Rosbags
To play a bag, run
ros2 bag play <bag_name>
To loop forever, run
ros2 bag play -l <bag_name>
To play a bag at a slower speed, run
- though you can simply use the up and down arrows afterwards to speed up / slow down
If you want to know more commands, you can do
ros2 bag play --help
This is how I figured out how to play a specific topic
ros2 bag play <bag_name> --topics <topic_name>
- add the
--clock
at the end, idk if that sometimes fixes the issue