Skip to content

Instantly share code, notes, and snippets.

@sven-bock
Last active September 19, 2020 03:17
Show Gist options
  • Save sven-bock/408b6e845666e06a0cf4002271c2780f to your computer and use it in GitHub Desktop.
Save sven-bock/408b6e845666e06a0cf4002271c2780f to your computer and use it in GitHub Desktop.
rosbag filter specific TF
#Removes all tfs except the one that has 'base_footprint' as child frame id
rosbag filter old.bag new.bag "topic != '/tf' or (len(m.transforms)>0 and m.transforms[0].child_frame_id=='base_footprint')"
#Same as above but limiting other topics to '/odom' and '/scan'
rosbag filter old.bag new.bag "topic == '/odom' or topic == '/scan' or (topic == '/tf' and len(m.transforms)>0 and m.transforms[0].child_frame_id=='imu_link')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment