Go to the documentation of this file.00001 import roslib; roslib.load_manifest('hai_sandbox')
00002 import rospy
00003 import rosrecord
00004 import sys
00005
00006 f = open(sys.argv[1])
00007 i = 0
00008 for topic, message, time in rosrecord.logplayer(f):
00009 i = i + 1
00010 print topic, time
00011 if i > 10:
00012 break
00013 f.close()
00014
00015
00016
00017
00018
00019 def bag_reader(file_name, topics):
00020 f = open(file_name)
00021 tdict = {}
00022 for t in topics:
00023 tdict[t] = True
00024 for r in rosrecord.logplayer(f):
00025 if tdict.has_key(r[0]):
00026 yield r
00027 f.close()
00028