Repository navigation
Description
Task
T-030a· Milestone M2 — Scenario + kinematic2d · Size S · Priority P0 · Epic #2Implements FR-SIM-001 · FR-ORC-001
Branch
feat/t-030a-geometry-footprint-polygons-occupancy-grid— one task = one branch = one PR (doc 32 §6)
Summary
Implement the pure-NumPy geometry kernel roboprobe.geometry used by kinematic2d and vendored into the ROS package (ground_truth_monitor): footprint at pose, grid distance transform, analytic rectangle distance, min_obstacle_distance(pose, grid, rects).
Context / motivation
Backend-independent oracles require that min_obstacle_dist is computed by exactly the same algorithm in both simulators (doc 10 §6).
Scope
In scope
geometry/footprint.py(circle + polygon footprints),geometry/grid.py(OccupancyGrid, world↔cell transforms, EDT viascipy.ndimage.distance_transform_edt),geometry/distance.py(point/segment/rect distances, footprint→obstacles).- Only NumPy/SciPy dependencies (vendorable).
Implementation guidance
- Vectorise over many poses (trace post-processing). Document units (m) and frames.
- Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff
PLR2004); public APIs typed (mypy strict) and documented.
Acceptance criteria
- Analytic tests: distance of a 0.17 m disc to a rectangle at known offsets within 1e-9 (analytic) / one cell (grid).
- No dependency on other roboprobe packages except
core. - Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
- Docs, config reference and CHANGELOG
Unreleasedupdated where behaviour, keys or interfaces changed. - Definition of Done (doc 32 §3) satisfied.
Tests required
tests/unit/geometry/test_*.py.
Dependencies
Blocked by: #15 (T-002a)
Blocks: #44 (T-030b), #50 (T-032), #53 (T-033c), #192 (T-093a)
Parallelization notes
Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:
backend/src/roboprobe/geometry/**
Parallel with T-030b and T-031*.
Definition of Done
Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-030a (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.
References
Design docs: doc 10 §6 · doc 10 §7.1 · doc 16 §1
Requirements: FR-SIM-001 · FR-ORC-001 (traceability: doc 28)
External:
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsReady
Activity
roboprobe_rosament_python package skeleton: package.xml, setup, params loading fromtopics.yaml, vendored geometry #192