Skip to content

[T-033a] kinematic2d robot: unicycle kinematics with accel limits, slip, command delay; lidar & depth sensors #51

Closed

Description

@CodewithJha

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

Implements FR-SIM-001

Branch feat/t-033a-kinematic2d-robot-unicycle-kinematics-with — one task = one branch = one PR (doc 32 §6)

Summary

Implement backends/kinematic2d/robot.py (state integration with dt, accel/yaw-accel limits, friction slip, delay buffer, odometry that reports commanded wheel motion) and sensors.py (lidar via ray casting excluding the pallet; depth camera seeing pallet + walls with perception degradation).

Context / motivation

These mechanisms create the designed failure physics (stopping distance, late perception, slip/drift) of doc 10 §7.2.

Scope

In scope

  • RobotState, step(state, cmd, dt, model, friction) -> state (pure).
  • Lidar.scan(grid, pose, rng), DepthCamera.scan(grid, pallet_rect, pose, illuminance, rng).
  • Measured vs commanded velocity columns for the trace.

Implementation guidance

  • Pure functions over NumPy arrays; RNG streams sensor/perception injected. No knowledge of planners/controllers here.
  • 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

  • Kinematics unit tests (straight line, turn, accel limit).
  • Slip reduces realised velocity per doc 06 §3.5; odometry drifts.
  • Lidar never sees the pallet; depth range shrinks in the dark.
  • 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_robot.py, test_sensors.py.

Dependencies

Blocked by: #49 (T-029), #44 (T-030b), #45 (T-031a), #46 (T-031b)

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

Parallel with T-033b and T-033c (disjoint modules, shared interfaces in model.py).

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-033a (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 · doc 06 §3

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