Rosbag python source code. bag', 'w') # 定义bag变量, ‘test.