forked from pioneers/forseti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideopile_test.py
executable file
·45 lines (38 loc) · 978 Bytes
/
videopile_test.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
#!/usr/bin/env python2.7
from __future__ import print_function
import SocketServer
import argparse
import json
import lcm
import socket
import time
import threading
import sys
import Forseti
def main():
print("starting videopile test...")
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
data = {
"ShowFlags":True,
"ShowTimer":True,
"ShowSchedule":True,
"ShowScore":False,
"ShowShroud":False,
"Flags":
[1,1,2,0,0,
0,0,0,0,0,
2,1,0,0,0,
1,1,0,0,0],
"LeftAllianceText":"Team A\nTeam B",
"Time":"0:42",
"MatchText":"Match <size=48>5</size>",
"RightAllianceText":"Team C\nTeam D"
}
data_json = json.dumps(data)
print("payload=" + data_json)
while True:
print ('sending', data_json)
sock.sendto(data_json, ('10.20.34.120', 4999))
time.sleep(1)
if __name__ == '__main__':
main()