filter rosbag based on message from topic

asked 2022-07-06 14:25:28 -0600

I'm trying to filter a rosbag file based on the values of a message within a specific topic, and I cannot seem to figure out how to access the message within a topic based on what is available online. I have a rosbag file from a recording from Intel RealSense cameras, and it contains topics that have all the information for each frame, for example:

         /device_0/sensor_0/Depth_0/image/data                                59 msgs    : sensor_msgs/Image

I used bagpy to see what the messages are within this topic, and it contains a 'header.seq' sequential label. I'd like to filter out every other frame. What would be the syntax in the 'rosbag filter' command to access the header.seq message within this specific topic so that I can remove a subset of frames based on their number?

Thank you in advance for any help!

edit retag flag offensive close merge delete