Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 import roslib; roslib.load_manifest('rosbag')
00012 import sys, rosbag
00013 outbag = rosbag.Bag(sys.argv[2], 'w')
00014 try:
00015 for topic, msg, t in rosbag.Bag(sys.argv[1]).read_messages():
00016 if topic == "/tf":
00017 outbag.write(topic, msg, msg.transforms[0].header.stamp)
00018
00019 elif not topic == "/rosout":
00020 outbag.write(topic, msg, msg.header.stamp if msg._has_header else t)
00021 finally:
00022 outbag.close()
00023