Created
January 7, 2020 23:17
-
-
Save janpaul123/deaa92338d5e8309ef7aa7a55d625152 to your computer and use it in GitHub Desktop.
Read an "input.bag" ROS bag with messages stored in arbitrary order, and write to "output.bag" ordered by receive time (required by Webviz to read)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rosbag | |
with rosbag.Bag('output.bag', 'w') as outbag: | |
for topic, msg, t in rosbag.Bag('input.bag').read_messages(): | |
outbag.write(topic, msg, t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment