From c2cebcbc2f370f0e202daaaba74535f42376a604 Mon Sep 17 00:00:00 2001
From: Zhaoliang <zhz03@g.ucla.edu>
Date: Sun, 31 Oct 2021 23:56:58 -0700
Subject: [PATCH] fix one bug in auto_init()

---
 Code/Control/Laptop_Code/main_backup/main_keyboard_before.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Code/Control/Laptop_Code/main_backup/main_keyboard_before.py b/Code/Control/Laptop_Code/main_backup/main_keyboard_before.py
index 69101c8..ccb07db 100644
--- a/Code/Control/Laptop_Code/main_backup/main_keyboard_before.py
+++ b/Code/Control/Laptop_Code/main_backup/main_keyboard_before.py
@@ -431,12 +431,12 @@ def auto_control(serial_port,gbx, gby, gb_dist, tx, ty, tz, rx, ry, rz, LIDAR_di
     time.sleep(waitTime)
 
 def auto_init(init_count,gbx, gby, gb_dist, tx, ty, tz, rx, ry, rz, LIDAR_dist, debugM):
-
+    count_h = 0
     # gbx, gby, gb_dist = ball_detection.detectLive(model, minDetectionScore, showSight = True)
     pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4 = main_control(gbx, gby, gb_dist, tx, ty, tz, rx, ry, rz, LIDAR_dist, debugM)
     serial_port_out(serial_port, pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4)
     init_count += 1
-    count_h = 0
+
     return init_count,count_h
 
 def init():
-- 
GitLab