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

jbnu/3d-environment-perception Private

[참조 MVP] 3D 주행환경 인지 A-SW — 3차원 점군을 격자 군집화해 장애물 위치와 경계 상자를 생성합니다.

https://git.agrithing.ai/jbnu/3d-environment-perception.git
8 commits
COMMIT DETAIL

feat: add executable reference MVP

A-SW Reference Factory <[email protected]> · 2026. 8. 2. 오전 7:38:01
d73e99373db998389b8aee973308c047e72ae051
5 changed files +59 −0 parent 402fbd3
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 +17−0 View file
@@ -0,0 +1,17 @@
1 + from __future__ import annotations
2 + from collections import defaultdict
3 +
4 + def execute(payload: dict) -> dict:
5 + cell = float(payload.get("cell_size_m", 1))
6 + minimum = int(payload.get("min_points", 2))
7 + if cell <= 0:
8 + raise ValueError("cell_size_m must be positive")
9 + buckets = defaultdict(list)
10 + for point in payload.get("points", []):
11 + buckets[(int(point[0] // cell), int(point[1] // cell))].append(point)
12 + obstacles = []
13 + for key, points in buckets.items():
14 + if len(points) < minimum:
15 + continue
16 + obstacles.append({"cell": list(key), "centroid": [round(sum(p[i] for p in points)/len(points), 3) for i in range(3)], "point_count": len(points), "class": "unknown_obstacle"})
17 + return {"frame": "lidar", "obstacles": obstacles, "obstacle_count": len(obstacles)}
added examples/input.json +21−0 View file
@@ -0,0 +1,21 @@
1 + {
2 + "cell_size_m": 1,
3 + "min_points": 2,
4 + "points": [
5 + [
6 + 1.1,
7 + 2.1,
8 + 0.3
9 + ],
10 + [
11 + 1.2,
12 + 2.2,
13 + 0.5
14 + ],
15 + [
16 + 8,
17 + 9,
18 + 0.2
19 + ]
20 + ]
21 + }
added pyproject.toml +8−0 View file
@@ -0,0 +1,8 @@
1 + [project]
2 + name = "3d_environment_perception"
3 + version = "0.1.0"
4 + description = "3차원 점군을 격자 군집화해 장애물 위치와 경계 상자를 생성합니다."
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))