A-SW Hub / Repositories
Local Gitea · READ ONLY
← 저장소 Repositories
REPOSITORY

via/greenhouse-fleet-control Private

[참조 MVP] 온실 이송로봇 서비스 관제 — UWB·SLAM 상태, 원격제어, UI와 OTA 작업을 연결하는 관제 참조 MVP입니다.

https://git.agrithing.ai/via/greenhouse-fleet-control.git
4 commits
2 items · feat/concrete-mvp-v2
·/ asw_component/component.py
python · 1023 B · 5b06b57 Download
from __future__ import annotationsdef execute(payload: dict) -> dict:    localization = payload.get("localization", {})    fused = 0.45 * float(localization.get("uwb", 0)) + 0.55 * float(localization.get("slam", 0))    reasons = []    if fused < 0.75: reasons.append("LOCALIZATION_QUALITY")    if int(localization.get("ageMs", 999999)) > 500: reasons.append("LOCALIZATION_STALE")    if payload.get("otaState") != "CURRENT": reasons.append("OTA_NOT_CURRENT")    accepted = not reasons    dispatch = None if not accepted else {"robotId": str(payload.get("robotId")), "missionId": str(payload.get("missionId")), "mode": "AUTONOMOUS"}    return {"component": "via/greenhouse-fleet-control", "accepted": accepted,            "status": "DISPATCHED" if accepted else "BLOCKED", "target": "service",            "missionId": str(payload.get("missionId", "unknown")), "robotId": str(payload.get("robotId", "unknown")),            "fusedLocalization": round(fused, 3), "dispatch": dispatch, "blockingReasons": reasons}