diff --git a/Code/Control/Laptop_Code/main_joystick.py b/Code/Control/Laptop_Code/main_joystick.py index 177228dcd42b1db13fdc9edd57f23b5cc9f729ba..bd8635bdc14cf840d45cebfc25f4815e2fb2d3a4 100644 --- a/Code/Control/Laptop_Code/main_joystick.py +++ b/Code/Control/Laptop_Code/main_joystick.py @@ -168,7 +168,7 @@ def auto_init(serial_port,auto_init_count,gbx, gby, gb_dist, tx, ty, tz, rx, ry, def auto_control(serial_port): # Ctl_com = [0, 0, 0, 0, "+", "+", "+", "+"] - if ml == 1: + if ml_on == 1: gbx, gby, gb_dist = ball_detection.detectLive(url_gb, model, minDetectionScore, showSight=True) print("gbx,gby:{},{}".format(gbx, gby)) @@ -487,7 +487,7 @@ if __name__ == '__main__': # =========== SET UP ============ # Defining Variables for ESP 32 Serial I/O - PORT = "COM11" # for Alienware + PORT = "COM9" # for Alienware serial_port = serial.Serial(PORT, 115200) serial_port.close() serial_port.open() @@ -517,13 +517,13 @@ if __name__ == '__main__': done = False # Loading the PyTorch ML model for ball detection - if ml == 1: + if ml_on == 1: ball_detection.modifyCore() model = ball_detection.returnModel(device, labelSet, modelLoc, modelFile) # =========== DECLARE VARIABLES =========== # game controller id - controller_id = 1 # default is 0 if you plug in only one game controller + controller_id = 0 # default is 0 if you plug in only one game controller # ESP CAM In gbx, gby = -1, -1 # by default (-1 means no found green ball) @@ -598,4 +598,4 @@ if __name__ == '__main__': print_count = 0 pygame.time.wait(100) - pygame.quit() \ No newline at end of file + pygame.quit()