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

test both greenball detection and AT

parent 289fab03
No related merge requests found
# 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__":
url1 = 'http://192.168.0.230/cam-hi.jpg'
url2 = 'http://192.168.0.204/cam-hi.jpg'
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(url1)
gbx, gby, gb_dist = ball_detection.detectLive(model, minDetectionScore, showSight = True)
key=cv2.waitKey(5)
if key==ord('q'):
break
cv2.destroyAllWindows()
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