From 380fc4a150f3612e88086dca122f5ddd39b7ef44 Mon Sep 17 00:00:00 2001
From: Zhiying Li <zhiyingli@g.ucla.edu>
Date: Thu, 4 Nov 2021 22:19:42 -0700
Subject: [PATCH] run #2 and #4 esp-cam at the same time with #1 and #6

---
 .../Laptop_Code/imageThread_AT_gb_2_4.py      | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 Code/Control/Laptop_Code/imageThread_AT_gb_2_4.py

diff --git a/Code/Control/Laptop_Code/imageThread_AT_gb_2_4.py b/Code/Control/Laptop_Code/imageThread_AT_gb_2_4.py
new file mode 100644
index 0000000..62ffb17
--- /dev/null
+++ b/Code/Control/Laptop_Code/imageThread_AT_gb_2_4.py
@@ -0,0 +1,39 @@
+# import sys
+# sys.path.append("../")
+
+from ESP32_AT.imageTread_AT import get_AT_6DOF_info
+
+from constants import *
+import ball_detection.ball_detection as ball_detection
+import cv2
+
+# detector = apriltag.Detector()
+
+
+if __name__ == "__main__":
+    url_AT = 'http://10.0.0.3/cam-hi.jpg' #2
+    url_gb = 'http://10.0.0.6/cam-hi.jpg' #4
+
+
+    tid,tx,ty,tz,rx,ry,rz = 0,0,0,0,0,0,0
+
+    # GB
+    ball_detection.modifyCore()
+    # modelLoc          = './ball_detection/model_weights/'
+    # modelFile         = 'model_weights-2-20210818_002355-cpu.pth'
+    model = ball_detection.returnModel(device, labelSet, modelLoc, modelFile)
+
+    gbx, gby  = -1, -1   # by default (-1 means no found green ball)
+    gb_dist = -1         # by default (-1 means no found green ball)
+
+
+    while True:
+        tid,tx,ty,tz,rx,ry,rz = get_AT_6DOF_info(url_AT)
+
+        # gbx, gby, gb_dist = ball_detection.detectLive(url_gb, model, minDetectionScore, showSight = True)
+
+        key=cv2.waitKey(5)
+        if key==ord('q'):
+            break
+
+    cv2.destroyAllWindows()
-- 
GitLab