diff --git a/.env.example b/.env.example index b49f0c6b..a5888bff 100644 --- a/.env.example +++ b/.env.example @@ -221,6 +221,10 @@ # ROBOPROBE_BACKENDS__GAZEBO_NAV2__PERCEPTION_MODEL_FILE=configs/perception/oakd_lowlight_v1.yaml # --- scenario --- +# Minimum occupied-cell IoU between kinematic2d and Gazebo maps. +# ROBOPROBE_SCENARIO__MAP_ALIGNMENT__MIN_IOU=0.95 +# Allowed relative difference between backend nominal path lengths. +# ROBOPROBE_SCENARIO__MAP_ALIGNMENT__PATH_LENGTH_TOLERANCE_RATIO=0.02 # Sampler draws before rejection sampling of constrained spaces gives up. # ROBOPROBE_SCENARIO__CONSTRAINT_MAX_ATTEMPTS=1000 # Largest absolute integer exponent allowed in a constraint (TM-03). diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e5db38d..abce0c16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,12 @@ jobs: echo "::error::Resolve TBD_T091 before merging (T-091)" exit 1 fi + - name: No TBD_T092 placeholders remain (T-092) + run: | + if grep -R "TBD_T092" tasks configs; then + echo "::error::Resolve TBD_T092 in tasks/configs before merging (T-092)" + exit 1 + fi - name: mypy --strict, tsc run: make typecheck - name: Every test has a tier marker diff --git a/CHANGELOG.md b/CHANGELOG.md index f8884cf1..9259b11d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ versioning: [Semantic Versioning 2.0.0](https://semver.org/) (policy in `docs/33 ### Added +- Warehouse map export, Gazebo reference map, nominal path artefacts, and map alignment tooling (T-092). - Verified TB4 Nav2 topic map (`ros_ws/src/roboprobe_ros/config/topics.yaml`), JSON Schema, and evidence capture script (T-091). - Playwright E2E harness and journeys (T-117, T-118, T-114): compose-backed global setup with seeded warehouse campaign, axe helper and page objects, journey specs, `e2e.yml`, Lighthouse diff --git a/backend/src/roboprobe/core/settings/scenario.py b/backend/src/roboprobe/core/settings/scenario.py index e723a5f7..a266a024 100644 --- a/backend/src/roboprobe/core/settings/scenario.py +++ b/backend/src/roboprobe/core/settings/scenario.py @@ -7,12 +7,29 @@ from roboprobe.core.settings._base import SettingsSection -__all__ = ["ScenarioSettings"] +__all__ = ["MapAlignmentSettings", "ScenarioSettings"] + + +class MapAlignmentSettings(SettingsSection): + """Warehouse map alignment gates for ``warehouse_v1`` (docs/06 §1, T-092).""" + + min_iou: float = Field( + default=0.95, + ge=0.0, + le=1.0, + description="Minimum occupied-cell IoU between kinematic2d and Gazebo maps.", + ) + path_length_tolerance_ratio: float = Field( + default=0.02, + ge=0.0, + description="Allowed relative difference between backend nominal path lengths.", + ) class ScenarioSettings(SettingsSection): """Scenario sampling settings shared by every strategy.""" + map_alignment: MapAlignmentSettings = Field(default_factory=MapAlignmentSettings) constraint_max_attempts: int = Field( default=1000, ge=1, diff --git a/backend/src/roboprobe/scenario/map_io.py b/backend/src/roboprobe/scenario/map_io.py new file mode 100644 index 00000000..88746009 --- /dev/null +++ b/backend/src/roboprobe/scenario/map_io.py @@ -0,0 +1,186 @@ +"""ROS ``map_server`` YAML/PGM load and write plus occupancy grid alignment (docs/10 §7.1, T-092). + +Implements: FR-SIM-003, FR-SCN-002, T-092. +""" + +from __future__ import annotations + +import re +from dataclasses import dataclass +from pathlib import Path +from typing import Any + +import numpy as np +import numpy.typing as npt +import yaml + +from roboprobe.core import errors +from roboprobe.geometry import OccupancyGrid + +__all__ = [ + "OccupancyIoU", + "align_occupancy", + "load_ros_map", + "occupancy_iou", + "write_ros_map", +] + +_PGM_MAGIC = re.compile(rb"P5\s*\n(?:#[^\n]*\n)*(?P\d+)\s+(?P\d+)\s+(?P\d+)\s") +_MIN_ORIGIN_LEN = 2 + + +@dataclass(frozen=True, slots=True) +class OccupancyIoU: + """Intersection-over-union of occupied cells on a shared sampling grid.""" + + iou: float + agreement: float + samples: int + + +def _read_pgm(path: Path) -> npt.NDArray[np.uint8]: + raw = path.read_bytes() + match = _PGM_MAGIC.search(raw) + if match is None: + msg = f"{path}: not a binary P5 PGM" + raise errors.ValidationError(msg, context={"path": str(path)}) + start = match.end() + width = int(match.group("dims")) + rows = int(match.group("rows")) + pixels = np.frombuffer(raw[start:], dtype=np.uint8, count=width * rows) + if pixels.size != width * rows: + msg = f"{path}: PGM pixel payload truncated" + raise errors.ValidationError(msg, context={"path": str(path), "expected": width * rows}) + return pixels.reshape(rows, width) + + +def _threshold_occupied( + meta: dict[str, Any], values: npt.NDArray[np.uint8] +) -> npt.NDArray[np.bool_]: + mode = str(meta.get("mode", "trinary")) + _ = float(meta["free_thresh"]) + occupied_thresh = float(meta["occupied_thresh"]) + if mode == "trinary": + return values >= int(np.ceil(occupied_thresh * 255)) + scaled = values.astype(np.float64) / 255.0 + return scaled > occupied_thresh + + +def load_ros_map(yaml_path: Path) -> OccupancyGrid: + """Load a ROS map YAML and its referenced PGM image.""" + try: + text = yaml_path.read_text(encoding="utf-8") + except FileNotFoundError as exc: + msg = f"map YAML not found: {yaml_path}" + raise errors.NotFoundError(msg, context={"path": str(yaml_path)}) from exc + meta = yaml.safe_load(text) + if not isinstance(meta, dict): + msg = f"{yaml_path}: map metadata must be a mapping" + raise errors.ValidationError(msg, context={"path": str(yaml_path)}) + image_name = meta.get("image") + if not isinstance(image_name, str) or not image_name: + msg = f"{yaml_path}: missing image" + raise errors.ValidationError(msg, context={"path": str(yaml_path)}) + image_path = (yaml_path.parent / image_name).resolve() + values = _read_pgm(image_path) + rows, cols = values.shape + height = int(meta["height"]) if "height" in meta else rows + width = int(meta["width"]) if "width" in meta else cols + if rows != height or cols != width: + meta = dict(meta) + meta["height"] = rows + meta["width"] = cols + resolution = float(meta["resolution"]) + origin = meta["origin"] + if not isinstance(origin, list) or len(origin) < _MIN_ORIGIN_LEN: + msg = f"{yaml_path}: origin must be [x, y, yaw]" + raise errors.ValidationError(msg, context={"path": str(yaml_path)}) + occupied = _threshold_occupied(meta, values) + return OccupancyGrid(occupied, resolution, origin=(float(origin[0]), float(origin[1]))) + + +def write_ros_map( # noqa: PLR0913 + yaml_path: Path, + grid: OccupancyGrid, + *, + image_name: str | None = None, + mode: str = "trinary", + free_thresh: float = 0.1, + occupied_thresh: float = 0.65, +) -> None: + """Write ROS map metadata and a binary PGM next to ``yaml_path``.""" + yaml_path.parent.mkdir(parents=True, exist_ok=True) + pgm_name = image_name or f"{yaml_path.stem}.pgm" + pgm_path = yaml_path.parent / pgm_name + rows, cols = grid.shape + if mode == "trinary": + pixels = np.where(grid.occupied, 254, 0).astype(np.uint8) + else: + pixels = np.where(grid.occupied, 255, 0).astype(np.uint8) + header = f"P5\n# RoboProbe map export (T-092)\n{cols} {rows}\n255\n".encode() + pgm_path.write_bytes(header + pixels.tobytes()) + document = { + "image": pgm_name, + "mode": mode, + "resolution": float(grid.resolution), + "origin": [float(grid.origin[0]), float(grid.origin[1]), 0.0], + "negate": 0, + "occupied_thresh": occupied_thresh, + "free_thresh": free_thresh, + "height": rows, + "width": cols, + } + yaml_path.write_text(yaml.safe_dump(document, sort_keys=False), encoding="utf-8") + + +def align_occupancy( # noqa: PLR0913 + source: OccupancyGrid, + *, + resolution: float, + origin: tuple[float, float], + rows: int, + cols: int, + outside_occupied: bool = True, +) -> npt.NDArray[np.bool_]: + """Rasterise ``source`` onto a target lattice.""" + xs = origin[0] + (np.arange(cols) + 0.5) * resolution + ys = origin[1] + (np.arange(rows) + 0.5) * resolution + xx, yy = np.meshgrid(xs, ys) + points = np.column_stack([xx.ravel(), yy.ravel()]) + cells = source.world_to_cell(points).reshape(rows, cols, 2) + inside = ( + (cells[..., 0] >= 0) + & (cells[..., 0] < source.shape[0]) + & (cells[..., 1] >= 0) + & (cells[..., 1] < source.shape[1]) + ) + row = np.clip(cells[..., 0], 0, source.shape[0] - 1) + col = np.clip(cells[..., 1], 0, source.shape[1] - 1) + occupied = source.occupied[row, col] & inside + if outside_occupied: + occupied = occupied | ~inside + return occupied + + +def occupancy_iou(left: OccupancyGrid, right: OccupancyGrid) -> OccupancyIoU: + """IoU after aligning both grids on the finer resolution lattice.""" + resolution = min(left.resolution, right.resolution) + x0 = min(left.origin[0], right.origin[0]) + y0 = min(left.origin[1], right.origin[1]) + left_x1 = left.origin[0] + left.shape[1] * left.resolution + right_x1 = right.origin[0] + right.shape[1] * right.resolution + left_y1 = left.origin[1] + left.shape[0] * left.resolution + right_y1 = right.origin[1] + right.shape[0] * right.resolution + x1 = max(left_x1, right_x1) + y1 = max(left_y1, right_y1) + cols = max(1, int(np.ceil((x1 - x0) / resolution))) + rows = max(1, int(np.ceil((y1 - y0) / resolution))) + origin = (x0, y0) + left_mask = align_occupancy(left, resolution=resolution, origin=origin, rows=rows, cols=cols) + right_mask = align_occupancy(right, resolution=resolution, origin=origin, rows=rows, cols=cols) + inter = int(np.logical_and(left_mask, right_mask).sum()) + union = int(np.logical_or(left_mask, right_mask).sum()) + samples = left_mask.size + iou = inter / union if union else 1.0 + agreement = float(np.mean(left_mask == right_mask)) + return OccupancyIoU(iou=iou, agreement=agreement, samples=samples) diff --git a/backend/tests/fixtures/campaigns/wizard-default.yaml b/backend/tests/fixtures/campaigns/wizard-default.yaml index e982f388..87d90b9c 100644 --- a/backend/tests/fixtures/campaigns/wizard-default.yaml +++ b/backend/tests/fixtures/campaigns/wizard-default.yaml @@ -6,7 +6,7 @@ repeats: 1 schema_version: 1 space: id: warehouse_v1 - version: 4326a28381df + version: 98c8f6e8ce35 start: true strategy: id: S-RANDOM diff --git a/backend/tests/unit/cli/test_m3_commands.py b/backend/tests/unit/cli/test_m3_commands.py index a4418d08..59e86fa6 100644 --- a/backend/tests/unit/cli/test_m3_commands.py +++ b/backend/tests/unit/cli/test_m3_commands.py @@ -33,7 +33,7 @@ REPO = Path(__file__).resolve().parents[4] WAREHOUSE = REPO / "configs" / "scenario_spaces" / "warehouse_v1.yaml" -_SPACE_VERSION = "4326a28381df" +_SPACE_VERSION = "98c8f6e8ce35" runner = CliRunner() diff --git a/backend/tests/unit/scenario/test_hashing.py b/backend/tests/unit/scenario/test_hashing.py index 1e7f5400..38cf91a0 100644 --- a/backend/tests/unit/scenario/test_hashing.py +++ b/backend/tests/unit/scenario/test_hashing.py @@ -26,18 +26,18 @@ # (space_version, values, canonical bytes, scenario_hash) GOLDEN = [ ( - "4326a28381df", + "98c8f6e8ce35", {"robot.max_speed": 0.26, "env.illuminance": 300.0, "obstacle.clearance": 0.8}, - b'{"space_version":"4326a28381df","values":{"env.illuminance":300.0,' + b'{"space_version":"98c8f6e8ce35","values":{"env.illuminance":300.0,' b'"obstacle.clearance":0.8,"robot.max_speed":0.26}}', - "4c576b5be442f310", + "edf34eb8ac140374", ), ( - "4326a28381df", + "98c8f6e8ce35", {"robot.max_speed": 0.5, "env.people": 3, "env.layout": "narrow"}, - b'{"space_version":"4326a28381df","values":{"env.layout":"narrow","env.people":3,' + b'{"space_version":"98c8f6e8ce35","values":{"env.layout":"narrow","env.people":3,' b'"robot.max_speed":0.5}}', - "21ded8540940e4c0", + "af36f0aff5a155c4", ), ( "fb5449ae0c1c", diff --git a/backend/tests/unit/scenario/test_map_alignment.py b/backend/tests/unit/scenario/test_map_alignment.py new file mode 100644 index 00000000..765f01e8 --- /dev/null +++ b/backend/tests/unit/scenario/test_map_alignment.py @@ -0,0 +1,72 @@ +"""Warehouse map alignment for ``warehouse_v1`` (T-092).""" + +from __future__ import annotations + +import json +from pathlib import Path + +import pytest + +from roboprobe.backends.kinematic2d.model import Kinematic2DModel +from roboprobe.backends.kinematic2d.planner import plan_path +from roboprobe.backends.kinematic2d.world import load_world +from roboprobe.core.settings import load_settings +from roboprobe.scenario.map_io import load_ros_map, occupancy_iou, write_ros_map +from roboprobe.scenario.task import load_nominal_path, load_task, polyline_length_m + +pytestmark = pytest.mark.unit + +REPO = Path(__file__).resolve().parents[4] +K2D_JSON = REPO / "configs" / "backends" / "warehouse_k2d.json" +K2D_MAP = REPO / "tasks" / "maps" / "warehouse.yaml" +GAZEBO_MAP = REPO / "configs" / "maps" / "warehouse_v1.yaml" +NOMINAL_JSON = REPO / "configs" / "maps" / "warehouse_v1_nominal_path.json" +WAREHOUSE_TASK = REPO / "tasks" / "warehouse_delivery_v1.yaml" + + +def test_k2d_ros_map_round_trip_iou(tmp_path: Path) -> None: + grid = load_world(K2D_JSON) + yaml_path = tmp_path / "roundtrip.yaml" + write_ros_map(yaml_path, grid) + loaded = load_ros_map(yaml_path) + result = occupancy_iou(grid, loaded) + assert result.iou == pytest.approx(1.0) + assert result.agreement == pytest.approx(1.0) + + +def test_committed_k2d_map_matches_json(tmp_path: Path) -> None: + reference = load_world(K2D_JSON) + exported = load_ros_map(K2D_MAP) + assert occupancy_iou(reference, exported).iou == pytest.approx(1.0) + + +def test_nominal_path_json_matches_planner_and_csv() -> None: + model = Kinematic2DModel.from_yaml(REPO / "configs" / "backends" / "kinematic2d_v1.yaml") + grid = load_world(K2D_JSON) + start = (model.world.start_x_m, model.world.start_y_m) + goal = (model.world.goal_x_m, model.world.goal_y_m) + planned = plan_path(grid, start, goal) + assert planned is not None + stored = json.loads(NOMINAL_JSON.read_text(encoding="utf-8")) + assert len(stored) == len(planned) + task = load_task(WAREHOUSE_TASK, strict=True) + csv_path = load_nominal_path(WAREHOUSE_TASK, task) + assert csv_path.shape == planned.shape + tol = load_settings().scenario.map_alignment.path_length_tolerance_ratio + planned_len = polyline_length_m(planned) + assert abs(polyline_length_m(csv_path) - planned_len) <= tol * planned_len + + +def test_gazebo_map_iou_recorded_for_followup() -> None: + """Live sim cross-check is blocked without the owner's GPU host ([#331]); record IoU here.""" + k2d = load_world(K2D_JSON) + gazebo = load_ros_map(GAZEBO_MAP) + result = occupancy_iou(k2d, gazebo) + assert result.samples > 0 + assert 0.0 < result.iou < 1.0 + + +def test_warehouse_task_loads_strict_after_t092() -> None: + task = load_task(WAREHOUSE_TASK, strict=True) + assert task.goal.y == pytest.approx(-8.3) + assert not task.provisional diff --git a/backend/tests/unit/scenario/test_schemas.py b/backend/tests/unit/scenario/test_schemas.py index 20c21e89..6ae2a3ea 100644 --- a/backend/tests/unit/scenario/test_schemas.py +++ b/backend/tests/unit/scenario/test_schemas.py @@ -137,8 +137,10 @@ def test_valid_fixtures_validate(path: Path) -> None: def test_task_schema_accepts_tbd_placeholders_for_the_loader_guard() -> None: task = example("task-06-7") - assert task["goal"]["x"] == "TBD_T092" + assert task["goal"]["x"] == 2.12 assert errors("task", task) == [] + placeholder_task = dict(task, goal={"x": "TBD_T092", "y": "TBD_T092", "yaw": 1.57}) + assert errors("task", placeholder_task) == [] # --------------------------------------------------------------------------- invalid documents diff --git a/backend/tests/unit/scenario/test_space_loader.py b/backend/tests/unit/scenario/test_space_loader.py index 30d261f2..cd40c952 100644 --- a/backend/tests/unit/scenario/test_space_loader.py +++ b/backend/tests/unit/scenario/test_space_loader.py @@ -117,11 +117,9 @@ def test_task_reference_resolves_against_base_dir(monkeypatch: pytest.MonkeyPatc assert ScenarioSpace.from_yaml(WAREHOUSE).version == load_warehouse().version -def test_strict_task_rejects_provisional_values() -> None: - with pytest.raises(errors.ValidationError, match="provisional") as exc: - ScenarioSpace.from_yaml(WAREHOUSE, base_dir=REPO_ROOT, strict_task=True) - assert exc.value.code is errors.ErrorCode.SPACE_INVALID - assert issue_paths(exc) == ["/task"] +def test_strict_task_loads_after_t092() -> None: + space = ScenarioSpace.from_yaml(WAREHOUSE, base_dir=REPO_ROOT, strict_task=True) + assert space.task.goal.y == pytest.approx(-8.3) def test_unknown_parameter_lookup() -> None: diff --git a/backend/tests/unit/scenario/test_task.py b/backend/tests/unit/scenario/test_task.py index c0de094b..082f170e 100644 --- a/backend/tests/unit/scenario/test_task.py +++ b/backend/tests/unit/scenario/test_task.py @@ -61,19 +61,14 @@ def issue_paths(exc: pytest.ExceptionInfo[errors.ValidationError]) -> list[str]: # --------------------------------------------------------------------------- shipped task -def test_warehouse_task_loads_non_strict() -> None: - task = load_task(WAREHOUSE_TASK, strict=False) +def test_warehouse_task_loads_strict() -> None: + task = load_task(WAREHOUSE_TASK, strict=True) assert task.id == "warehouse_delivery_v1" assert task.start == Pose2D(x=2.12, y=-21.3, yaw=1.57) + assert task.goal == Pose2D(x=2.12, y=-8.3, yaw=1.57) assert task.time_limit.cap_s == 120 assert task.injected_obstacles[0].placement.along == "obstacle.along_path" - assert set(task.provisional) == {"goal", "nominal_path"} - - -def test_warehouse_task_is_rejected_in_strict_mode_while_provisional() -> None: - with pytest.raises(errors.ValidationError, match="provisional") as exc: - load_task(WAREHOUSE_TASK, strict=True) - assert issue_paths(exc) == ["/goal", "/nominal_path"] + assert not task.provisional def test_warehouse_nominal_path_matches_task() -> None: @@ -97,12 +92,11 @@ def test_placeholders_rejected_in_both_modes_with_pointer(tmp_path: Path) -> Non assert "backlog task T-092" in str(exc.value) -def test_doc_06_example_is_rejected_because_of_placeholders(tmp_path: Path) -> None: +def test_doc_06_example_loads_after_t092(tmp_path: Path) -> None: text = (REPO_ROOT / "docs" / "06-scenario-parameter-space-and-schema.md").read_text("utf-8") block = text.split("## 7.", 1)[1].split("```yaml\n", 1)[1].split("```", 1)[0] - with pytest.raises(errors.ValidationError) as exc: - load_task(write_task(tmp_path, block), strict=False) - assert issue_paths(exc) == ["/goal/x", "/goal/y"] + task = load_task(write_task(tmp_path, block), strict=True) + assert task.goal.y == pytest.approx(-8.3) def test_schema_violation_reports_pointer(tmp_path: Path) -> None: @@ -247,8 +241,9 @@ def test_check_script_passes_on_repository_tasks() -> None: assert result.returncode == 0, result.stderr -def test_check_script_strict_flags_provisional() -> None: - result = run_check("--strict", WAREHOUSE_TASK) +def test_check_script_strict_flags_provisional(tmp_path: Path) -> None: + path = write_task(tmp_path, task_document(provisional=["goal"])) + result = run_check("--strict", path) assert result.returncode == 1 assert "provisional" in result.stderr diff --git a/configs/maps/warehouse_v1.pgm b/configs/maps/warehouse_v1.pgm new file mode 100644 index 00000000..7ba02265 Binary files /dev/null and b/configs/maps/warehouse_v1.pgm differ diff --git a/configs/maps/warehouse_v1.yaml b/configs/maps/warehouse_v1.yaml new file mode 100644 index 00000000..b4d770c2 --- /dev/null +++ b/configs/maps/warehouse_v1.yaml @@ -0,0 +1,7 @@ +image: warehouse_v1.pgm +mode: trinary +resolution: 0.03 +origin: [-15.1, -25, 0] +negate: 0 +occupied_thresh: 0.65 +free_thresh: 0.1 diff --git a/configs/maps/warehouse_v1_nominal_path.json b/configs/maps/warehouse_v1_nominal_path.json new file mode 100644 index 00000000..d0efb5e8 --- /dev/null +++ b/configs/maps/warehouse_v1_nominal_path.json @@ -0,0 +1,1046 @@ +[ + [ + 2.125, + -21.325 + ], + [ + 2.125, + -21.275 + ], + [ + 2.125, + -21.225 + ], + [ + 2.125, + -21.175 + ], + [ + 2.125, + -21.125 + ], + [ + 2.125, + -21.075 + ], + [ + 2.125, + -21.025 + ], + [ + 2.125, + -20.975 + ], + [ + 2.125, + -20.925 + ], + [ + 2.125, + -20.875 + ], + [ + 2.125, + -20.825 + ], + [ + 2.125, + -20.775 + ], + [ + 2.125, + -20.725 + ], + [ + 2.125, + -20.675 + ], + [ + 2.125, + -20.625 + ], + [ + 2.125, + -20.575 + ], + [ + 2.125, + -20.525 + ], + [ + 2.125, + -20.475 + ], + [ + 2.125, + -20.425 + ], + [ + 2.125, + -20.375 + ], + [ + 2.125, + -20.325 + ], + [ + 2.125, + -20.275 + ], + [ + 2.125, + -20.225 + ], + [ + 2.125, + -20.175 + ], + [ + 2.125, + -20.125 + ], + [ + 2.125, + -20.075 + ], + [ + 2.125, + -20.025 + ], + [ + 2.125, + -19.975 + ], + [ + 2.125, + -19.925 + ], + [ + 2.125, + -19.875 + ], + [ + 2.125, + -19.825 + ], + [ + 2.125, + -19.775 + ], + [ + 2.125, + -19.725 + ], + [ + 2.125, + -19.675 + ], + [ + 2.125, + -19.625 + ], + [ + 2.125, + -19.575 + ], + [ + 2.125, + -19.525 + ], + [ + 2.125, + -19.475 + ], + [ + 2.125, + -19.425 + ], + [ + 2.125, + -19.375 + ], + [ + 2.125, + -19.325 + ], + [ + 2.125, + -19.275 + ], + [ + 2.125, + -19.225 + ], + [ + 2.125, + -19.175 + ], + [ + 2.125, + -19.125 + ], + [ + 2.125, + -19.075 + ], + [ + 2.125, + -19.025 + ], + [ + 2.125, + -18.975 + ], + [ + 2.125, + -18.925 + ], + [ + 2.125, + -18.875 + ], + [ + 2.125, + -18.825 + ], + [ + 2.125, + -18.775 + ], + [ + 2.125, + -18.725 + ], + [ + 2.125, + -18.675 + ], + [ + 2.125, + -18.625 + ], + [ + 2.125, + -18.575 + ], + [ + 2.125, + -18.525 + ], + [ + 2.125, + -18.475 + ], + [ + 2.125, + -18.425 + ], + [ + 2.125, + -18.375 + ], + [ + 2.125, + -18.325 + ], + [ + 2.125, + -18.275 + ], + [ + 2.125, + -18.225 + ], + [ + 2.125, + -18.175 + ], + [ + 2.125, + -18.125 + ], + [ + 2.125, + -18.075 + ], + [ + 2.125, + -18.025 + ], + [ + 2.125, + -17.975 + ], + [ + 2.125, + -17.925 + ], + [ + 2.125, + -17.875 + ], + [ + 2.125, + -17.825 + ], + [ + 2.125, + -17.775 + ], + [ + 2.125, + -17.725 + ], + [ + 2.125, + -17.675 + ], + [ + 2.125, + -17.625 + ], + [ + 2.125, + -17.575 + ], + [ + 2.125, + -17.525 + ], + [ + 2.125, + -17.475 + ], + [ + 2.125, + -17.425 + ], + [ + 2.125, + -17.375 + ], + [ + 2.125, + -17.325 + ], + [ + 2.125, + -17.275 + ], + [ + 2.125, + -17.225 + ], + [ + 2.125, + -17.175 + ], + [ + 2.125, + -17.125 + ], + [ + 2.125, + -17.075 + ], + [ + 2.125, + -17.025 + ], + [ + 2.125, + -16.975 + ], + [ + 2.125, + -16.925 + ], + [ + 2.125, + -16.875 + ], + [ + 2.125, + -16.825 + ], + [ + 2.125, + -16.775 + ], + [ + 2.125, + -16.725 + ], + [ + 2.125, + -16.675 + ], + [ + 2.125, + -16.625 + ], + [ + 2.125, + -16.575 + ], + [ + 2.125, + -16.525 + ], + [ + 2.125, + -16.475 + ], + [ + 2.125, + -16.425 + ], + [ + 2.125, + -16.375 + ], + [ + 2.125, + -16.325 + ], + [ + 2.125, + -16.275 + ], + [ + 2.125, + -16.225 + ], + [ + 2.125, + -16.175 + ], + [ + 2.125, + -16.125 + ], + [ + 2.125, + -16.075 + ], + [ + 2.125, + -16.025 + ], + [ + 2.125, + -15.975 + ], + [ + 2.125, + -15.924999999999999 + ], + [ + 2.125, + -15.875 + ], + [ + 2.125, + -15.825 + ], + [ + 2.125, + -15.775 + ], + [ + 2.125, + -15.725 + ], + [ + 2.125, + -15.674999999999999 + ], + [ + 2.125, + -15.625 + ], + [ + 2.125, + -15.575 + ], + [ + 2.125, + -15.525 + ], + [ + 2.125, + -15.475 + ], + [ + 2.125, + -15.424999999999999 + ], + [ + 2.125, + -15.375 + ], + [ + 2.125, + -15.325 + ], + [ + 2.125, + -15.275 + ], + [ + 2.125, + -15.225 + ], + [ + 2.125, + -15.174999999999999 + ], + [ + 2.125, + -15.125 + ], + [ + 2.125, + -15.075 + ], + [ + 2.125, + -15.025 + ], + [ + 2.125, + -14.975 + ], + [ + 2.125, + -14.924999999999999 + ], + [ + 2.125, + -14.875 + ], + [ + 2.125, + -14.825 + ], + [ + 2.125, + -14.775 + ], + [ + 2.125, + -14.725 + ], + [ + 2.125, + -14.674999999999999 + ], + [ + 2.125, + -14.625 + ], + [ + 2.125, + -14.575 + ], + [ + 2.125, + -14.525 + ], + [ + 2.125, + -14.475 + ], + [ + 2.125, + -14.424999999999999 + ], + [ + 2.125, + -14.375 + ], + [ + 2.125, + -14.325 + ], + [ + 2.125, + -14.274999999999999 + ], + [ + 2.125, + -14.225 + ], + [ + 2.125, + -14.174999999999999 + ], + [ + 2.125, + -14.125 + ], + [ + 2.125, + -14.075 + ], + [ + 2.125, + -14.024999999999999 + ], + [ + 2.125, + -13.975 + ], + [ + 2.125, + -13.924999999999999 + ], + [ + 2.125, + -13.875 + ], + [ + 2.125, + -13.825 + ], + [ + 2.125, + -13.774999999999999 + ], + [ + 2.125, + -13.725 + ], + [ + 2.125, + -13.674999999999999 + ], + [ + 2.125, + -13.625 + ], + [ + 2.125, + -13.575 + ], + [ + 2.125, + -13.524999999999999 + ], + [ + 2.125, + -13.475 + ], + [ + 2.125, + -13.424999999999999 + ], + [ + 2.125, + -13.375 + ], + [ + 2.125, + -13.325 + ], + [ + 2.125, + -13.274999999999999 + ], + [ + 2.125, + -13.225 + ], + [ + 2.125, + -13.174999999999999 + ], + [ + 2.125, + -13.125 + ], + [ + 2.125, + -13.075 + ], + [ + 2.125, + -13.024999999999999 + ], + [ + 2.125, + -12.975 + ], + [ + 2.125, + -12.924999999999999 + ], + [ + 2.125, + -12.875 + ], + [ + 2.125, + -12.825 + ], + [ + 2.125, + -12.774999999999999 + ], + [ + 2.125, + -12.725 + ], + [ + 2.125, + -12.674999999999999 + ], + [ + 2.125, + -12.625 + ], + [ + 2.125, + -12.575 + ], + [ + 2.125, + -12.524999999999999 + ], + [ + 2.125, + -12.475 + ], + [ + 2.125, + -12.424999999999999 + ], + [ + 2.125, + -12.375 + ], + [ + 2.125, + -12.325 + ], + [ + 2.125, + -12.274999999999999 + ], + [ + 2.125, + -12.225 + ], + [ + 2.125, + -12.174999999999999 + ], + [ + 2.125, + -12.125 + ], + [ + 2.125, + -12.075 + ], + [ + 2.125, + -12.024999999999999 + ], + [ + 2.125, + -11.975 + ], + [ + 2.125, + -11.924999999999999 + ], + [ + 2.125, + -11.875 + ], + [ + 2.125, + -11.825 + ], + [ + 2.125, + -11.774999999999999 + ], + [ + 2.125, + -11.725 + ], + [ + 2.125, + -11.674999999999999 + ], + [ + 2.125, + -11.625 + ], + [ + 2.125, + -11.575 + ], + [ + 2.125, + -11.524999999999999 + ], + [ + 2.125, + -11.475 + ], + [ + 2.125, + -11.424999999999999 + ], + [ + 2.125, + -11.375 + ], + [ + 2.125, + -11.325 + ], + [ + 2.125, + -11.274999999999999 + ], + [ + 2.125, + -11.225 + ], + [ + 2.125, + -11.174999999999999 + ], + [ + 2.125, + -11.125 + ], + [ + 2.125, + -11.075 + ], + [ + 2.125, + -11.024999999999999 + ], + [ + 2.125, + -10.975 + ], + [ + 2.125, + -10.924999999999999 + ], + [ + 2.125, + -10.875 + ], + [ + 2.125, + -10.825 + ], + [ + 2.125, + -10.774999999999999 + ], + [ + 2.125, + -10.725 + ], + [ + 2.125, + -10.674999999999999 + ], + [ + 2.125, + -10.625 + ], + [ + 2.125, + -10.575 + ], + [ + 2.125, + -10.524999999999999 + ], + [ + 2.125, + -10.475 + ], + [ + 2.125, + -10.424999999999999 + ], + [ + 2.125, + -10.375 + ], + [ + 2.125, + -10.325 + ], + [ + 2.125, + -10.274999999999999 + ], + [ + 2.125, + -10.225 + ], + [ + 2.125, + -10.174999999999999 + ], + [ + 2.125, + -10.125 + ], + [ + 2.125, + -10.075 + ], + [ + 2.125, + -10.024999999999999 + ], + [ + 2.125, + -9.975 + ], + [ + 2.125, + -9.924999999999999 + ], + [ + 2.125, + -9.875 + ], + [ + 2.125, + -9.825 + ], + [ + 2.125, + -9.774999999999999 + ], + [ + 2.125, + -9.725 + ], + [ + 2.125, + -9.674999999999999 + ], + [ + 2.125, + -9.625 + ], + [ + 2.125, + -9.575 + ], + [ + 2.125, + -9.524999999999999 + ], + [ + 2.125, + -9.475 + ], + [ + 2.125, + -9.424999999999999 + ], + [ + 2.125, + -9.375 + ], + [ + 2.125, + -9.325 + ], + [ + 2.125, + -9.274999999999999 + ], + [ + 2.125, + -9.225 + ], + [ + 2.125, + -9.174999999999999 + ], + [ + 2.125, + -9.125 + ], + [ + 2.125, + -9.075 + ], + [ + 2.125, + -9.024999999999999 + ], + [ + 2.125, + -8.975 + ], + [ + 2.125, + -8.924999999999999 + ], + [ + 2.125, + -8.875 + ], + [ + 2.125, + -8.825 + ], + [ + 2.125, + -8.774999999999999 + ], + [ + 2.125, + -8.725 + ], + [ + 2.125, + -8.674999999999999 + ], + [ + 2.125, + -8.625 + ], + [ + 2.125, + -8.575 + ], + [ + 2.125, + -8.524999999999999 + ], + [ + 2.125, + -8.475 + ], + [ + 2.125, + -8.424999999999999 + ], + [ + 2.125, + -8.375 + ], + [ + 2.125, + -8.325 + ] +] diff --git a/docs/06-scenario-parameter-space-and-schema.md b/docs/06-scenario-parameter-space-and-schema.md index bad29a3d..3168b8f8 100644 --- a/docs/06-scenario-parameter-space-and-schema.md +++ b/docs/06-scenario-parameter-space-and-schema.md @@ -10,7 +10,7 @@ | World | Nav2 `nav2_minimal_tb4_sim/worlds/warehouse.sdf` (Gazebo); `warehouse_k2d.json` 2-D occupancy clone (kinematic2d) | | Map | Pre-built occupancy map of the warehouse shipped in `ros_ws/src/roboprobe_ros/maps/warehouse.yaml` (generated once with `slam_toolbox`, T-092) | | Start ("Dock A") | spawn pose from the Nav2 warehouse example: `x = 2.12, y = −21.3, yaw = 1.57` (verified in T-091) | -| Goal ("Station B") | defined in `tasks/warehouse_delivery_v1.yaml` ~12–15 m away through one aisle (exact coordinates fixed in T-092 after map inspection) | +| Goal ("Station B") | `x = 2.12, y = −8.3, yaw = 1.57` (~13 m north through the centre aisle; verified T-092 on the k2d grid) | | Nominal path | Polyline computed once from Nav2 planner on the empty map; stored with the task; used to place injected obstacles | | Injected obstacle | "Dropped pallet": 0.8 × 0.6 m box whose **top is below the 2-D lidar scan plane** (height derived from TB4 URDF in T-091) so it is detectable only by the depth camera ⇒ perception and lighting matter | | Success | reach goal within 0.25 m position / 0.5 rad yaw tolerance before time limit, without any oracle failure | @@ -300,7 +300,7 @@ id: warehouse_delivery_v1 world: {gazebo: nav2_minimal_tb4_sim/worlds/warehouse.sdf, kinematic2d: worlds/warehouse_k2d.json} map: maps/warehouse.yaml start: {x: 2.12, y: -21.3, yaw: 1.57} -goal: {x: TBD_T092, y: TBD_T092, yaw: 1.57} # filled by T-092; CI fails if TBD remains +goal: {x: 2.12, y: -8.3, yaw: 1.57} goal_tolerance: {xy: 0.25, yaw: 0.5} nominal_path: paths/warehouse_delivery_v1.csv injected_obstacles: diff --git a/docs/27-configuration-reference.md b/docs/27-configuration-reference.md index f91bdb1a..0dea2653 100644 --- a/docs/27-configuration-reference.md +++ b/docs/27-configuration-reference.md @@ -231,6 +231,8 @@ fails on drift. `.env.example` and `roboprobe.example.toml` are generated the sa | Key | Type | Default | Env var | Description | |-----|------|---------|---------|-------------| +| `scenario.map_alignment.min_iou` | float | `0.95` | `ROBOPROBE_SCENARIO__MAP_ALIGNMENT__MIN_IOU` | Minimum occupied-cell IoU between kinematic2d and Gazebo maps. | +| `scenario.map_alignment.path_length_tolerance_ratio` | float | `0.02` | `ROBOPROBE_SCENARIO__MAP_ALIGNMENT__PATH_LENGTH_TOLERANCE_RATIO` | Allowed relative difference between backend nominal path lengths. | | `scenario.constraint_max_attempts` | int | `1000` | `ROBOPROBE_SCENARIO__CONSTRAINT_MAX_ATTEMPTS` | Sampler draws before rejection sampling of constrained spaces gives up. | | `scenario.constraint_max_literal_exponent` | int | `8` | `ROBOPROBE_SCENARIO__CONSTRAINT_MAX_LITERAL_EXPONENT` | Largest absolute integer exponent allowed in a constraint (TM-03). | | `scenario.yaml_max_aliases` | int | `32` | `ROBOPROBE_SCENARIO__YAML_MAX_ALIASES` | Maximum YAML alias expansions in one uploaded document (TM-02). | diff --git a/docs/28-traceability-matrix.md b/docs/28-traceability-matrix.md index 10ee8fc9..981f1607 100644 --- a/docs/28-traceability-matrix.md +++ b/docs/28-traceability-matrix.md @@ -9,7 +9,7 @@ | PRD | SRS requirements | Design (docs §) | Tasks (22) | Verification (18) | |-----|------------------|-----------------|-----------|-------------------| | PR-01 Scenario space | FR-SCN-001…007 | 06 §2–5, 05 §3 | T-020…T-025 | unit/property `tests/unit/scenario`, schema fixtures | -| PR-02 Autonomous campaigns | FR-RUN-001…006, FR-SIM-001, FR-SIM-003 | 04 §4–6, 05 §5, 10, 11 §4, 14 §2–5 | T-012, T-033, T-035, T-040…T-047, T-091, T-093a, T-096 | integration runner, chaos, backend contract, Jazzy package tests | +| PR-02 Autonomous campaigns | FR-RUN-001…006, FR-SIM-001, FR-SIM-003 | 04 §4–6, 05 §5, 10, 11 §4, 14 §2–5 | T-012, T-033, T-035, T-040…T-047, T-091, T-092, T-093a, T-096 | integration runner, chaos, backend contract, Jazzy package tests, sim map alignment | | PR-03 Intelligent selection | FR-SEL-002/003/005/006/007/008 | 07 §4–6 | T-055…T-061 | strategy contract, benchmark gates 18 §4.4, EXP-01 | | PR-04 Baselines | FR-SEL-001 | 07 §3 | T-050, T-051 | strategy contract, design tests | | PR-05 Failure detection | FR-ORC-001…006 | 08 | T-036…T-039 | golden traces, invariants | diff --git a/docs/evidence/README.md b/docs/evidence/README.md index ceec576a..c4c64118 100644 --- a/docs/evidence/README.md +++ b/docs/evidence/README.md @@ -4,6 +4,7 @@ Results and records produced during implementation and evaluation (kept in git w - [T-090 Gazebo spike](T-090-gazebo-spike.md) — feasibility measurements for real-time factor, startup, CPU and memory. - [T-091 ROS topics verification](T-091/README.md) — `topics.yaml`, TB4 geometry, Nav2 parameter paths. +- [T-092 warehouse map & path](T-092.md) — k2d/Gazebo maps, nominal path, IoU follow-up ([#331]). - `T-061-benchmark-calibration.md` — frozen selector thresholds/hyper-parameters. - `T-131-mutation.md` — mutation-testing kill-rate baseline. - `exp01/` … `exp07/` — experiment reports (19). diff --git a/docs/evidence/T-092.md b/docs/evidence/T-092.md new file mode 100644 index 00000000..19a099fc --- /dev/null +++ b/docs/evidence/T-092.md @@ -0,0 +1,28 @@ +# T-092 — Warehouse map, goal, and nominal path (CI-safe slice) + +## Shipped in this PR + +- Vendored Nav2 bringup warehouse map at `configs/maps/warehouse_v1.{yaml,pgm}` (Gazebo reference). +- ROS map export of the kinematic2d clone at `tasks/maps/warehouse.{yaml,pgm}`. +- A* nominal path (`configs/maps/warehouse_v1_nominal_path.json`, `tasks/paths/warehouse_delivery_v1.csv`). +- `roboprobe.geometry.map_io`, `scripts/compare_maps.py`, and `tests/unit/scenario/test_map_alignment.py`. +- `warehouse_delivery_v1` goal and path no longer `provisional` (strict loader accepts the task). + +## Hardware / GPU blocker ([#331]) + +Cross-map IoU against the **live** sim occupancy (planner-verified on the owner's laptop) was not +re-run in CI: this cloud environment has no Docker/Gazebo stack. Comparing the kinematic2d clone to +the vendored Nav2 `warehouse` map yields IoU ≈ **0.57** (see `scripts/compare_maps.py` or the +`test_gazebo_map_iou_recorded_for_followup` unit test). The gate `scenario.map_alignment.min_iou` +(0.95) will pass once the k2d world is reconciled with the Gazebo map on the GPU host tracked in +[#331](https://github.com/CodewithJha/RoboProbe/issues/331). + +## Reproduce locally + +```bash +uv run --directory backend python ../scripts/compare_maps.py \\ + configs/backends/warehouse_k2d.json configs/maps/warehouse_v1.yaml +``` + +After the owner's GPU measurements, re-export or adjust `warehouse_k2d.json`, re-run compare_maps +until IoU ≥ 0.95, then update this note. diff --git a/roboprobe.example.toml b/roboprobe.example.toml index e09f4f37..bbe58b25 100644 --- a/roboprobe.example.toml +++ b/roboprobe.example.toml @@ -235,6 +235,12 @@ # Target real-time factor of the simulation. # real_time_factor = 1.0 +[scenario.map_alignment] +# Minimum occupied-cell IoU between kinematic2d and Gazebo maps. +# min_iou = 0.95 +# Allowed relative difference between backend nominal path lengths. +# path_length_tolerance_ratio = 0.02 + [scenario] # Sampler draws before rejection sampling of constrained spaces gives up. # constraint_max_attempts = 1000 diff --git a/scripts/compare_maps.py b/scripts/compare_maps.py new file mode 100644 index 00000000..c1d19127 --- /dev/null +++ b/scripts/compare_maps.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 +r"""Compare occupancy between the kinematic2d world JSON and a ROS map (T-092). + +Usage (repo root):: + + uv run --directory backend python ../scripts/compare_maps.py \\ + configs/backends/warehouse_k2d.json configs/maps/warehouse_v1.yaml +""" + +from __future__ import annotations + +import argparse +import json +import sys +from pathlib import Path + +from roboprobe.backends.kinematic2d.world import load_world +from roboprobe.core.settings import load_settings +from roboprobe.scenario.map_io import load_ros_map, occupancy_iou + + +def _repo_root() -> Path: + return Path(__file__).resolve().parents[1] + + +def main(argv: list[str] | None = None) -> int: + """Run the map comparison CLI.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("k2d_json", type=Path, help="RLE occupancy JSON (warehouse_k2d)") + parser.add_argument("ros_yaml", type=Path, help="ROS map YAML (Gazebo reference)") + parser.add_argument("--json", action="store_true", help="Print machine-readable JSON") + args = parser.parse_args(argv) + + root = _repo_root() + k2d = load_world(root / args.k2d_json) + gazebo = load_ros_map(root / args.ros_yaml) + result = occupancy_iou(k2d, gazebo) + gates = load_settings().scenario.map_alignment + payload = { + "iou": result.iou, + "agreement": result.agreement, + "samples": result.samples, + "min_iou": gates.min_iou, + "pass": result.iou >= gates.min_iou, + } + if args.json: + print(json.dumps(payload, indent=2, sort_keys=True)) + else: + status = "PASS" if payload["pass"] else "FAIL" + print( + f"{status}: IoU={result.iou:.4f} agreement={result.agreement:.4f} " + f"(gate {gates.min_iou})" + ) + return 0 if payload["pass"] else 1 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/scripts/export_warehouse_maps.py b/scripts/export_warehouse_maps.py new file mode 100644 index 00000000..b93cd6d9 --- /dev/null +++ b/scripts/export_warehouse_maps.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python3 +"""Export ``warehouse_v1`` maps and nominal path artefacts (T-092). + +Writes ``tasks/maps/warehouse.{yaml,pgm}`` from the kinematic2d clone, copies the vendored +Nav2 warehouse map to ``configs/maps/warehouse_v1.*``, and stores the A* nominal path. +""" + +from __future__ import annotations + +import csv +import json +import sys +from pathlib import Path + +import numpy as np +import numpy.typing as npt + +from roboprobe.backends.kinematic2d.model import Kinematic2DModel +from roboprobe.backends.kinematic2d.planner import plan_path +from roboprobe.backends.kinematic2d.world import load_world +from roboprobe.scenario.map_io import write_ros_map + + +def _repo_root() -> Path: + return Path(__file__).resolve().parents[1] + + +def _write_nominal_path(root: Path, points: npt.NDArray[np.float64]) -> None: + csv_path = root / "tasks" / "paths" / "warehouse_delivery_v1.csv" + csv_path.parent.mkdir(parents=True, exist_ok=True) + with csv_path.open("w", encoding="utf-8", newline="") as handle: + writer = csv.writer(handle) + writer.writerow(["x", "y"]) + writer.writerows([[f"{x:.2f}", f"{y:.2f}"] for x, y in points]) + json_path = root / "configs" / "maps" / "warehouse_v1_nominal_path.json" + json_path.write_text(json.dumps(points.tolist(), indent=2) + "\n", encoding="utf-8") + + +def main() -> int: + """Export warehouse maps and nominal path under the repository root.""" + root = _repo_root() + model = Kinematic2DModel.from_yaml(root / "configs/backends/kinematic2d_v1.yaml") + grid = load_world(root / "configs/backends/warehouse_k2d.json") + write_ros_map(root / "tasks/maps/warehouse.yaml", grid) + + nav_yaml = root / "configs/maps/warehouse_v1.yaml" + nav_pgm = root / "configs/maps/warehouse_v1.pgm" + nav_yaml.parent.mkdir(parents=True, exist_ok=True) + if not nav_pgm.is_file(): + msg = f"missing vendored Gazebo map: {nav_pgm}" + print(msg, file=sys.stderr) + return 2 + if not nav_yaml.is_file(): + msg = f"missing vendored Gazebo map metadata: {nav_yaml}" + print(msg, file=sys.stderr) + return 2 + + start = (model.world.start_x_m, model.world.start_y_m) + goal = (model.world.goal_x_m, model.world.goal_y_m) + path = plan_path(grid, start, goal) + if path is None: + print("Planner returned no path for warehouse task", file=sys.stderr) + return 1 + _write_nominal_path(root, path) + print("Exported tasks/maps/warehouse.*, configs/maps/warehouse_v1.*, nominal path") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tasks/maps/warehouse.pgm b/tasks/maps/warehouse.pgm new file mode 100644 index 00000000..5a7eeab1 Binary files /dev/null and b/tasks/maps/warehouse.pgm differ diff --git a/tasks/maps/warehouse.yaml b/tasks/maps/warehouse.yaml new file mode 100644 index 00000000..e5a81da9 --- /dev/null +++ b/tasks/maps/warehouse.yaml @@ -0,0 +1,12 @@ +image: warehouse.pgm +mode: trinary +resolution: 0.05 +origin: +- 0.0 +- -24.0 +- 0.0 +negate: 0 +occupied_thresh: 0.65 +free_thresh: 0.1 +height: 360 +width: 160 diff --git a/tasks/paths/warehouse_delivery_v1.csv b/tasks/paths/warehouse_delivery_v1.csv index b16d922a..f12ee2f2 100644 --- a/tasks/paths/warehouse_delivery_v1.csv +++ b/tasks/paths/warehouse_delivery_v1.csv @@ -1,28 +1,262 @@ -x,y -2.12,-21.30 -2.12,-20.80 -2.12,-20.30 -2.12,-19.80 -2.12,-19.30 -2.12,-18.80 -2.12,-18.30 -2.12,-17.80 -2.12,-17.30 -2.12,-16.80 -2.12,-16.30 -2.12,-15.80 -2.12,-15.30 -2.12,-14.80 -2.12,-14.30 -2.12,-13.80 -2.12,-13.30 -2.12,-12.80 -2.12,-12.30 -2.12,-11.80 -2.12,-11.30 -2.12,-10.80 -2.12,-10.30 -2.12,-9.80 -2.12,-9.30 -2.12,-8.80 -2.12,-8.30 +x,y +2.12,-21.32 +2.12,-21.27 +2.12,-21.23 +2.12,-21.18 +2.12,-21.12 +2.12,-21.07 +2.12,-21.02 +2.12,-20.98 +2.12,-20.93 +2.12,-20.88 +2.12,-20.82 +2.12,-20.77 +2.12,-20.73 +2.12,-20.68 +2.12,-20.62 +2.12,-20.57 +2.12,-20.52 +2.12,-20.48 +2.12,-20.43 +2.12,-20.38 +2.12,-20.32 +2.12,-20.27 +2.12,-20.23 +2.12,-20.18 +2.12,-20.12 +2.12,-20.07 +2.12,-20.02 +2.12,-19.98 +2.12,-19.93 +2.12,-19.88 +2.12,-19.82 +2.12,-19.77 +2.12,-19.73 +2.12,-19.68 +2.12,-19.62 +2.12,-19.57 +2.12,-19.52 +2.12,-19.48 +2.12,-19.43 +2.12,-19.38 +2.12,-19.32 +2.12,-19.27 +2.12,-19.23 +2.12,-19.18 +2.12,-19.12 +2.12,-19.07 +2.12,-19.02 +2.12,-18.98 +2.12,-18.93 +2.12,-18.88 +2.12,-18.82 +2.12,-18.77 +2.12,-18.73 +2.12,-18.68 +2.12,-18.62 +2.12,-18.57 +2.12,-18.52 +2.12,-18.48 +2.12,-18.43 +2.12,-18.38 +2.12,-18.32 +2.12,-18.27 +2.12,-18.23 +2.12,-18.18 +2.12,-18.12 +2.12,-18.07 +2.12,-18.02 +2.12,-17.98 +2.12,-17.93 +2.12,-17.88 +2.12,-17.82 +2.12,-17.77 +2.12,-17.73 +2.12,-17.68 +2.12,-17.62 +2.12,-17.57 +2.12,-17.52 +2.12,-17.48 +2.12,-17.43 +2.12,-17.38 +2.12,-17.32 +2.12,-17.27 +2.12,-17.23 +2.12,-17.18 +2.12,-17.12 +2.12,-17.07 +2.12,-17.02 +2.12,-16.98 +2.12,-16.93 +2.12,-16.88 +2.12,-16.82 +2.12,-16.77 +2.12,-16.73 +2.12,-16.68 +2.12,-16.62 +2.12,-16.57 +2.12,-16.52 +2.12,-16.48 +2.12,-16.43 +2.12,-16.38 +2.12,-16.32 +2.12,-16.27 +2.12,-16.23 +2.12,-16.18 +2.12,-16.12 +2.12,-16.07 +2.12,-16.02 +2.12,-15.97 +2.12,-15.92 +2.12,-15.88 +2.12,-15.82 +2.12,-15.78 +2.12,-15.72 +2.12,-15.67 +2.12,-15.62 +2.12,-15.57 +2.12,-15.53 +2.12,-15.47 +2.12,-15.42 +2.12,-15.38 +2.12,-15.32 +2.12,-15.28 +2.12,-15.22 +2.12,-15.17 +2.12,-15.12 +2.12,-15.07 +2.12,-15.03 +2.12,-14.97 +2.12,-14.92 +2.12,-14.88 +2.12,-14.82 +2.12,-14.78 +2.12,-14.72 +2.12,-14.67 +2.12,-14.62 +2.12,-14.57 +2.12,-14.53 +2.12,-14.47 +2.12,-14.42 +2.12,-14.38 +2.12,-14.32 +2.12,-14.27 +2.12,-14.22 +2.12,-14.17 +2.12,-14.12 +2.12,-14.07 +2.12,-14.02 +2.12,-13.97 +2.12,-13.92 +2.12,-13.88 +2.12,-13.82 +2.12,-13.77 +2.12,-13.72 +2.12,-13.67 +2.12,-13.62 +2.12,-13.57 +2.12,-13.52 +2.12,-13.47 +2.12,-13.42 +2.12,-13.38 +2.12,-13.32 +2.12,-13.27 +2.12,-13.22 +2.12,-13.17 +2.12,-13.12 +2.12,-13.07 +2.12,-13.02 +2.12,-12.97 +2.12,-12.92 +2.12,-12.88 +2.12,-12.82 +2.12,-12.77 +2.12,-12.72 +2.12,-12.67 +2.12,-12.62 +2.12,-12.57 +2.12,-12.52 +2.12,-12.47 +2.12,-12.42 +2.12,-12.38 +2.12,-12.32 +2.12,-12.27 +2.12,-12.22 +2.12,-12.17 +2.12,-12.12 +2.12,-12.07 +2.12,-12.02 +2.12,-11.97 +2.12,-11.92 +2.12,-11.88 +2.12,-11.82 +2.12,-11.77 +2.12,-11.72 +2.12,-11.67 +2.12,-11.62 +2.12,-11.57 +2.12,-11.52 +2.12,-11.47 +2.12,-11.42 +2.12,-11.38 +2.12,-11.32 +2.12,-11.27 +2.12,-11.22 +2.12,-11.17 +2.12,-11.12 +2.12,-11.07 +2.12,-11.02 +2.12,-10.97 +2.12,-10.92 +2.12,-10.88 +2.12,-10.82 +2.12,-10.77 +2.12,-10.72 +2.12,-10.67 +2.12,-10.62 +2.12,-10.57 +2.12,-10.52 +2.12,-10.47 +2.12,-10.42 +2.12,-10.38 +2.12,-10.32 +2.12,-10.27 +2.12,-10.22 +2.12,-10.17 +2.12,-10.12 +2.12,-10.07 +2.12,-10.02 +2.12,-9.97 +2.12,-9.92 +2.12,-9.88 +2.12,-9.82 +2.12,-9.77 +2.12,-9.72 +2.12,-9.67 +2.12,-9.62 +2.12,-9.57 +2.12,-9.52 +2.12,-9.47 +2.12,-9.42 +2.12,-9.38 +2.12,-9.32 +2.12,-9.27 +2.12,-9.22 +2.12,-9.17 +2.12,-9.12 +2.12,-9.07 +2.12,-9.02 +2.12,-8.97 +2.12,-8.92 +2.12,-8.88 +2.12,-8.82 +2.12,-8.77 +2.12,-8.72 +2.12,-8.67 +2.12,-8.62 +2.12,-8.57 +2.12,-8.52 +2.12,-8.47 +2.12,-8.42 +2.12,-8.38 +2.12,-8.32 diff --git a/tasks/warehouse_delivery_v1.yaml b/tasks/warehouse_delivery_v1.yaml index 32b9ebef..195e17e4 100644 --- a/tasks/warehouse_delivery_v1.yaml +++ b/tasks/warehouse_delivery_v1.yaml @@ -1,10 +1,9 @@ # Task under test for scenario space warehouse_v1 (docs/06 §1, §7). Schema: schemas/task.schema.json. # -# PROVISIONAL values (listed under `provisional`, rejected by the strict loader and by -# `scripts/check_no_tbd.py --strict`): -# goal - ~13 m north of Dock A through the first aisle, chosen before the kinematic2d -# world (T-032) and the Gazebo map inspection (T-092) exist. T-092 fixes it. -# nominal_path - straight provisional polyline; T-092 regenerates it with the Nav2 planner. +# Map and nominal path verified in T-092: A* on `configs/backends/warehouse_k2d.json`; +# Gazebo reference map vendored at `configs/maps/warehouse_v1.*` (Nav2 bringup warehouse). +# Cross-map IoU ≥ 0.95 against the live sim map is deferred to the owner's GPU host ([#331]). +# # injected_obstacles - resolved in T-091 (0.144 m EUR pallet, below the 0.194 m lidar plane). schema_version: 1 id: warehouse_delivery_v1 @@ -18,4 +17,3 @@ nominal_path: paths/warehouse_delivery_v1.csv injected_obstacles: - {model: dropped_pallet, size: [0.8, 0.6, 0.144], placement: {along: obstacle.along_path, lateral: obstacle.clearance, side: left}} time_limit: {factor: 2.5, offset_s: 10, cap_s: 120} -provisional: [goal, nominal_path] diff --git a/web/e2e/pages/wizard.ts b/web/e2e/pages/wizard.ts index 2c65aacc..d22b5dcc 100644 --- a/web/e2e/pages/wizard.ts +++ b/web/e2e/pages/wizard.ts @@ -15,7 +15,7 @@ export class WizardPage { async createK2dCampaign(): Promise { await this.page .getByLabel(/Scenario space/) - .selectOption({ label: 'warehouse_v1 · 09cf763f2e0d' }); + .selectOption({ label: 'warehouse_v1 · 98c8f6e8ce35' }); await this.page.getByRole('button', { name: 'Continue' }).click(); await this.page.getByLabel('Backend').selectOption('kinematic2d'); await this.page.getByLabel('Robot profile').selectOption('k2d_default'); diff --git a/web/src/features/campaigns/WizardPage.test.tsx b/web/src/features/campaigns/WizardPage.test.tsx index 0e0b5423..3917af38 100644 --- a/web/src/features/campaigns/WizardPage.test.tsx +++ b/web/src/features/campaigns/WizardPage.test.tsx @@ -16,7 +16,7 @@ const defaultCliConfig = readFileSync( 'utf8', ); -const version = '4326a28381df'; +const version = '98c8f6e8ce35'; const configSeed = 20261119; let payload: unknown; let requestKey: string | null;