rosbag: fix bug in get_indexes

This commit is contained in:
Tim Field 2010-04-21 04:35:48 +00:00
parent d818f5392a
commit f79bcb3fba
2 changed files with 7 additions and 2 deletions

View File

@ -837,7 +837,7 @@ class _BagReader(object):
if topics is None and topic_filter is None:
return self.bag._topic_indexes.values()
if topics is not None:
if topics is None:
topics = self.bag._topic_indexes.keys()
if topic_filter is not None:

View File

@ -99,10 +99,15 @@ def main():
b.write('/ints', msg, t)
b.close()
start_time = roslib.rostime.Time.from_sec(0)
end_time = roslib.rostime.Time.from_sec(8)
for (topic, msg, t) in rosbag.Bag('timing.bag').getMessages(topics=['/intsa'], start_time=start_time, end_time=end_time):
print topic, msg, t
sys.exit()
if __name__ == '__main__':
#main()
main()
import rostest
rostest.run(PKG, 'TestRosbag', TestRosbag, sys.argv)