diff --git a/scripts/test-bagdb.py b/scripts/test-bagdb.py index bacf3d60a31d664d5295fb69b1c6553db3f328e4..3d64feff9f49ebed8aa3e4d03126201504c3955e 100644 --- a/scripts/test-bagdb.py +++ b/scripts/test-bagdb.py @@ -10,12 +10,15 @@ import datetime import argparse parser = argparse.ArgumentParser(description='Imports ROSbags to the SWRI bag-database.') -parser.add_argument('bag_files', metavar='abc.bag', nargs='+', - help='one or more ROSBag files.') +parser.add_argument('bag_files', metavar='abc.bag', + help='A ROSBag file.') parser.add_argument('--config', dest='config_file', default='/root/.ros-bag-database/settings.yml', required=True, help='A bag-database style config file.') +parser.add_argument('--bagid', dest='bag_id', required=True, + help='The ID of the bag to be imported against.') + args = parser.parse_args() bagdb = BagDB(config_file=args.config_file) @@ -103,7 +106,7 @@ for bag_count, bag in enumerate(bags, 1): # TODO: set a relationship to the most recent global position message to allow searching batch_query_count += 1 - bagdb.AddMessageData(topic, unique_message_counter, bag_count, message_time, 0, 0, msg._type, message_json) + bagdb.AddMessageData(topic, unique_message_counter, bag_count, message_time, args.bag_id, 0, msg._type, message_json) if batch_query_count > 20000: print (".")