Skip to content

Commit

Permalink
move parser to function
Browse files Browse the repository at this point in the history
  • Loading branch information
sjay05 committed Mar 25, 2024
1 parent 56a10ac commit e8e1246
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions blue_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@

CONFIG_FILE_PATH = pathlib.Path("config.yml")

parser = argparse.ArgumentParser(description="AEAC 2024 Auto-landing script")
parser.add_argument(
"--method",
help="Method for selecting landing pads",
choices=["contour", "yolo"],
default="contour",
)
args = parser.parse_args()


def current_milli_time() -> int:
"""
Expand Down Expand Up @@ -367,6 +358,15 @@ def main() -> int:
except IOError as exc:
print(f"Error when opening file: {exc}")

parser = argparse.ArgumentParser(description="AEAC 2024 Auto-landing script")
parser.add_argument(
"--method",
help="Method for selecting landing pads",
choices=["contour", "yolo"],
default="contour",
)
args = parser.parse_args()

if args.method == "contour":
return run_with_contours()

Expand Down

0 comments on commit e8e1246

Please sign in to comment.