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

jbnu/global-localization Private

[참조 MVP] GIS 기반 전역 측위 A-SW — WGS84 좌표를 기준점 중심의 농경지 로컬 좌표계로 변환합니다.

https://git.agrithing.ai/jbnu/global-localization.git
6 commits
COMMIT DETAIL

feat: add executable reference MVP

A-SW Reference Factory <[email protected]> · 2026. 8. 2. 오전 7:37:59
9f68bc8617cec232975c402251aec52afab17a0f
5 changed files +42 −0 parent ac3fd1d
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 +10−0 View file
@@ -0,0 +1,10 @@
1 + from __future__ import annotations
2 + import math
3 +
4 + def execute(payload: dict) -> dict:
5 + origin, fix = payload["origin"], payload["fix"]
6 + radius = 6378137.0
7 + lat0 = math.radians(float(origin["lat"]))
8 + north = math.radians(float(fix["lat"]) - float(origin["lat"])) * radius
9 + east = math.radians(float(fix["lon"]) - float(origin["lon"])) * radius * math.cos(lat0)
10 + return {"frame": "field_local", "x_east_m": round(east, 3), "y_north_m": round(north, 3), "heading_deg": float(fix.get("heading_deg", 0)), "quality": "RTK_FIXED"}
added examples/input.json +11−0 View file
@@ -0,0 +1,11 @@
1 + {
2 + "origin": {
3 + "lat": 35.846,
4 + "lon": 127.129
5 + },
6 + "fix": {
7 + "lat": 35.8461,
8 + "lon": 127.1292,
9 + "heading_deg": 90
10 + }
11 + }
added pyproject.toml +8−0 View file
@@ -0,0 +1,8 @@
1 + [project]
2 + name = "global_localization"
3 + version = "0.1.0"
4 + description = "WGS84 좌표를 기준점 중심의 농경지 로컬 좌표계로 변환합니다."
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))