urml-mobile-runtime 0.5.0__py3-none-any.whl

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,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,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,7 @@
1
+ urml_mobile_runtime/__init__.py,sha256=OFsXHrlXPRkgR5gsKSMChjzR1vK551jatvgJlOXzFtU,1061
2
+ urml_mobile_runtime/_version.py,sha256=GhEpeFCtTCp-bVev1I9B_MSg50q8bPayhz1y1kQbgBU,66
3
+ urml_mobile_runtime/adapter.py,sha256=t1fuH4KpUYjyNXSyfSFqna_s--JU-Fw_BOdl4ss3Swk,9263
4
+ urml_mobile_runtime/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ urml_mobile_runtime-0.5.0.dist-info/METADATA,sha256=urjAuCeaL067q5Lj1SEHH-icmIKso4yEXF2cXUi5Ft8,5020
6
+ urml_mobile_runtime-0.5.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
7
+ urml_mobile_runtime-0.5.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any