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

kitech/greenhouse-rail-entry-safety Private

[참조 MVP] 온실 레일 진입·안전 제어 — 온실 레일 진입 조건, 안전영역, 에너지 상태를 판정하는 참조 MVP입니다.

https://git.agrithing.ai/kitech/greenhouse-rail-entry-safety.git
4 commits
2 items · feat/concrete-mvp-v2
·/ asw_component/component.py
python · 847 B · b373575 Download
from __future__ import annotationsdef execute(payload: dict) -> dict:    reasons = []    if not payload.get("railDetected"): reasons.append("RAIL_NOT_DETECTED")    if abs(float(payload.get("alignmentErrorDeg", 999))) > 3: reasons.append("ALIGNMENT_OUT_OF_TOLERANCE")    if not payload.get("safetyZoneClear"): reasons.append("SAFETY_ZONE_OCCUPIED")    if float(payload.get("speedMps", 0)) > 0.25: reasons.append("ENTRY_SPEED_TOO_HIGH")    accepted = not reasons    return {"component": "kitech/greenhouse-rail-entry-safety", "accepted": accepted,            "status": "ENTRY_ALLOWED" if accepted else "ENTRY_BLOCKED", "target": "mcu",            "command": "ENTER_RAIL" if accepted else "STOP", "allowedSpeedMps": 0.2 if accepted else 0.0,            "blockingReasons": reasons, "energyMode": str(payload.get("energyMode", "NORMAL"))}