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

hada/greenhouse-transport-platform Private

[참조 MVP] 온실 이송 플랫폼 고도화 — 이송 플랫폼의 주행·적재·현장 실증 상태를 제공하는 위탁연구 참조 MVP입니다.

https://git.agrithing.ai/hada/greenhouse-transport-platform.git
4 commits
2 items · feat/concrete-mvp-v2
·/ asw_component/component.py
python · 1.0 KB · f858d32 Download
from __future__ import annotationsdef execute(payload: dict) -> dict:    maximum = float(payload.get("maximumPayloadKg", 120))    payload_kg = float(payload.get("payloadKg", 0))    reasons = []    if not payload.get("driveReady"): reasons.append("DRIVE_NOT_READY")    if payload.get("fieldMode") != "GREENHOUSE": reasons.append("INVALID_FIELD_MODE")    if payload.get("emergencyStop"): reasons.append("EMERGENCY_STOP")    if maximum <= 0 or payload_kg > maximum: reasons.append("PAYLOAD_LIMIT")    ratio = payload_kg / maximum if maximum > 0 else 1.0    accepted = not reasons    speed = 0.0 if not accepted else max(0.25, round(0.8 * (1 - 0.45 * min(ratio, 1)), 3))    return {"component": "hada/greenhouse-transport-platform", "accepted": accepted,            "status": "PLATFORM_READY" if accepted else "BLOCKED", "target": "mcu",            "platformId": str(payload.get("platformId", "unknown")), "command": "ENABLE_DRIVE" if accepted else "STOP",            "speedLimitMps": speed, "loadRatio": round(ratio, 3), "blockingReasons": reasons}