From 74027172c6257a1d634d585e846635cd24a4a770 Mon Sep 17 00:00:00 2001 From: Zhiying Li <zhiyingli@g.ucla.edu> Date: Wed, 10 Nov 2021 16:18:40 -0800 Subject: [PATCH] change variable name --- Code/Control/Laptop_Code/main_joystick.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Code/Control/Laptop_Code/main_joystick.py b/Code/Control/Laptop_Code/main_joystick.py index 177228d..bd8635b 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() -- GitLab