mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-11 03:59:53 +08:00
Updated README with examples of usage of the MIT stata center dataset based on jfr2018 paper. #1350
This commit is contained in:
@@ -4,34 +4,22 @@ import sys
|
||||
from tf.msg import tfMessage
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print 'Usage: $ python extract_stereo.py "2012-01-25-12-14-25"'
|
||||
print('Usage: $ python extract_stereo.py "2012-01-25-12-14-25"')
|
||||
sys.exit(0)
|
||||
|
||||
bagName = sys.argv[1]
|
||||
with rosbag.Bag(bagName + '_stereo.bag', 'w') as outbag:
|
||||
print 'Processing ' + bagName + '.bag...'
|
||||
leftCamInfoStatus = True
|
||||
leftImageStatus = True
|
||||
rightCamInfoStatus = True
|
||||
rightImageStatus = True
|
||||
print(f'Processing {bagName}.bag...')
|
||||
for topic, msg, t in rosbag.Bag(bagName + '.bag').read_messages():
|
||||
if topic == "/tf":
|
||||
outbag.write(topic, msg, t)
|
||||
elif topic == "/wide_stereo/left/camera_info":
|
||||
if leftCamInfoStatus:
|
||||
outbag.write(topic, msg, t)
|
||||
leftCamInfoStatus = not leftCamInfoStatus
|
||||
outbag.write(topic, msg, t)
|
||||
elif topic == "/wide_stereo/right/camera_info":
|
||||
if rightCamInfoStatus:
|
||||
outbag.write(topic, msg, t)
|
||||
rightCamInfoStatus = not rightCamInfoStatus
|
||||
outbag.write(topic, msg, t)
|
||||
elif topic == "/wide_stereo/left/image_raw":
|
||||
if leftImageStatus:
|
||||
outbag.write(topic, msg, t)
|
||||
leftImageStatus = not leftImageStatus
|
||||
outbag.write(topic, msg, t)
|
||||
elif topic == "/wide_stereo/right/image_raw":
|
||||
if rightImageStatus:
|
||||
outbag.write(topic, msg, t)
|
||||
rightImageStatus = not rightImageStatus
|
||||
outbag.write(topic, msg, t)
|
||||
|
||||
print 'Output: ' + bagName + '_out.bag'
|
||||
print(f'Output: {bagName}_stereo.bag')
|
||||
|
||||
Reference in New Issue
Block a user