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'd use the rosbag Python API:

from rosbag import Bag
with Bag('Y.bag', 'w') as Y:
    for topic, msg, t in Bag('X.bag'):
        Y.write('/b_topic' if topic == '/a_topic' else topic, msg, t)