-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
47 lines (23 loc) · 936 Bytes
/
main.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
from QGC_local_conn.mavlink_udp import *
from WEB_conn.GET import *
from WEB_conn.POST import *
if __name__ == "__main__":
counter = 0
print('starting connection to QGC \n')
conn = start_qgc_connection(udp = '127.0.0.1:10000')
conn.wait_heartbeat()
while 1:
ROCK_msg_list = get_from_gmail()
MAVlink_msg_list = convert_to_MAVLink(ROCK_msg_list)
print(MAVlink_msg_list)
sending_to_QGC = forward_to_QGC(MAVlink_msg_list, conn)
QGC_msg = receive_from_QGC(conn)
print(QGC_msg)
posting_to_rock7 = post_to_rock7(QGC_msg)
# print status
print('step : ', counter)
print('forwarding to QGC status : ', bool(sending_to_QGC))
print('sending to rockblock status : ', bool(posting_to_rock7) , '\n')
# delay 15 sec
time.sleep(15)
counter = counter + 1