实现行为树执行器、任务协调和技能接口

This commit is contained in:
2026-09-20 12:18:52 +08:00
commit 492676344a
143 changed files with 13010 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
"""Bounded per-camera frame window. No copying of image tensors across the BT API."""
from collections import deque
class FrameWindow:
def __init__(self,maximum=32):self.frames=deque(maxlen=maximum)
def add(self,stamp,camera,path):
if self.frames and stamp<self.frames[-1]['stamp']:self.frames.clear()
if self.frames and stamp==self.frames[-1]['stamp']:
views=self.frames[-1]['views']
if camera in views or len(views)<3:views[camera]=path
else:self.frames.append(dict(stamp=stamp,views={camera:path}))
def since(self,after,now):
return [dict(stamp=f['stamp'],views=dict(f['views'])) for f in self.frames if after<=f['stamp']<=now and now-f['stamp']<=10]