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

I opened the bag file in read mode and used the rosbag::View class to look at each topic individually. Then saved all the messages into an object I'm more comfortable with (std::vector for instance). It's based off of the example on this page in the Wiki.

And so perform all operations/logic on the more familiar data structure and then open a new bag file in write mode into which you can add all the required messages.

This is a roundabout way to do it, but I couldn't find a method in the API to: 1. find out which topic a particular message is coming from (if I were to view all topics at once in a single for loop) or 2. modify the messages in a particular topic in place or query what topics are present in a bag and other things like that.