extract_rgbd.py
Go to the documentation of this file.
1 import rosbag
2 import tf
3 import sys
4 from tf.msg import tfMessage
5 
6 if len(sys.argv) < 2:
7  print 'Usage: $ python extract_rgbd.py "2012-01-25-12-14-25"'
8  sys.exit(0)
9 
10 bagName = sys.argv[1]
11 with rosbag.Bag(bagName + '_rgbd.bag', 'w') as outbag:
12  print 'Processing ' + bagName + '.bag...'
13  for topic, msg, t in rosbag.Bag(bagName + '.bag').read_messages():
14  if topic == "/tf" or topic == "/camera/depth/image_raw" or topic == "/camera/rgb/camera_info" or topic == "/camera/rgb/image_raw":
15  outbag.write(topic, msg, t)
16 print 'Output: ' + bagName + '_out.bag'


rtabmap_ros
Author(s): Mathieu Labbe
autogenerated on Mon Dec 14 2020 03:42:19