ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This cmd line would extract all messages on topic /odometry/gps between t1 and t2 and between t3 and t4. Is that what you want?

rosbag filter bag_in.bag bag_out.bag "topic == '/odometry/gps' and ((m.header.stamp.secs > t1 and m.header.stamp.secs < t2) or (m.header.stamp.secs > t3 and m.header.stamp.secs < t4))"

This cmd line would extract all messages on topic /odometry/gps between t1 and t2 and between t3 and t4. t4 (you can keep extending it for other intervals). Is that what you want?

rosbag filter bag_in.bag bag_out.bag "topic == '/odometry/gps' and ((m.header.stamp.secs > t1 and m.header.stamp.secs < t2) or (m.header.stamp.secs > t3 and m.header.stamp.secs < t4))"