-
Notifications
You must be signed in to change notification settings - Fork 1
/
challenges.py
77 lines (61 loc) · 1.85 KB
/
challenges.py
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
'''
Code to hold the main logic for the challenge
'''
import http.client
import json
IP_ADDR = 'http://ec2-54-89-60-172.compute-1.amazonaws.com:8080'
START_RUN = 'run/start/'
END_RUN = 'run/end/'
COURSE = 'courseA/'
TEAM_CODE = 'VTEC'
# Coords order of courses: Speed challenge, Automated docking, Find the path, Follow the leader
GPS_NAVIGATION_A = [[10, 10], [10, 10], [10, 10], [10, 10]]
GPS_NAVIGATION_B = [[10, 10], [10, 10], [10, 10], [10, 10]]
GPS_NAVIGATION_C = [[10, 10], [10, 10], [10, 10], [10, 10]]
def speed_challenge():
'''Function to execute speed challenge'''
pass
def automated_docking():
'''Function to execute speed automated docking'''
pass
def find_the_path():
'''Function to execute find the path'''
pass
def follow_the_leader():
'''Function to execute follow the leader'''
pass
def autonomus_nav():
'''Function to execute autonomus nav'''
pass
def gps_nav_to_sc():
'''Navigate to speed challenge coords'''
pass
def gps_nav_to_ac():
'''Navigate to automated docking'''
pass
def gps_nav_to_fp():
'''Navigate to find the path coords'''
pass
def gps_nav_to_fl():
'''Navigate to follow the leader'''
pass
def start_run_server():
'''Funciont to ask for permission to start a run'''
# Call server to start course
conn = http.client.HTTPConnection(IP_ADDR)
headers = {'Content-type': 'application/json'}
foo = {'text': 'Hello HTTP #1 **cool**, and #1!'}
json_data = json.dumps(foo)
#conn.request('POST', START_RUN + COURSE + TEAM_CODE, json_data, headers)
conn.request('POST', '/testCourse1', json_data, headers)
response = conn.get_response()
print(response.read().decode())
return True
def main():
'''Main program'''
# Ask server to start run
# start = False
# while not start:
# start = start_run_server()
pass
main()