refactor(simulator): extract habitat simulator and visualization modules

This commit is contained in:
2026-03-28 17:05:06 +08:00
parent 817f45b935
commit 3c9a6f6eaf
9 changed files with 725 additions and 226 deletions

View File

@@ -13,12 +13,17 @@ class ObjectNode:
position: np.ndarray # [x, y, z] 世界坐标系下的中心点或锚点
# 特征:直接存你压缩后的 512bit 结果,不搞历史缓存
visual_hash: np.ndarray # 512bit 视觉特征 (用于外观检索)
semantic_hash: np.ndarray # 512bit 语义特征 (用于类别对齐)
# 原始图片mask处理并裁切后的图片数据二进制格式
image_bytes: bytes | None = None # numpy array.tobytes() 原始像素数据
visual_hash: bytes # 512bit 视觉特征 (用于外观检索)
semantic_hash: bytes # 512bit 语义特征 (用于类别对齐)
# Debug 必备:极简的生命周期管理,防止满屏"幽灵节点"
hit_count: int = 1 # 被观测到的次数。太低的可以直接过滤掉
last_seen_frame: int = 0 # 最后一次看到的帧号或时间戳
def __post_init__(self):
if len(self.visual_hash) != 64:
raise ValueError("visual_hash must be exactly 64 bytes (512 bits)")
if len(self.semantic_hash) != 64:
raise ValueError("semantic_hash must be exactly 64 bytes (512 bits)")
if self.position.shape != (3,):
raise ValueError("position must have shape (3,)")