88from proto .import_all_protos import *
99
1010from software .simulated_tests import validation
11- from software .thunderscope .constants import EstopMode
11+ from software .thunderscope .constants import EstopMode , IndividualRobotMode
1212from software .thunderscope .thunderscope import Thunderscope
1313from software .thunderscope .proto_unix_io import ProtoUnixIO
1414from software .thunderscope .binary_context_managers .full_system import FullSystem
1515from software .thunderscope .binary_context_managers .game_controller import Gamecontroller
16+ from software .thunderscope .wifi_communication_manager import WifiCommunicationManager
1617from software .logger .logger import create_logger
1718
1819
@@ -360,27 +361,29 @@ def field_test_runner():
360361
361362 # Launch all binaries
362363 with FullSystem (
363- runtime_dir ,
364+ full_system_runtime_dir = runtime_dir ,
364365 debug_full_system = debug_full_sys ,
365366 friendly_colour_yellow = args .run_yellow ,
366367 should_restart_on_crash = False ,
367368 ) as friendly_fs , Gamecontroller (
368369 # we would be using conventional port if and only if we are playing in robocup.
369370 suppress_logs = (not args .show_gamecontroller_logs ),
370371 use_conventional_port = False ,
371- ) as gamecontroller , RobotCommunication (
372+ ) as gamecontroller , WifiCommunicationManager (
372373 current_proto_unix_io = friendly_proto_unix_io ,
373374 multicast_channel = getRobotMulticastChannel (args .channel ),
375+ should_setup_full_system = True ,
374376 interface = args .interface ,
375- estop_mode = estop_mode ,
376- estop_path = estop_path ,
377- enable_radio = args .enable_radio ,
378377 referee_port = gamecontroller .get_referee_port ()
379378 if gamecontroller
380379 else SSL_REFEREE_PORT ,
380+ ) as wifi_communication_manager , RobotCommunication (
381+ current_proto_unix_io = friendly_proto_unix_io ,
382+ communication_manager = wifi_communication_manager ,
383+ estop_mode = estop_mode ,
384+ estop_path = estop_path ,
381385 ) as rc_friendly :
382386 friendly_fs .setup_proto_unix_io (friendly_proto_unix_io )
383- rc_friendly .setup_for_fullsystem ()
384387
385388 gamecontroller .setup_proto_unix_io (
386389 blue_full_system_proto_unix_io = blue_full_system_proto_unix_io ,
@@ -398,6 +401,13 @@ def field_test_runner():
398401 layout_path = None ,
399402 )
400403
404+ # Set control mode for all robots to AI so that packets are sent to the robots
405+ for robot_id in range (MAX_ROBOT_IDS_PER_SIDE ):
406+ rc_friendly .toggle_individual_robot_control_mode (
407+ robot_id ,
408+ IndividualRobotMode .AI ,
409+ )
410+
401411 # connect the keyboard estop toggle to the key event if needed
402412 if estop_mode == EstopMode .KEYBOARD_ESTOP :
403413 tscope .keyboard_estop_shortcut .activated .connect (
0 commit comments