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

tymict/icu-platform Private

[참조 MVP] ICU 실행 플랫폼 — 센서 프레임과 A-SW 목표값을 ICU 액추에이터 명령 봉투로 변환합니다.

https://git.agrithing.ai/tymict/icu-platform.git
6 commits
COMMIT DETAIL

feat: add executable reference MVP

A-SW Reference Factory <[email protected]> · 2026. 8. 2. 오전 7:37:57
32eeb5f38b778065d884d15a444a47110652dcac
5 changed files +46 −0 parent 61498c4
added asw_component/__init__.py +3−0 View file
@@ -0,0 +1,3 @@
1 + from .component import execute
2 +
3 + __all__ = ["execute"]
added asw_component/component.py +13−0 View file
@@ -0,0 +1,13 @@
1 + from __future__ import annotations
2 +
3 + def _clamp(value, limit):
4 + return max(-limit, min(limit, value))
5 +
6 + def execute(payload: dict) -> dict:
7 + desired, limits = payload["desired"], payload["limits"]
8 + safe = payload.get("safety_state") == "RUN"
9 + command = {
10 + "steering_rad": _clamp(float(desired.get("steering_rad", 0)), float(limits["steering_rad"])) if safe else 0.0,
11 + "speed_mps": max(0.0, min(float(desired.get("speed_mps", 0)), float(limits["speed_mps"]))) if safe else 0.0,
12 + }
13 + return {"sequence": int(payload["sequence"]), "accepted": safe, "actuator_command": command, "transport": "CAN-FD"}
added examples/input.json +12−0 View file
@@ -0,0 +1,12 @@
1 + {
2 + "sequence": 42,
3 + "desired": {
4 + "steering_rad": 0.2,
5 + "speed_mps": 1.5
6 + },
7 + "limits": {
8 + "steering_rad": 0.55,
9 + "speed_mps": 4
10 + },
11 + "safety_state": "RUN"
12 + }
added pyproject.toml +8−0 View file
@@ -0,0 +1,8 @@
1 + [project]
2 + name = "icu_platform"
3 + version = "0.1.0"
4 + description = "센서 프레임과 A-SW 목표값을 ICU 액추에이터 명령 봉투로 변환합니다."
5 + requires-python = ">=3.11"
6 +
7 + [tool.unittest]
8 + test-path = "tests"
added run.py +10−0 View file
@@ -0,0 +1,10 @@
1 + from __future__ import annotations
2 + import json
3 + import sys
4 + from asw_component import execute
5 +
6 + if __name__ == "__main__":
7 + path = sys.argv[1] if len(sys.argv) > 1 else None
8 + with open(path, encoding="utf-8") if path else sys.stdin as source:
9 + payload = json.load(source)
10 + print(json.dumps(execute(payload), ensure_ascii=False, indent=2))