Skip to content

[T-032] kinematic2d world: warehouse occupancy clone, loader, nominal path #50

Closed

Description

@CodewithJha

Task T-032 · Milestone M2 — Scenario + kinematic2d · Size M · Priority P0 · Epic #2

Implements FR-SIM-001

Branch feat/t-032-kinematic2d-world-warehouse-occupancy-clone — one task = one branch = one PR (doc 32 §6)

Summary

Create worlds/warehouse_k2d.json (0.05 m occupancy grid approximating the Nav2 warehouse world), its loader, and the nominal path polyline for warehouse_delivery_v1.

Context / motivation

kinematic2d needs a world before the Gazebo map exists (T-092). Start with a faithful hand-built clone of the warehouse layout and re-align it once the Gazebo map is generated.

Scope

In scope

  • backends/kinematic2d/world.py: load JSON (resolution, origin, RLE-encoded grid), build OccupancyGrid + EDT.
  • worlds/warehouse_k2d.json + scripts/build_k2d_world.py (generates the JSON from a simple vector description: walls/shelves rectangles) so it is reviewable and regenerable.
  • Nominal path: A* on the empty inflated grid from start to (provisional) goal, smoothed, written to tasks/paths/warehouse_delivery_v1.csv by a script; loader returns Polyline.

Implementation guidance

  • Keep start pose x=2.12, y=−21.3, yaw=1.57 (doc 06 §1) so coordinates carry over to Gazebo. Document the provenance of the layout (upstream warehouse.sdf dimensions).
  • 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

  • Path length ≈ 12–15 m through one aisle; matches committed fixture.
  • World loads in < 50 ms.
  • Script regeneration is deterministic (byte-identical JSON).
  • Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
  • Docs, config reference and CHANGELOG Unreleased updated where behaviour, keys or interfaces changed.
  • Definition of Done (doc 32 §3) satisfied.

Tests required

  • tests/unit/backends/kinematic2d/test_world.py.

Dependencies

Blocked by: #43 (T-030a), #40 (T-027)

Blocks: #54 (T-033d)

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/backends/kinematic2d/world.py
  • worlds/warehouse_k2d.json
  • scripts/build_k2d_world.py
  • tasks/paths/warehouse_delivery_v1.csv

Parallel with T-033a/b/c (they use synthetic grids in unit tests).

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-032 (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 06 §1 · doc 10 §7.1

Requirements: FR-SIM-001 (traceability: doc 28)

External:

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:simulatorSimulator backends (kinematic2d, Gazebo adapter)milestone:M2M2 — Scenario + kinematic2dpriority:P0Critical path / blocks otherssize:M1-3 daystaskChild task of a milestone epictype:featureNew functionality

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions