Skip to content

Commit

Permalink
ros2GH-38 Add storage_id option to CLI for play
Browse files Browse the repository at this point in the history
  • Loading branch information
botteroa-si authored and Martin-Idel-SI committed Dec 13, 2018
1 parent 8f5e4de commit 6c71b45
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ros2bag/ros2bag/verb/play.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ class PlayVerb(VerbExtension):
def add_arguments(self, parser, cli_name): # noqa: D102
parser.add_argument(
'bag_file', help='bag file to replay')
parser.add_argument(
'-s', '--storage', default='sqlite3',
help='storage identifier to be used, defaults to "sqlite3"')

def main(self, *, args): # noqa: D102
bag_file = args.bag_file
if not os.path.exists(bag_file):
return "Error: bag file '{}' does not exist!".format(bag_file)

rosbag2_transport_py.play(uri=bag_file, storage_id='sqlite3')
rosbag2_transport_py.play(uri=bag_file, storage_id=args.storage)

0 comments on commit 6c71b45

Please sign in to comment.