[ROS] rosbag filter multiple topics

rosbag filter

1. What is rosbag filter?

Using rosbag filter, We can selectively save specific topics from recorded rosbag file which even contains unnecessary topics for us. This is expression to use rosbag filter. $ filter <in-bag> <out-bag> <expression>’

ex) single topic

$ rosbag filter my.bag only-tf.bag "topic == '/tf'"

ex) multiple topics

$ rosbag filter input.bag output.bag "topic == '/ouster/imu_packets' or topic == '/ouster/lidar_packets' or topic == '/imu/data'"

ex) time period

$rosbag filter input.bag output.bag "t.secs >= 16781699884.123 and t.secs <= 167816994.123"

Leave a Reply

Your email address will not be published. Required fields are marked *