From 5348222facf035cf42a8c7a94fb91957bfaa264e Mon Sep 17 00:00:00 2001 From: CHAMPION923 <1056156912@qq.com> Date: Tue, 3 Jun 2025 18:24:32 +0800 Subject: [PATCH] debug202506031824 --- lib/io/process2d.py | 4 ++-- lib/io/process3d.py | 4 ++-- lib/presenter/presenter.py | 12 +++++++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/io/process2d.py b/lib/io/process2d.py index 19cc9a0..865ac6f 100644 --- a/lib/io/process2d.py +++ b/lib/io/process2d.py @@ -22,8 +22,8 @@ class Process2D(Process): while True: sig = self.in_q.get() if sig == CameraControl.CAPTURE: - img = self.camera.capture() - self.out_q.put({"title": cfg["title"], "img": img}) + img = camera.capture() + self.out_q.put({"title": self.cfg["title"], "img": img}) elif sig == CameraControl.DESTORY: for fn in ("destroy", "close", "release"): if hasattr(self.camera, fn): diff --git a/lib/io/process3d.py b/lib/io/process3d.py index 9232d06..db63ff1 100644 --- a/lib/io/process3d.py +++ b/lib/io/process3d.py @@ -20,9 +20,9 @@ class Process3D(Process): while True: sig = self.in_q.get() if sig == CameraControl.CAPTURE: - _, _, dep_img = self.camera.capture() + _, _, dep_img = camera.capture() # self.out_q.put({self.cfg["title"]: dep_img}) - self.out_q.put({"title": cfg["title"], "dep_img": dep_img}) + self.out_q.put({"title": self.cfg["title"], "dep_img": dep_img}) elif sig == CameraControl.DESTORY: self.camera.destroy() break diff --git a/lib/presenter/presenter.py b/lib/presenter/presenter.py index 74a84af..ff87bf3 100644 --- a/lib/presenter/presenter.py +++ b/lib/presenter/presenter.py @@ -1,4 +1,6 @@ from concurrent.futures import ThreadPoolExecutor, as_completed +from lib.alg.track_detection import TrackDetector +from ctypes import set_errno from threading import Semaphore from datetime import datetime from typing import Deque @@ -109,6 +111,12 @@ class Presenter: "title": img_data["title"], } + def track_tecetion_mode_data_handle(self): + tractor_dic = {} + for key in self.process3d_info.keys(): + if key.endswith("避障"): + continue + # TODO: 避障模式相机采集和数据处理 def obstacle_mode_data_handle(self): """获取所有3D避障相机的数据并处理,直到所有处理完成再继续""" @@ -141,7 +149,7 @@ class Presenter: else: dist_str = "000" if last_dist is None else f"{last_dist:.2f}" - self.pkt[key] = dist_str + self.pkt[key + "_distance"] = dist_str # 6. 总状态字段 self.pkt["f_obstacle_status"] = ( @@ -222,6 +230,8 @@ class Presenter: self.front_mode_data_handle() elif self.mode == VisionMode.REAR_2D_DETECTION: self.rear_mode_data_handle() + elif self.mode == VisionMode.TRACK_INSPECTION: + pass # TODO: tcp发送数据 try: