Skip to content

Instantly share code, notes, and snippets.

View ayrton04's full-sized avatar

Tom Moore ayrton04

  • Locus Robotics
  • Edinburgh, United Kingdom
  • 05:46 (UTC +01:00)
  • LinkedIn in/automatom
View GitHub Profile
@ayrton04
ayrton04 / rosbag_tf_filter
Last active March 21, 2022 11:18
ROS rosbag filter command for filtering out specific tf transforms from your bag files
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')))"