Last active
March 21, 2022 11:18
-
-
Save ayrton04/662964298a82211a7e28 to your computer and use it in GitHub Desktop.
ROS rosbag filter command for filtering out specific tf transforms from your bag files
This file contains 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
rosbag filter original.bag filtered.bag "topic != '/tf' or ((len(m.transforms) > 0 and m.transforms[0].header.frame_id != 'odom') and (len(m.transforms) <= 1 or (len(m.transforms) > 1 and m.transforms[1].header.frame_id != 'odom')) and (len(m.transforms) <= 2 or (len(m.transforms) > 2 and m.transforms[2].header.frame_id != 'odom')) and (len(m.transforms) <= 3 or (len(m.transforms) > 3 and m.transforms[3].header.frame_id != 'odom')) and (len(m.transforms) <= 4 or (len(m.transforms) > 4 and m.transforms[4].header.frame_id != 'odom')))" |
Two years later and I finally read this comment. Fixed the gist. :)
6 years later, worked like a charm. :)
How do we filter list of topics?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Three years later copy/paste is not working, at least for me. Had to use '/tf' instead of 'tf'.
Might save someone half of a day, since the link is in googles top answers.
And thanks Tom, of course.