Skip to content

[T-033b] kinematic2d localisation (odometry + scan-matching correction) and rolling costmap #52

Closed

Description

@CodewithJha

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

Implements FR-SIM-001

Branch feat/t-033b-kinematic2d-localisation-odometry-scan-matching — one task = one branch = one PR (doc 32 §6)

Summary

Implement localization.py (dead reckoning + correction with gain k = k0·(1 − P4/0.1)·(1 − P8)) and costmap.py (rolling local grid marked from lidar + depth hits, 0.35 m inflation, clearing by ray tracing).

Context / motivation

Localisation error (F-LOC, GT-B) and phantom obstacles from lidar noise (F-STUCK/F-PLAN, GT-D) emerge from these components.

Scope

In scope

  • Localizer.update(odom_delta, scan, grid, rng) -> est_pose.
  • RollingCostmap.update(pose, lidar_hits, depth_hits), inflated() grid for the planner.

Implementation guidance

  • Scan matching can be a simplified correlative correction toward ground truth weighted by k — document the approximation; it must be deterministic given the localization RNG stream.
  • 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

  • With P4=0, P8=0 localisation error stays < 0.05 m on the nominal run.
  • High P4 produces phantom obstacles in the costmap (test with fixed seed).
  • 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_localization.py, test_costmap.py.

Dependencies

Blocked by: #49 (T-029), #44 (T-030b)

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/localization.py
  • backend/src/roboprobe/backends/kinematic2d/costmap.py

Parallel with T-033a/T-033c.

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-033b (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 §7.1 · doc 10 §7.2

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

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