Skip to content
Snippets Groups Projects
Commit 74027172 authored by Zhiying Li's avatar Zhiying Li
Browse files

change variable name

parent 8bb273ad
Branches
No related merge requests found
......@@ -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()
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment