From 88ed5f7e532c91d3d59978a21cf012eb4ec6eb95 Mon Sep 17 00:00:00 2001
From: Zhiying Li <zhiyingli@g.ucla.edu>
Date: Thu, 21 Oct 2021 18:53:44 -0700
Subject: [PATCH] small fix of main

---
 Code/Control/Laptop_Code/main.py                       | 10 +++++-----
 ..._zhiying.py => main_zhiying_move2ball_indv_test.py} |  2 --
 2 files changed, 5 insertions(+), 7 deletions(-)
 rename Code/Control/Laptop_Code/{main_zhiying.py => main_zhiying_move2ball_indv_test.py} (96%)

diff --git a/Code/Control/Laptop_Code/main.py b/Code/Control/Laptop_Code/main.py
index d80641a..afc2681 100644
--- a/Code/Control/Laptop_Code/main.py
+++ b/Code/Control/Laptop_Code/main.py
@@ -257,14 +257,14 @@ def main_control(gbx, gby, gb_dist, tx, ty, tz, rx, ry, rz, LIDAR_dist, debugM):
     if ballCapture: # Ball captured
 
         if goalDetect:  # Goal detected
-            move2goal(tx, ty)
-        else:  # Goal not detected
-            seeking()
+            pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4 = move2goal(tx, ty)
+        else:  # Goal not detectedpwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4 = 
+            pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4 = seeking()
     else:  # Ball not captured
         if ballDetect:  # Ball detected
-            move2ball(gbx,gby,gb_dist)
+            pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4 = move2ball(gbx,gby,gb_dist)
         else:  # Ball not detected
-            seeking()
+            pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4 = seeking()
 
     return pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4
 
diff --git a/Code/Control/Laptop_Code/main_zhiying.py b/Code/Control/Laptop_Code/main_zhiying_move2ball_indv_test.py
similarity index 96%
rename from Code/Control/Laptop_Code/main_zhiying.py
rename to Code/Control/Laptop_Code/main_zhiying_move2ball_indv_test.py
index 8b6819b..461b8ca 100644
--- a/Code/Control/Laptop_Code/main_zhiying.py
+++ b/Code/Control/Laptop_Code/main_zhiying_move2ball_indv_test.py
@@ -271,8 +271,6 @@ def main_control(gbx, gby, gb_dist, tx, ty, tz, rx, ry, rz, LIDAR_dist, debugM):
             stop_all()
             #pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4 = seeking()
 
-
-
     return pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4
 
 
-- 
GitLab