-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
25 lines (22 loc) · 681 Bytes
/
main.py
File metadata and controls
25 lines (22 loc) · 681 Bytes
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
#!/usr/bin/python3
from ROVwinch import ROVwinch
import time
import argparse
import traceback
import const
# parse arguements
argParser = argparse.ArgumentParser()
argParser.add_argument("-m", "--mode", help=" mode of operation. Options: debug, deploy", default='deploy')
args = argParser.parse_args()
while True:
ROVwinchObject = ROVwinch(args.mode)
try:
ROVwinchObject.control_winch()
except Exception:
print("critical failure")
ROVwinchObject.turnOffWinchSystem()
print(traceback.format_exc())
time.sleep(const.ROVconst.failureSleep)
except KeyboardInterrupt:
ROVwinchObject.turnOffWinchSystem()
exit()