4 from tf.msg
import tfMessage
7 print 'Usage: $ python extract_scans.py "2012-01-25-12-14-25"' 11 with
rosbag.Bag(bagName +
'_scans.bag',
'w')
as outbag:
12 print 'Processing ' + bagName +
'.bag...' 13 for topic, msg, t
in rosbag.Bag(bagName +
'.bag').read_messages():
15 outbag.write(topic, msg, t)
16 elif topic ==
"/base_scan":
17 outbag.write(topic, msg, t)
18 elif topic ==
"/robot_pose_ekf/odom_combined":
19 outbag.write(topic, msg, t)
21 print 'Output: ' + bagName +
'_out.bag'