-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.py
49 lines (36 loc) · 1.22 KB
/
run.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
from client import Connection
from freight_frenzy.plot import Plot
from freight_frenzy.odo_draw import OdoDraw
from freight_frenzy.captsone_detector import CapstoneDetector
def capstone_detector():
directory = './freight_frenzy/test_imgs/'
filename = 'competition2.jpg'
detector = CapstoneDetector(directory + filename)
detector.image_prep()
detector.masked()
# detector.find_color_ranges()
def odo_drawer():
localhost = '127.0.0.1' # Used for TestServer.java
robot = '192.168.43.1'
conn = Connection(robot, 18888)
odo_draw = OdoDraw(conn)
odo_draw.draw()
def plotter():
localhost = '127.0.0.1' # Used for TestServer.java
robot = '192.168.43.1'
conn = Connection(robot, 18888)
# Label related to color and scale factor on graph
labels = {
'Lift Pos': ['black', 0],
'Lift Power': ['orange', 0],
'P Term': ['red', 0],
'I Term': ['green', 0],
'D Term': ['blue', 0],
}
plot = Plot(conn, labels, (-1, 1))
plot.generate_lines() # Creates x and y arrays for line axises
plot.update_lines() # Updates y arrays with incoming server data
if __name__ == '__main__':
capstone_detector()
# plotter()
# odo_drawer()