forked from camwolff02/groundstation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
executable file
·55 lines (52 loc) · 1.71 KB
/
cli.py
File metadata and controls
executable file
·55 lines (52 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import argparse
# add arguments for command line interface
parser = argparse.ArgumentParser(
prog="protobuf_server",
description="A ground station for TOM flight s",
epilog="text at the bottom of help",
)
# Arguments for server instance
parser.add_argument(
"-a", "--address",
default="0.0.0.0",
help="Server host address, default to all external hosts"
)
parser.add_argument("-p", "--port", default=8765, type=int, help="server port")
parser.add_argument(
"-n",
"--server-name",
default="ground control",
help="server name"
)
parser.add_argument("-r", "--rocket-name", default="TOM", help="rocket name")
parser.add_argument(
"-l",
"--enable_logging",
action="store_true",
help="enable logging on groundstation",
)
parser.add_argument("-d", "--log_dir", default="logs")
parser.add_argument(
"-c",
"--enable_camera",
action="store_true",
help="enable and disable logging on ground",
)
parser.add_argument(
"-f",
"--flip_camera",
action="store_true",
help="vertically flip the camera's image"
)
# Arguments for radio
parser.add_argument("--spi_bus", default=0, help="Which SPI Bus you're using")
parser.add_argument("--spi_cs", default=1, help="Chip select")
parser.add_argument("--spi_speed", default=1_000_000)
parser.add_argument("--pins_reset", default=27)
parser.add_argument("--pins_irq", default=17, help="Interrupt Request Pin")
parser.add_argument("--frequency", default=915_000_000)
parser.add_argument("--modulation_sf", default=10)
parser.add_argument("--modulation_bw", default=500_000, help="Bandwidth")
parser.add_argument("--modulation_cr", default=8)
parser.add_argument("--preamble_len", default=12)
parser.add_argument("--sync_word", default=0x34)