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

jbnu/sensor-fusion-localization Private

[참조 MVP] 센서융합 측위 A-SW — GNSS와 주행 추정값을 품질 가중치로 융합해 연속적인 위치를 제공합니다.

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

feat: add executable reference MVP

A-SW Reference Factory <[email protected]> · 2026. 8. 2. 오전 7:38:00
dd56d7bedac1176e8de89b9a394f11e774b9a8a5
5 changed files +44 −0 parent 7d05c47
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 +11−0 View file
@@ -0,0 +1,11 @@
1 + from __future__ import annotations
2 +
3 + def execute(payload: dict) -> dict:
4 + gnss, odom = payload["gnss"], payload["odometry"]
5 + wg, wo = max(0.0, float(gnss.get("quality", 0))), max(0.0, float(odom.get("quality", 0)))
6 + total = wg + wo
7 + if total == 0:
8 + raise ValueError("at least one sensor must have quality")
9 + x = (float(gnss["x"]) * wg + float(odom["x"]) * wo) / total
10 + y = (float(gnss["y"]) * wg + float(odom["y"]) * wo) / total
11 + return {"pose": {"x": round(x, 4), "y": round(y, 4)}, "confidence": round(min(1.0, total / 2), 3), "sources": ["gnss", "odometry"]}
added examples/input.json +12−0 View file
@@ -0,0 +1,12 @@
1 + {
2 + "gnss": {
3 + "x": 10.2,
4 + "y": 4.9,
5 + "quality": 0.9
6 + },
7 + "odometry": {
8 + "x": 9.8,
9 + "y": 5.1,
10 + "quality": 0.7
11 + }
12 + }
added pyproject.toml +8−0 View file
@@ -0,0 +1,8 @@
1 + [project]
2 + name = "sensor_fusion_localization"
3 + version = "0.1.0"
4 + description = "GNSS와 주행 추정값을 품질 가중치로 융합해 연속적인 위치를 제공합니다."
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))