urml-mobile-runtime 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,117 @@
1
+ # --- Python ---
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ dist/
9
+ develop-eggs/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+ MANIFEST
23
+
24
+ # Virtual envs
25
+ .venv/
26
+ venv/
27
+ env/
28
+ ENV/
29
+ .python-version
30
+
31
+ # Test / coverage / mypy / pyright
32
+ .coverage
33
+ .coverage.*
34
+ .cache
35
+ .pytest_cache/
36
+ .mypy_cache/
37
+ .dmypy.json
38
+ .pyre/
39
+ .pyright/
40
+ htmlcov/
41
+ nosetests.xml
42
+ coverage.xml
43
+ *.cover
44
+ .hypothesis/
45
+ .tox/
46
+
47
+ # --- Node / web tooling (kept out of core repo; here for safety) ---
48
+ node_modules/
49
+ .pnp.*
50
+ .yarn/cache/
51
+ .yarn/unplugged/
52
+ .yarn/build-state.yml
53
+ .yarn/install-state.gz
54
+ npm-debug.log*
55
+ yarn-debug.log*
56
+ yarn-error.log*
57
+
58
+ # --- C++ / Rust build artifacts (in case reference runtimes land here in early Phase 1) ---
59
+ target/
60
+ *.o
61
+ *.obj
62
+ *.a
63
+ *.lib
64
+ *.dll
65
+ *.dylib
66
+ *.exe
67
+ *.pdb
68
+ cmake-build-*/
69
+ CMakeCache.txt
70
+ CMakeFiles/
71
+ CMakeScripts/
72
+ Testing/
73
+ cmake_install.cmake
74
+ install_manifest.txt
75
+ compile_commands.json
76
+
77
+ # --- ROS 2 build dirs ---
78
+ build/
79
+ install/
80
+ log/
81
+
82
+ # --- Editor and OS junk ---
83
+ .vscode/
84
+ .idea/
85
+ *.swp
86
+ *.swo
87
+ *~
88
+ .DS_Store
89
+ Thumbs.db
90
+ desktop.ini
91
+
92
+ # --- Local-only artifacts ---
93
+ .env
94
+ .env.*
95
+ *.log
96
+ *.tmp
97
+ .local/
98
+ .scratch/
99
+
100
+ # --- Outreach campaign artifacts (operational, not part of the open standard) ---
101
+ # Target lists, message drafts, tracking data, and the launch-approval record
102
+ # stay local. They are private to the maintainer; committing them would
103
+ # telegraph the campaign before launch and could embarrass listed projects.
104
+ outreach/
105
+
106
+ # Outreach dashboard SQLite mirror (RFC-0275). Derived from
107
+ # examples/lighthouses/outreach*.yaml via tools/scripts/refresh_outreach_db.py.
108
+ # Regenerated on demand by `make outreach-refresh`.
109
+ tools/outreach.db
110
+ tools/.outreach.db
111
+
112
+ # Local Claude Code settings (per-machine; permission rules, etc.). Not committed.
113
+ .claude/settings.json
114
+ .claude/settings.local.json
115
+
116
+ # Claude Code session worktrees (`claude -w <name>`); see AGENTS.md "Parallel sessions".
117
+ .claude/worktrees/
@@ -0,0 +1,91 @@
1
+ Metadata-Version: 2.5
2
+ Name: urml-mobile-runtime
3
+ Version: 0.5.0
4
+ Summary: Wheeled AMR reference runtime for URML — Clearpath Husky / Jackal.
5
+ Project-URL: Homepage, https://github.com/urml-dev/URML
6
+ Project-URL: Repository, https://github.com/urml-dev/URML
7
+ Project-URL: Issues, https://github.com/urml-dev/URML/issues
8
+ Author: URML Maintainers
9
+ License: BUSL-1.1
10
+ Keywords: amr,clearpath,husky,jackal,mobile-robot,robotics,runtime,urml
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: Other/Proprietary License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Scientific/Engineering
19
+ Requires-Python: >=3.11
20
+ Requires-Dist: pydantic<3,>=2.6
21
+ Requires-Dist: pyyaml<7,>=6.0
22
+ Requires-Dist: urml-ros2-runtime>=0.5.0
23
+ Requires-Dist: urml-validator>=0.5.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: mypy>=1.10; extra == 'dev'
26
+ Requires-Dist: pytest-cov>=5; extra == 'dev'
27
+ Requires-Dist: pytest>=8; extra == 'dev'
28
+ Requires-Dist: ruff>=0.5; extra == 'dev'
29
+ Description-Content-Type: text/markdown
30
+
31
+ <p align="center">
32
+ <a href="https://urml.dev"><img src="https://urml.dev/favicon.svg" alt="URML" width="72" height="72"></a>
33
+ </p>
34
+
35
+ <p align="center">
36
+ A small, opinionated, human-readable language for describing robot intent.
37
+ </p>
38
+
39
+ <p align="center">
40
+ <a href="https://urml.dev"><b>urml.dev</b></a>
41
+ </p>
42
+
43
+ ---
44
+
45
+ # urml-mobile-runtime
46
+
47
+ **Wheeled-AMR reference runtime for URML** — `HuskyAdapter` and `JackalAdapter` for **Clearpath Husky / Jackal**, the canonical ROS 2 differential-drive research/field bases.
48
+
49
+ Husky and Jackal speak ROS 2 + Nav2, so each adapter **composes** the ROS 2 runtime's `RclpyAdapter` — the same single-sourced-substrate pattern the industrial-arm, ANYmal, and Digit families use. Distinct first-class classes, brand-scoped not-supported tag, no duplicated Nav2 plumbing. `differential` `drive_type` is already in the v0.1 manifest schema, so this needs no RFC.
50
+
51
+ ## Method coverage
52
+
53
+ `move_to`/`hover`, `wait`, `measure`, `wait_for`, `report` delegate to the composed ROS 2 substrate. `grasp`/`release`, `dock`, `detect`, `scan`, `capture`, `speak`, `listen`, and the drone trio return `not_supported_on_amr[<brand>]` (returned, not raised). A Clearpath base carrying a UR/Franka arm + Robotiq gripper (a common mobile-manipulator config) pairs with an industrial-arm companion adapter, exactly as the drone stack pairs flight with a companion.
54
+
55
+ ## Declared "parts"
56
+
57
+ The companion fixture `clearpath_husky` manifest declares parts as first-class provenance components: a **Robotiq** 2F-85 gripper (Canada), an **Intel RealSense** D435 (US), and a **Clearpath** base (Canada) — all compliant under the bundled US-federal default policy. Its negative twin `hesai_lidar_denied` swaps in one critical **Hesai** LIDAR (FCC Covered List) and is rejected with `policy.vendor_denied`, pushing the denylisted-vendor check down to component granularity (cf. `home/policy_vendor_denylist`, `quadruped/unitree_vendor_denied`).
58
+
59
+ ## Install / use
60
+
61
+ ```bash
62
+ pip install -e reference/mobile-runtime # needs a sourced ROS 2 env to construct
63
+ ```
64
+
65
+ ```python
66
+ from urml_conformance import ConformanceRunner
67
+ from urml_mobile_runtime import MOBILE_ADAPTERS
68
+
69
+ runner = ConformanceRunner(adapter_factory=lambda: MOBILE_ADAPTERS["husky"]())
70
+ ```
71
+
72
+ ## Status
73
+
74
+ **v0.1 (this release):**
75
+ - `HuskyAdapter` + `JackalAdapter` over a shared `ClearpathAdapter` core (composes `RclpyAdapter`) + `MOBILE_ADAPTERS` registry.
76
+ - Hermetic unit tests: delegation, every not-supported sentinel, the conformance hook, `runtime_checkable` conformance, teardown — no ROS 2 install required.
77
+ - `clearpath_husky` (compliant parts) + `hesai_lidar_denied` (denied part) manifests + `conformance/fixtures/mobile/` positive & negative fixtures, verified through the conformance runner.
78
+ - Gated `.github/workflows/mobile-integration.yml`: `mobile-smoke`, `mobile-arm64-build` (hermetic suite under `linux/arm64` QEMU — the Jetson-class signal), and a matrixed `mobile-sim-e2e` against the Clearpath Gazebo sim (first runs per brand are calibration runs by design, the established `ros2-integration` convention).
79
+
80
+ **Follow-ups (not yet):**
81
+ - A mobile-manipulator composite (Clearpath base + UR/Franka arm) wiring, analogous to the industrial vision-companion split.
82
+
83
+ ## Core Commitment
84
+
85
+ This runtime is licensed under the Business Source License 1.1: free for non-production use, commercial license for production (see [`LICENSING.md`](../../LICENSING.md)). No vendor coupling, no cloud dependency.
86
+
87
+ ## Related documents
88
+
89
+ - [`/reference/ros2-runtime/`](../ros2-runtime/) — the substrate engine these adapters compose.
90
+ - [`/reference/industrial-arm-runtime/`](../industrial-arm-runtime/) — the arm companion for mobile-manipulator configs.
91
+ - [`/conformance/`](../../conformance/) — the test suite that decides conformance.
@@ -0,0 +1,61 @@
1
+ <p align="center">
2
+ <a href="https://urml.dev"><img src="https://urml.dev/favicon.svg" alt="URML" width="72" height="72"></a>
3
+ </p>
4
+
5
+ <p align="center">
6
+ A small, opinionated, human-readable language for describing robot intent.
7
+ </p>
8
+
9
+ <p align="center">
10
+ <a href="https://urml.dev"><b>urml.dev</b></a>
11
+ </p>
12
+
13
+ ---
14
+
15
+ # urml-mobile-runtime
16
+
17
+ **Wheeled-AMR reference runtime for URML** — `HuskyAdapter` and `JackalAdapter` for **Clearpath Husky / Jackal**, the canonical ROS 2 differential-drive research/field bases.
18
+
19
+ Husky and Jackal speak ROS 2 + Nav2, so each adapter **composes** the ROS 2 runtime's `RclpyAdapter` — the same single-sourced-substrate pattern the industrial-arm, ANYmal, and Digit families use. Distinct first-class classes, brand-scoped not-supported tag, no duplicated Nav2 plumbing. `differential` `drive_type` is already in the v0.1 manifest schema, so this needs no RFC.
20
+
21
+ ## Method coverage
22
+
23
+ `move_to`/`hover`, `wait`, `measure`, `wait_for`, `report` delegate to the composed ROS 2 substrate. `grasp`/`release`, `dock`, `detect`, `scan`, `capture`, `speak`, `listen`, and the drone trio return `not_supported_on_amr[<brand>]` (returned, not raised). A Clearpath base carrying a UR/Franka arm + Robotiq gripper (a common mobile-manipulator config) pairs with an industrial-arm companion adapter, exactly as the drone stack pairs flight with a companion.
24
+
25
+ ## Declared "parts"
26
+
27
+ The companion fixture `clearpath_husky` manifest declares parts as first-class provenance components: a **Robotiq** 2F-85 gripper (Canada), an **Intel RealSense** D435 (US), and a **Clearpath** base (Canada) — all compliant under the bundled US-federal default policy. Its negative twin `hesai_lidar_denied` swaps in one critical **Hesai** LIDAR (FCC Covered List) and is rejected with `policy.vendor_denied`, pushing the denylisted-vendor check down to component granularity (cf. `home/policy_vendor_denylist`, `quadruped/unitree_vendor_denied`).
28
+
29
+ ## Install / use
30
+
31
+ ```bash
32
+ pip install -e reference/mobile-runtime # needs a sourced ROS 2 env to construct
33
+ ```
34
+
35
+ ```python
36
+ from urml_conformance import ConformanceRunner
37
+ from urml_mobile_runtime import MOBILE_ADAPTERS
38
+
39
+ runner = ConformanceRunner(adapter_factory=lambda: MOBILE_ADAPTERS["husky"]())
40
+ ```
41
+
42
+ ## Status
43
+
44
+ **v0.1 (this release):**
45
+ - `HuskyAdapter` + `JackalAdapter` over a shared `ClearpathAdapter` core (composes `RclpyAdapter`) + `MOBILE_ADAPTERS` registry.
46
+ - Hermetic unit tests: delegation, every not-supported sentinel, the conformance hook, `runtime_checkable` conformance, teardown — no ROS 2 install required.
47
+ - `clearpath_husky` (compliant parts) + `hesai_lidar_denied` (denied part) manifests + `conformance/fixtures/mobile/` positive & negative fixtures, verified through the conformance runner.
48
+ - Gated `.github/workflows/mobile-integration.yml`: `mobile-smoke`, `mobile-arm64-build` (hermetic suite under `linux/arm64` QEMU — the Jetson-class signal), and a matrixed `mobile-sim-e2e` against the Clearpath Gazebo sim (first runs per brand are calibration runs by design, the established `ros2-integration` convention).
49
+
50
+ **Follow-ups (not yet):**
51
+ - A mobile-manipulator composite (Clearpath base + UR/Franka arm) wiring, analogous to the industrial vision-companion split.
52
+
53
+ ## Core Commitment
54
+
55
+ This runtime is licensed under the Business Source License 1.1: free for non-production use, commercial license for production (see [`LICENSING.md`](../../LICENSING.md)). No vendor coupling, no cloud dependency.
56
+
57
+ ## Related documents
58
+
59
+ - [`/reference/ros2-runtime/`](../ros2-runtime/) — the substrate engine these adapters compose.
60
+ - [`/reference/industrial-arm-runtime/`](../industrial-arm-runtime/) — the arm companion for mobile-manipulator configs.
61
+ - [`/conformance/`](../../conformance/) — the test suite that decides conformance.
@@ -0,0 +1,74 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.27"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "urml-mobile-runtime"
7
+ version = "0.5.0"
8
+ description = "Wheeled AMR reference runtime for URML — Clearpath Husky / Jackal."
9
+ readme = "README.md"
10
+ license = { text = "BUSL-1.1" }
11
+ requires-python = ">=3.11"
12
+ authors = [{ name = "URML Maintainers" }]
13
+ keywords = ["robotics", "amr", "mobile-robot", "clearpath", "husky", "jackal", "urml", "runtime"]
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Intended Audience :: Developers",
17
+ "License :: Other/Proprietary License",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python :: 3 :: Only",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Topic :: Scientific/Engineering",
23
+ ]
24
+ dependencies = [
25
+ "pydantic>=2.6,<3",
26
+ "PyYAML>=6.0,<7",
27
+ "urml-validator>=0.5.0",
28
+ "urml-ros2-runtime>=0.5.0",
29
+ ]
30
+
31
+ [project.optional-dependencies]
32
+ # Clearpath Husky/Jackal speak ROS 2 (Nav2), so ClearpathAdapter
33
+ # composes RclpyAdapter — rclpy ships with the ROS 2 distribution, not
34
+ # PyPI, so there is no installable extra. Module import works on every
35
+ # host (rclpy is lazy inside RclpyAdapter); constructing an adapter
36
+ # needs a sourced ROS 2 environment.
37
+ dev = [
38
+ "pytest>=8",
39
+ "pytest-cov>=5",
40
+ "ruff>=0.5",
41
+ "mypy>=1.10",
42
+ ]
43
+
44
+ [project.urls]
45
+ Homepage = "https://github.com/urml-dev/URML"
46
+ Repository = "https://github.com/urml-dev/URML"
47
+ Issues = "https://github.com/urml-dev/URML/issues"
48
+
49
+ [tool.hatch.build.targets.wheel]
50
+ packages = ["src/urml_mobile_runtime"]
51
+
52
+ [tool.ruff]
53
+ line-length = 120
54
+ target-version = "py311"
55
+ src = ["src", "tests"]
56
+
57
+ [tool.ruff.lint]
58
+ select = ["E", "F", "W", "I", "B", "UP", "N", "ANN", "RUF"]
59
+ ignore = ["ANN401"]
60
+
61
+ [tool.ruff.lint.per-file-ignores]
62
+ "tests/*" = ["ANN"]
63
+
64
+ [tool.mypy]
65
+ strict = true
66
+ python_version = "3.11"
67
+ plugins = ["pydantic.mypy"]
68
+ mypy_path = "src"
69
+ packages = ["urml_mobile_runtime"]
70
+
71
+ [tool.pytest.ini_options]
72
+ minversion = "8.0"
73
+ testpaths = ["tests"]
74
+ addopts = ["-q", "--strict-markers"]
@@ -0,0 +1,36 @@
1
+ """urml_mobile_runtime — wheeled-AMR reference runtime for URML.
2
+
3
+ HuskyAdapter, JackalAdapter
4
+ Clearpath Husky / Jackal, the canonical ROS 2 differential-drive
5
+ research/field AMRs. Each composes the ROS 2 runtime's RclpyAdapter
6
+ (the single-sourced-substrate pattern). rclpy is lazy inside
7
+ RclpyAdapter, so this module loads on every host; constructing an
8
+ adapter needs a sourced ROS 2 environment.
9
+
10
+ ClearpathAdapter
11
+ The shared core the brand classes subclass. Exposed for typing and
12
+ custom-base extension.
13
+
14
+ MOBILE_ADAPTERS
15
+ Name → class registry ({"husky": HuskyAdapter, "jackal":
16
+ JackalAdapter}) for config-driven selection (CI matrices, the
17
+ conformance adapter_factory).
18
+ """
19
+
20
+ from __future__ import annotations
21
+
22
+ from urml_mobile_runtime._version import __version__
23
+ from urml_mobile_runtime.adapter import (
24
+ MOBILE_ADAPTERS,
25
+ ClearpathAdapter,
26
+ HuskyAdapter,
27
+ JackalAdapter,
28
+ )
29
+
30
+ __all__ = [
31
+ "MOBILE_ADAPTERS",
32
+ "ClearpathAdapter",
33
+ "HuskyAdapter",
34
+ "JackalAdapter",
35
+ "__version__",
36
+ ]
@@ -0,0 +1,3 @@
1
+ """Package version. Bumped per release."""
2
+
3
+ __version__ = "0.5.0"
@@ -0,0 +1,264 @@
1
+ """Clearpath wheeled-AMR adapters — Husky and Jackal, via ROS 2 + Nav2.
2
+
3
+ Husky and Jackal are differential-drive ROS 2 research/field AMRs (the
4
+ canonical ROS 2 mobile bases), so this adapter composes the ROS 2
5
+ runtime's :class:`RclpyAdapter` — the same single-sourced-substrate
6
+ pattern the industrial-arm, ANYmal, and Digit adapters use. The
7
+ per-brand surface is real (distinct class, brand-scoped not-supported
8
+ tag); the ROS 2 / Nav2 plumbing is not duplicated.
9
+
10
+ A bare AMR is a mobile base: it navigates (``move_to``), dwells
11
+ (``wait``), takes readings (``measure``), waits on site signals
12
+ (``wait_for``), and reports. It has no arm and no flight; those return
13
+ ``not_supported_on_amr[<brand>]`` rather than raising — the same
14
+ returned-not-raised pattern the other families use. A Clearpath base
15
+ carrying a UR/Franka arm + Robotiq gripper (a common mobile-manipulator
16
+ config) pairs with an industrial-arm companion adapter; the URML
17
+ program, manifest, and validator are unchanged.
18
+
19
+ ``rclpy`` is imported lazily inside :class:`RclpyAdapter`, so importing
20
+ this module works on every host; constructing the adapter needs a
21
+ sourced ROS 2 environment. Hermetic tests inject a fake inner adapter
22
+ via ``inner_factory`` and never touch rclpy.
23
+ """
24
+
25
+ from __future__ import annotations
26
+
27
+ from collections.abc import Callable
28
+ from contextlib import suppress
29
+ from typing import Any, Literal
30
+
31
+ from urml_ros2_runtime.substrate.adapter_config import AdapterConfig
32
+ from urml_ros2_runtime.substrate.base import (
33
+ ProgramCallResult,
34
+ unsupported_program_call,
35
+ CaptureResult,
36
+ DetectionResult,
37
+ ListenResult,
38
+ ManipulationResult,
39
+ MeasurementResult,
40
+ NavigationResult,
41
+ ROSAdapter,
42
+ ScanResult,
43
+ SubstrateResult,
44
+ WaitResult,
45
+ )
46
+ from urml_ros2_runtime.substrate.rclpy_adapter import RclpyAdapter
47
+
48
+ __all__ = ["ClearpathAdapter", "HuskyAdapter", "JackalAdapter", "MOBILE_ADAPTERS"]
49
+
50
+ _NOT_SUPPORTED = (
51
+ "not_supported_on_amr[{brand}]: a bare {brand} mobile base has no "
52
+ "{capability}. Pair it with an industrial-arm / payload companion adapter "
53
+ "for full coverage; the URML program, manifest, and validator are unchanged."
54
+ )
55
+
56
+ InnerFactory = Callable[[], ROSAdapter]
57
+
58
+
59
+ class ClearpathAdapter:
60
+ """Shared core for Clearpath wheeled AMRs, composing RclpyAdapter."""
61
+
62
+ BRAND: str = "clearpath"
63
+
64
+ def __init__(
65
+ self,
66
+ config: AdapterConfig | None = None,
67
+ *,
68
+ node_name: str | None = None,
69
+ inner_factory: InnerFactory | None = None,
70
+ ) -> None:
71
+ self._config = config or AdapterConfig()
72
+ node = node_name or f"urml_{self.BRAND}_amr"
73
+ factory: InnerFactory = inner_factory or (lambda: RclpyAdapter(self._config, node_name=node))
74
+ self._inner: ROSAdapter = factory()
75
+ self._closed = False
76
+
77
+ def close(self) -> None:
78
+ if self._closed:
79
+ return
80
+ inner_close = getattr(self._inner, "close", None)
81
+ if callable(inner_close):
82
+ with suppress(Exception):
83
+ inner_close()
84
+ self._closed = True
85
+
86
+ def __enter__(self) -> ClearpathAdapter:
87
+ return self
88
+
89
+ def __exit__(self, *_: object) -> None:
90
+ self.close()
91
+
92
+ def _reason(self, capability: str) -> str:
93
+ return _NOT_SUPPORTED.format(brand=self.BRAND, capability=capability)
94
+
95
+ # ------------------------------------------------------------------
96
+ # Supported — delegate to the composed RclpyAdapter
97
+ # ------------------------------------------------------------------
98
+
99
+ def send_navigation_goal(
100
+ self,
101
+ *,
102
+ location: str | None = None,
103
+ pose: dict[str, float] | None = None,
104
+ frame: str | None = None,
105
+ carrying: dict[str, Any] | None = None,
106
+ speed: float | None = None,
107
+ ) -> NavigationResult:
108
+ return self._inner.send_navigation_goal(
109
+ location=location, pose=pose, frame=frame, carrying=carrying, speed=speed
110
+ )
111
+
112
+ def take_measurement(self, *, what: str, target: str | None, sensor: str | None) -> MeasurementResult:
113
+ return self._inner.take_measurement(what=what, target=target, sensor=sensor)
114
+
115
+ def wait_for_condition(
116
+ self,
117
+ *,
118
+ kind: Literal["event", "signal", "input", "sensor_threshold"],
119
+ name: str | None,
120
+ input_mode: str | None,
121
+ threshold: dict[str, Any] | None,
122
+ timeout_seconds: float | None,
123
+ ) -> WaitResult:
124
+ return self._inner.wait_for_condition(
125
+ kind=kind, name=name, input_mode=input_mode, threshold=threshold, timeout_seconds=timeout_seconds
126
+ )
127
+
128
+ def wait_passively(self, *, duration_seconds: float) -> SubstrateResult:
129
+ return self._inner.wait_passively(duration_seconds=duration_seconds)
130
+
131
+ def emit_report(
132
+ self,
133
+ *,
134
+ to: str,
135
+ facts: dict[str, Any],
136
+ attachments: list[str] | None,
137
+ status: Literal["success", "partial", "failure"],
138
+ severity: Literal["info", "notice", "warning", "error"],
139
+ ) -> SubstrateResult:
140
+ return self._inner.emit_report(
141
+ to=to, facts=facts, attachments=attachments, status=status, severity=severity
142
+ )
143
+
144
+ # ------------------------------------------------------------------
145
+ # Not supported on a bare mobile base
146
+ # ------------------------------------------------------------------
147
+
148
+ def send_manipulation_goal(
149
+ self,
150
+ *,
151
+ action: Literal["grasp", "release"],
152
+ target: dict[str, Any] | None = None,
153
+ force_n: float | None = None,
154
+ approach: Literal["top", "side", "front", "auto"] = "auto",
155
+ release_mode: Literal["drop", "place", "hand_to_user"] | None = None,
156
+ release_at: dict[str, Any] | str | None = None,
157
+ arm: str | None = None,
158
+ grasp_type: str | None = None,
159
+ target_motion: str | None = None,
160
+ ) -> ManipulationResult:
161
+ return ManipulationResult(success=False, reason=self._reason("arm"))
162
+
163
+ def send_docking_goal(self, *, station: str, service: str, until: str | None = None) -> NavigationResult:
164
+ return NavigationResult(success=False, reason=self._reason("docking station"))
165
+
166
+ def query_detection(
167
+ self,
168
+ *,
169
+ object_class: str,
170
+ attributes: dict[str, Any] | None = None,
171
+ where_near: str | None = None,
172
+ where_within: float | None = None,
173
+ ) -> DetectionResult:
174
+ return DetectionResult(success=False, reason=self._reason("onboard object detection"))
175
+
176
+ def run_scan(
177
+ self,
178
+ *,
179
+ area: dict[str, Any],
180
+ pattern: Literal["serpentine", "spiral", "grid", "adaptive"],
181
+ overlap: float,
182
+ altitude: float | None,
183
+ media: Literal["photo", "video", "sensor_only"],
184
+ sensor: str | None,
185
+ ) -> ScanResult:
186
+ return ScanResult(success=False, reason=self._reason("area-scan payload"))
187
+
188
+ def capture_media(
189
+ self,
190
+ *,
191
+ media: Literal["photo", "video"],
192
+ target: str | None,
193
+ duration_seconds: float | None,
194
+ attributes: dict[str, Any] | None,
195
+ camera: str | None = None,
196
+ ) -> CaptureResult:
197
+ return CaptureResult(success=False, reason=self._reason("capture payload"))
198
+
199
+ def emit_speech(
200
+ self,
201
+ *,
202
+ utterance: str,
203
+ locale: str | None,
204
+ style: Literal["notice", "warning", "conversational"],
205
+ interrupt: bool,
206
+ ) -> SubstrateResult:
207
+ return SubstrateResult(success=False, reason=self._reason("speaker"))
208
+
209
+ def acquire_speech(
210
+ self,
211
+ *,
212
+ prompt: str | None,
213
+ locale: str | None,
214
+ timeout_seconds: float | None,
215
+ expected: Literal["free_form", "confirmation", "choice"],
216
+ choices: list[str] | None,
217
+ ) -> ListenResult:
218
+ return ListenResult(success=False, reason=self._reason("microphone"))
219
+
220
+ def send_takeoff_goal(self, *, altitude: float, climb_rate: float | None = None) -> NavigationResult:
221
+ return NavigationResult(success=False, reason=self._reason("flight capability"))
222
+
223
+ def send_land_goal(
224
+ self,
225
+ *,
226
+ at: str | None = None,
227
+ precision: Literal["standard", "precise"] = "standard",
228
+ ) -> NavigationResult:
229
+ return NavigationResult(success=False, reason=self._reason("flight capability"))
230
+
231
+ def send_return_to_home_goal(
232
+ self,
233
+ *,
234
+ speed: float | None = None,
235
+ altitude: float | None = None,
236
+ ) -> NavigationResult:
237
+ return NavigationResult(success=False, reason=self._reason("flight capability"))
238
+
239
+ def call_named_program(
240
+ self,
241
+ *,
242
+ name: str,
243
+ args: dict[str, Any] | None = None,
244
+ ) -> ProgramCallResult:
245
+ """``call_program``: this substrate exposes no named programs (RFC-0015)."""
246
+ return unsupported_program_call('mobile')
247
+
248
+
249
+ class HuskyAdapter(ClearpathAdapter):
250
+ """Clearpath Husky (UGV) via ROS 2 + Nav2. US/Canada-made, compliant."""
251
+
252
+ BRAND = "husky"
253
+
254
+
255
+ class JackalAdapter(ClearpathAdapter):
256
+ """Clearpath Jackal (small UGV) via ROS 2 + Nav2. US/Canada-made, compliant."""
257
+
258
+ BRAND = "jackal"
259
+
260
+
261
+ MOBILE_ADAPTERS: dict[str, type[ClearpathAdapter]] = {
262
+ "husky": HuskyAdapter,
263
+ "jackal": JackalAdapter,
264
+ }
File without changes
@@ -0,0 +1,87 @@
1
+ """Hermetic unit tests for the Clearpath AMR adapters — no ROS 2 needed.
2
+
3
+ A recording fake inner adapter is injected via ``inner_factory`` (the
4
+ same technique the industrial-arm / ANYmal / Digit suites use), so the
5
+ delegation and not-supported paths are exercised without rclpy.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from typing import Any
11
+
12
+ import pytest
13
+ from urml_ros2_runtime.substrate.base import (
14
+ ManipulationResult,
15
+ NavigationResult,
16
+ ROSAdapter,
17
+ SubstrateResult,
18
+ )
19
+
20
+ from urml_mobile_runtime import ClearpathAdapter, HuskyAdapter, JackalAdapter, MOBILE_ADAPTERS
21
+
22
+ BRAND_CLASSES = [HuskyAdapter, JackalAdapter]
23
+ BRAND_IDS = [c.BRAND for c in BRAND_CLASSES]
24
+
25
+
26
+ class _RecordingInner:
27
+ def __init__(self) -> None:
28
+ self.calls: list[str] = []
29
+ self.closed = False
30
+
31
+ def send_navigation_goal(self, **kw: Any) -> NavigationResult:
32
+ self.calls.append("send_navigation_goal")
33
+ return NavigationResult(success=True, frame="map")
34
+
35
+ def take_measurement(self, **kw: Any) -> SubstrateResult:
36
+ self.calls.append("take_measurement")
37
+ return SubstrateResult(success=True)
38
+
39
+ def wait_for_condition(self, **kw: Any) -> SubstrateResult:
40
+ self.calls.append("wait_for_condition")
41
+ return SubstrateResult(success=True)
42
+
43
+ def wait_passively(self, **kw: Any) -> SubstrateResult:
44
+ self.calls.append("wait_passively")
45
+ return SubstrateResult(success=True)
46
+
47
+ def emit_report(self, **kw: Any) -> SubstrateResult:
48
+ self.calls.append("emit_report")
49
+ return SubstrateResult(success=True)
50
+
51
+ def close(self) -> None:
52
+ self.closed = True
53
+
54
+
55
+ def test_registry() -> None:
56
+ assert MOBILE_ADAPTERS == {"husky": HuskyAdapter, "jackal": JackalAdapter}
57
+ assert issubclass(HuskyAdapter, ClearpathAdapter)
58
+
59
+
60
+ @pytest.mark.parametrize("cls", BRAND_CLASSES, ids=BRAND_IDS)
61
+ def test_delegates_and_rejects(cls: type[ClearpathAdapter]) -> None:
62
+ inner = _RecordingInner()
63
+ with cls(inner_factory=lambda: inner) as amr:
64
+ assert isinstance(amr, ROSAdapter)
65
+ assert amr.BRAND == cls.BRAND
66
+ assert amr.send_navigation_goal(location="dock_a").success
67
+ assert amr.wait_passively(duration_seconds=0.1).success
68
+ assert amr.take_measurement(what="odom", target=None, sensor=None).success
69
+ assert amr.emit_report(
70
+ to="fleet", facts={}, attachments=None, status="success", severity="info"
71
+ ).success
72
+ bad: ManipulationResult = amr.send_manipulation_goal(action="grasp")
73
+ assert bad.success is False
74
+ assert bad.reason is not None and bad.reason.startswith(f"not_supported_on_amr[{cls.BRAND}]")
75
+ assert amr.send_takeoff_goal(altitude=1.0).success is False
76
+ assert amr.send_docking_goal(station="d", service="charge").success is False
77
+ assert inner.calls == ["send_navigation_goal", "wait_passively", "take_measurement", "emit_report"]
78
+ assert inner.closed is True
79
+
80
+
81
+ def test_conformance_runner_accepts_factory() -> None:
82
+ from urml_conformance import ConformanceRunner
83
+
84
+ runner = ConformanceRunner(
85
+ adapter_factory=lambda: HuskyAdapter(inner_factory=lambda: _RecordingInner())
86
+ )
87
+ assert runner is not None