@@ -27,8 +27,8 @@ def main():
2727 message_queue = queue .SimpleQueue ()
2828
2929 referee_receiver = RefereeMessageReceiver (message_queue , debug = False )
30- vision_receiver = VisionDataReceiver (message_queue , debug = False )
31- decision_maker = StartUpController (game , debug = False )
30+ vision_receiver = VisionDataReceiver (message_queue )
31+ decision_maker = StartUpController (game )
3232
3333 # Start the data receiving in separate threads
3434 vision_thread = threading .Thread (target = vision_receiver .pull_game_data )
@@ -42,19 +42,10 @@ def main():
4242 vision_thread .start ()
4343 referee_thread .start ()
4444
45- < << << << HEAD
4645 TIME = 0.5
4746 FRAMES_IN_TIME = round (60 * TIME )
48- == == == =
49- begin = time .time ()
50-
51- TIME = 0.5
52- FRAMES_IN_TIME = round (60 * TIME )
53-
54- >> >> >> > 05 bd7f6 (Change RefereeCommand and Stage to enum class )
5547 frames = 0
5648
57- begin = time .time ()
5849 try :
5950 logger .debug ("LOCATED BALL" )
6051 logger .debug (f"Predicting robot position with { TIME } seconds of motion" )
@@ -66,34 +57,14 @@ def main():
6657 if message_type == MessageType .VISION :
6758 frames += 1
6859 game .add_new_state (message )
69- << << << < HEAD
7060 actual = game .records [- 1 ] # JUST FOR TESTING - don't do this irl
71- == == == =
72- # access current state data
73- # print(
74- # game.current_state.yellow_robots[0].x,
75- # game.current_state.yellow_robots[0].y,
76- # )
77-
78- # access game records from -x number of frames ago
79- # print(game.records[-1].ts, game.records[-1].ball[0].x)
80-
81- actual = game ._records [- 1 ] # JUST FOR TESTING - don't do this irl
82-
83- >> >> >> > 05 bd7f6 (Change RefereeCommand and Stage to enum class )
8461 if (
8562 len (predictions ) >= FRAMES_IN_TIME
8663 and predictions [- FRAMES_IN_TIME ] != None
8764 ):
88- << << << < HEAD
8965 logger .debug (
9066 "Ball prediction inaccuracy delta (cm): "
9167 + "{:.20f}" .format (
92- == == == =
93- print (
94- "Ball prediction inaccuracy delta (cm): " ,
95- "{:.20f}" .format (
96- >> >> >> > 05 bd7f6 (Change RefereeCommand and Stage to enum class )
9768 100
9869 * math .sqrt (
9970 (
@@ -107,7 +78,6 @@ def main():
10778 )
10879 ** 2
10980 )
110- << << << < HEAD
11181 )
11282 )
11383 for i in range (6 ):
@@ -152,21 +122,11 @@ def main():
152122 )
153123 )
154124 )
155- == == == =
156- ),
157- )
158- # for i in range(6):
159- # print(f"Blue robot {i} prediction inaccuracy delta (cm): ", '{:.20f}'.format(100 * math.sqrt((actual.blue_robots[i].x - predictions[-FRAMES_IN_TIME].blue_robots[i].x)**2 + (actual.blue_robots[i].y - predictions[-FRAMES_IN_TIME].blue_robots[i].y)**2)))
160- # for i in range(6):
161- # print(f"Yellow robot {i} prediction inaccuracy delta (cm): ", '{:.20f}'.format(100 * math.sqrt((actual.yellow_robots[i].x - predictions[-FRAMES_IN_TIME].yellow_robots[i].x)**2 + (actual.yellow_robots[i].y - predictions[-FRAMES_IN_TIME].yellow_robots[i].y)**2)))
162- >> >> >> > 05 bd7f6 (Change RefereeCommand and Stage to enum class )
163125
164126 predictions .append (game .predict_frame_after (TIME ))
165127
166128 elif message_type == MessageType .REF :
167129 game .add_new_referee_data (message )
168- print (game .last_command )
169- print (game .stage_time_left )
170130
171131 decision_maker .make_decision ()
172132
0 commit comments