8 print "Usage: {} <bag_name> <debug_info topic>".format(os.path.basename(sys.argv[0]))
9 print "Output: bag_name.csv" 12 input_bag_name = sys.argv[1]
18 print "Could not open bag {}".format(input_bag_name)
22 name, ext = os.path.splitext(input_bag_name)
24 out_file_name =
"{name}.csv".format(name=name)
25 print "Writing to {}".format(out_file_name)
26 out_file = open(out_file_name,
'w')
28 for topic, msg, t
in input_bag.read_messages(topics=[sys.argv[2]]):
29 out_file.write(
'{} {:.12f} {:.12f} {:.12f}\n'.format(msg.seq, msg.ros_time, msg.sensor_time, msg.corrected_timestamp))