fix(pybot): 录制时改用同步 capture() 按需抓帧,避免帧重复
_grab_frame 从 camera.latest()(读后台队列)改为 camera.capture() (直接调 grabber 同步抓帧),确保每个微动作拿到独立帧而非队列中 可能重复的旧帧。Camera 新增 capture() 方法。
This commit is contained in:
1 parent
3fc213e7b9
commit
bfa6d8deb6
3 files changed
+25
-5
No files matched your search
@@ -69,6 +69,12 @@ class Camera:
|
||||
with self._lock:
|
||||
return self._queue[-1] if self._queue else None
|
||||
|
||||
def capture(self):
|
||||
"""同步抓一帧(按需,不从队列读);dry_run 或无 grabber 返回 None"""
|
||||
if self._grabber is None:
|
||||
return None
|
||||
return self._grabber()
|
||||
|
||||
def snapshot(self):
|
||||
"""队列快照 list(旧→新),供消费方批量取帧"""
|
||||
with self._lock:
|
||||
|
||||
Reference in new issue
Block a user