update 更新设定

This commit is contained in:
FrankCV2048
2024-12-17 19:56:40 +08:00
parent cc8f2e483c
commit 4dbf8d4cf3
5 changed files with 20 additions and 5 deletions

View File

@ -20,7 +20,9 @@ class Detect:
if self.detect_status == DetectStatus.DNone:
return
if self.detect_status == DetectStatus.DDetect:
if Constant.Debug:
self.detect_status = DetectStatus.DOk
return
_, img, xyz, uvw, points = self.detection.get_position(Point_isVision=False, Box_isPoint=True,
First_Depth=True, Iter_Max_Pixel=30,
save_img_point=0, Height_reduce=30, width_reduce=30)

View File

@ -188,13 +188,19 @@ class Feeding(QObject):
self.pos_near_index = -1
self.catch = Catch(self.robotClient)
self.detect = Detect(self.detection)
self.detect_thread_img = threading.Thread(target=self.detect.run)
self.detect_thread_img.start()
self.is_detected = True
self.detect_thread = threading.Thread(target=self.run_detect)
self.detect_thread.start()
pass
def init_detection_image(self):
self.detection_image = cv2.imread(Constant.feed_sign_path)
def run_detect(self):
while self.is_detected:
self.detect.run()
time.sleep(0.02)
def run(self):
self.catch.run()
# 获取事件坐标
@ -298,6 +304,11 @@ class Feeding(QObject):
if self.detect.detect_status == DetectStatus.DNone:
self.detect.detect_status = DetectStatus.DDetect
elif self.detect.detect_status == DetectStatus.DOk:
if Constant.Debug:
self.detect.detect_status = DetectStatus.DNone
self.feedConfig.feedLine.set_take_position(real_position)
self.next_position()
if self.detect.detect_position != None:
log.log_message(logging.INFO, Constant.str_feed_takePhoto_success)
self.feedConfig.feedLine.set_take_position(self.detect.detect_position)