记录0x0E解除锁定有效; 自动解锁判据转为待定项

实测0x0E停止跟踪后bit2复位(厂商软件锁定框同步消失); --auto-unlock 的触发判据
(表4超时)对本设备存疑(无激光时表4可能根本不发→一锁定就误解锁), 已在代码标注
风险并在部署文档新增§10.1列出待确认项与5种候选判据。全量351条通过
This commit is contained in:
keita
2026-09-28 16:20:07 +08:00
parent dbce0a862f
commit fc364656ec
2 changed files with 29 additions and 1 deletions
+6 -1
View File
@@ -133,7 +133,9 @@ def main() -> int:
help="在识别开之后追加 发现目标自动锁定(0x0F)与 识别转跟踪(0x10)")
ap.add_argument("--motor-on", action="store_true", help="启动时先下发 开电机(0x27)")
ap.add_argument("--auto-unlock", type=float, default=0.0, metavar="SEC",
help="锁定中若表4 超过 SEC 秒未更新,自动发 0x0E 解除锁定")
help="锁定中若表4 超过 SEC 秒未更新,自动发 0x0E 解除锁定。"
"⚠ 触发判据依赖表4;本设备无激光测距,表4 可能根本不发, "
"启用前须实测确认(见部署文档 §10)")
ap.add_argument("--unlock-on-exit", action="store_true",
help="退出前发一帧 0x0E 解除锁定")
args = ap.parse_args()
@@ -218,6 +220,9 @@ def main() -> int:
latest_tgt = frame
# ---- 自动解除锁定:锁定中但表4 长时间不更新 ----
# ⚠ 本设备无激光测距,表4(目标经纬度)可能始终不发 → last_tgt_s 恒为
# None,此判据会一锁定就误解锁。启用前先用控制台观察「目标帧 距今」,
# 确认锁定后表4 真的在发。触发判据的替代方案见部署文档 §10。
if (args.auto_unlock > 0 and latest is not None
and latest.is_target_locked
and (last_tgt_s is None or now_s - last_tgt_s > args.auto_unlock)