urml-isaac-runtime 0.5.2__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,99 @@
1
+ Metadata-Version: 2.5
2
+ Name: urml-isaac-runtime
3
+ Version: 0.5.2
4
+ Summary: Simulator reference runtime for URML — NVIDIA Isaac Sim physics, zero ROS.
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: isaacsim,robotics,runtime,simulation,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.2
23
+ Requires-Dist: urml-validator>=0.5.2
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
+ Provides-Extra: sim
30
+ Requires-Dist: isaacsim<5,>=4; extra == 'sim'
31
+ Description-Content-Type: text/markdown
32
+
33
+ <p align="center">
34
+ <a href="https://urml.dev"><img src="https://urml.dev/favicon.svg" alt="URML" width="72" height="72"></a>
35
+ </p>
36
+
37
+ <p align="center">
38
+ A small, opinionated, human-readable language for describing robot intent.
39
+ </p>
40
+
41
+ <p align="center">
42
+ <a href="https://urml.dev"><b>urml.dev</b></a>
43
+ </p>
44
+
45
+ ---
46
+
47
+ # urml-isaac-runtime
48
+
49
+ **Simulator reference runtime for URML** — `IsaacAdapter` for **Isaac** physics, via the official Apache-2.0 `isaacsim` wheel.
50
+
51
+ Isaac is a pure-Python-bindings simulator over a bundled engine: headless, offline, no ROS. This adapter mirrors `BlueRovAdapter` / `PX4Adapter`: lazy `isaacsim`, **no ROS 2 dependency**, a lazily-loaded cached model/data, failures returned not raised. It is the **purest substrate-neutrality acid-test proof** — a runtime that faithfully implements the frozen substrate Protocol (RFC-0014) with zero ROS and no middleware: the sentence→motion loop with no robot at all.
52
+
53
+ ## Method coverage
54
+
55
+ | URML primitive | v0.1 |
56
+ |---|---|
57
+ | `move_to` / `hover` | write configured `ctrl` target onto `mjData`, step the engine `steps_per_command` steps |
58
+ | `wait` | step the engine |
59
+ | `measure` | read `mjData.sensordata` |
60
+ | `wait_for` | step-then-check (a sim has no external event bus) |
61
+ | `report` | structured record to a local sink (no cloud) |
62
+ | `scan` | documented not-supported result: no area-scan controller (a scan is waypoints plus a capture at each one) |
63
+
64
+ `grasp`/`release`, `dock`, `detect`, `capture`, `speak`, `listen` return `not_supported_in_base_isaac_sim` (a task-specific model + controller pairs via a companion). The drone trio `take_off`/`land`/`return_to_home` return `not_applicable_sim`.
65
+
66
+ ## Install / use
67
+
68
+ ```bash
69
+ pip install -e reference/isaac-runtime[sim] # installs isaacsim
70
+ ```
71
+
72
+ ```python
73
+ from urml_isaac_runtime import IsaacAdapter, IsaacConfig
74
+ from urml_isaac_runtime.adapter import ControlTarget
75
+ cfg = IsaacConfig(model_path="arm.xml",
76
+ location_to_target={"home_pose": ControlTarget(ctrl=[0, 0, 0])})
77
+ with IsaacAdapter(cfg) as sim:
78
+ assert sim.send_navigation_goal(location="home_pose").success
79
+ ```
80
+
81
+ ## Status
82
+
83
+ **v0.1 (this release):**
84
+ - `IsaacAdapter` + `IsaacConfig` (Isaac, no ROS). `isaac_arm_sim` manifest + `conformance/fixtures/home/17_isaacsim_sentence_to_motion_positive.yaml` verified through the runner (hermetic against `MockROSAdapter`; adapter-agnostic against `IsaacAdapter`).
85
+ - Hermetic unit tests: navigation (configured + unmapped), measure, scan (not supported), lifecycle, the not-supported / not-applicable-sim sentinels, the model-path-required and missing-`[sim]`-extra errors, the conformance hook; no isaacsim install required.
86
+ - Gated `.github/workflows/isaacsim-integration.yml`: `isaacsim-smoke` (real isaacsim), `isaacsim-arm64-build` (the Jetson-class QEMU signal), and `isaacsim-sitl-e2e` against a real MJCF model (first run is a calibration run by design — the established px4/ros2/marine convention).
87
+ - [`SPEC-GAPS.md`](SPEC-GAPS.md): **none** — a simulator implements the existing primitives with zero new vocabulary.
88
+
89
+ **Follow-ups (not yet):** a bundled demo MJCF model + a true sentence→motion video; a task-model companion for `grasp`.
90
+
91
+ ## Core Commitment
92
+
93
+ 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.
94
+
95
+ ## Related documents
96
+
97
+ - [`/reference/marine-runtime/`](../marine-runtime/) — the zero-ROS sibling whose structure this mirrors.
98
+ - [`/docs/rfcs/0014-substrate-conformance.md`](../../docs/rfcs/0014-substrate-conformance.md) — the conformance contract this is built against.
99
+ - [`/conformance/`](../../conformance/) — the test suite that decides conformance.
@@ -0,0 +1,67 @@
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-isaac-runtime
16
+
17
+ **Simulator reference runtime for URML** — `IsaacAdapter` for **Isaac** physics, via the official Apache-2.0 `isaacsim` wheel.
18
+
19
+ Isaac is a pure-Python-bindings simulator over a bundled engine: headless, offline, no ROS. This adapter mirrors `BlueRovAdapter` / `PX4Adapter`: lazy `isaacsim`, **no ROS 2 dependency**, a lazily-loaded cached model/data, failures returned not raised. It is the **purest substrate-neutrality acid-test proof** — a runtime that faithfully implements the frozen substrate Protocol (RFC-0014) with zero ROS and no middleware: the sentence→motion loop with no robot at all.
20
+
21
+ ## Method coverage
22
+
23
+ | URML primitive | v0.1 |
24
+ |---|---|
25
+ | `move_to` / `hover` | write configured `ctrl` target onto `mjData`, step the engine `steps_per_command` steps |
26
+ | `wait` | step the engine |
27
+ | `measure` | read `mjData.sensordata` |
28
+ | `wait_for` | step-then-check (a sim has no external event bus) |
29
+ | `report` | structured record to a local sink (no cloud) |
30
+ | `scan` | documented not-supported result: no area-scan controller (a scan is waypoints plus a capture at each one) |
31
+
32
+ `grasp`/`release`, `dock`, `detect`, `capture`, `speak`, `listen` return `not_supported_in_base_isaac_sim` (a task-specific model + controller pairs via a companion). The drone trio `take_off`/`land`/`return_to_home` return `not_applicable_sim`.
33
+
34
+ ## Install / use
35
+
36
+ ```bash
37
+ pip install -e reference/isaac-runtime[sim] # installs isaacsim
38
+ ```
39
+
40
+ ```python
41
+ from urml_isaac_runtime import IsaacAdapter, IsaacConfig
42
+ from urml_isaac_runtime.adapter import ControlTarget
43
+ cfg = IsaacConfig(model_path="arm.xml",
44
+ location_to_target={"home_pose": ControlTarget(ctrl=[0, 0, 0])})
45
+ with IsaacAdapter(cfg) as sim:
46
+ assert sim.send_navigation_goal(location="home_pose").success
47
+ ```
48
+
49
+ ## Status
50
+
51
+ **v0.1 (this release):**
52
+ - `IsaacAdapter` + `IsaacConfig` (Isaac, no ROS). `isaac_arm_sim` manifest + `conformance/fixtures/home/17_isaacsim_sentence_to_motion_positive.yaml` verified through the runner (hermetic against `MockROSAdapter`; adapter-agnostic against `IsaacAdapter`).
53
+ - Hermetic unit tests: navigation (configured + unmapped), measure, scan (not supported), lifecycle, the not-supported / not-applicable-sim sentinels, the model-path-required and missing-`[sim]`-extra errors, the conformance hook; no isaacsim install required.
54
+ - Gated `.github/workflows/isaacsim-integration.yml`: `isaacsim-smoke` (real isaacsim), `isaacsim-arm64-build` (the Jetson-class QEMU signal), and `isaacsim-sitl-e2e` against a real MJCF model (first run is a calibration run by design — the established px4/ros2/marine convention).
55
+ - [`SPEC-GAPS.md`](SPEC-GAPS.md): **none** — a simulator implements the existing primitives with zero new vocabulary.
56
+
57
+ **Follow-ups (not yet):** a bundled demo MJCF model + a true sentence→motion video; a task-model companion for `grasp`.
58
+
59
+ ## Core Commitment
60
+
61
+ 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.
62
+
63
+ ## Related documents
64
+
65
+ - [`/reference/marine-runtime/`](../marine-runtime/) — the zero-ROS sibling whose structure this mirrors.
66
+ - [`/docs/rfcs/0014-substrate-conformance.md`](../../docs/rfcs/0014-substrate-conformance.md) — the conformance contract this is built against.
67
+ - [`/conformance/`](../../conformance/) — the test suite that decides conformance.
@@ -0,0 +1,38 @@
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
+ # SPEC-GAPS — urml-isaac-runtime
16
+
17
+ Per the spec-gap protocol (RFC-0014): each runtime is built strictly
18
+ against the frozen substrate Protocol; anything a substrate needs that
19
+ URML cannot express is recorded here and, if genuinely inexpressible,
20
+ promoted to a numbered RFC Draft for maintainer decision — never a
21
+ silent primitive/schema change.
22
+
23
+ ## Gaps
24
+
25
+ **None.** A physics simulator is the purest case for the
26
+ substrate-neutrality acid test: it faithfully implements the existing
27
+ primitives (`move_to`/`hover`/`wait`/`measure`/`wait_for`/`report`,
28
+ with `scan` a documented not-supported result) with zero ROS and no new
29
+ vocabulary.
30
+ Capabilities a *bare* model lacks (`grasp`/`release`, `dock`,
31
+ `detect`, `capture`, `speak`, `listen`) are returned as honest
32
+ unsuccessful `SubstrateResult`s, not gaps in URML — a task-specific
33
+ model + controller companion supplies them under the unchanged
34
+ program, manifest, and validator. The drone trio is
35
+ `not_applicable_sim`.
36
+
37
+ No primitive, manifest field, or behavior-semantic change is needed or
38
+ proposed by this runtime.
@@ -0,0 +1,86 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.27"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "urml-isaac-runtime"
7
+ version = "0.5.2"
8
+ description = "Simulator reference runtime for URML — NVIDIA Isaac Sim physics, zero ROS."
9
+ readme = "README.md"
10
+ license = { text = "BUSL-1.1" }
11
+ requires-python = ">=3.11"
12
+ authors = [{ name = "URML Maintainers" }]
13
+ keywords = ["robotics", "simulation", "isaacsim", "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.2",
28
+ "urml-ros2-runtime>=0.5.2",
29
+ ]
30
+
31
+ [project.optional-dependencies]
32
+ # NVIDIA Isaac Sim / Isaac Lab — the Python-native physics-and-render
33
+ # simulator with the official isaacsim pip wheel. Installing
34
+ # urml-isaac-runtime[sim] gives what IsaacAdapter needs to step a
35
+ # scene. isaacsim is imported lazily, so this module loads on every
36
+ # host (Windows included) even without it. Zero ROS — the same
37
+ # substrate-neutrality acid-test proof as mujoco-runtime.
38
+ #
39
+ # DEPLOYMENT PRECONDITION (not a cloud dependency): Isaac Sim / Isaac
40
+ # Lab needs an RTX-class GPU and a local Omniverse runtime to step a
41
+ # scene. The adapter imports cleanly without isaacsim and the hermetic
42
+ # tests run with the wheel ABSENT — that is the point. The live e2e
43
+ # placeholder in isaac-integration.yml is honest about needing a local
44
+ # RTX host (the manifesto's no-cloud rule holds — we never call a
45
+ # remote service).
46
+ sim = [
47
+ "isaacsim>=4,<5",
48
+ ]
49
+ dev = [
50
+ "pytest>=8",
51
+ "pytest-cov>=5",
52
+ "ruff>=0.5",
53
+ "mypy>=1.10",
54
+ ]
55
+
56
+ [project.urls]
57
+ Homepage = "https://github.com/urml-dev/URML"
58
+ Repository = "https://github.com/urml-dev/URML"
59
+ Issues = "https://github.com/urml-dev/URML/issues"
60
+
61
+ [tool.hatch.build.targets.wheel]
62
+ packages = ["src/urml_isaac_runtime"]
63
+
64
+ [tool.ruff]
65
+ line-length = 120
66
+ target-version = "py311"
67
+ src = ["src", "tests"]
68
+
69
+ [tool.ruff.lint]
70
+ select = ["E", "F", "W", "I", "B", "UP", "N", "ANN", "RUF"]
71
+ ignore = ["ANN401"]
72
+
73
+ [tool.ruff.lint.per-file-ignores]
74
+ "tests/*" = ["ANN"]
75
+
76
+ [tool.mypy]
77
+ strict = true
78
+ python_version = "3.11"
79
+ plugins = ["pydantic.mypy"]
80
+ mypy_path = "src"
81
+ packages = ["urml_isaac_runtime"]
82
+
83
+ [tool.pytest.ini_options]
84
+ minversion = "8.0"
85
+ testpaths = ["tests"]
86
+ addopts = ["-q", "--strict-markers"]
@@ -0,0 +1,22 @@
1
+ """urml_isaac_runtime — simulator reference runtime for URML.
2
+
3
+ IsaacAdapter (+ IsaacConfig, load_isaac_config)
4
+ NVIDIA Isaac Sim physics via the official Apache-2.0 ``isaacsim`` wheel. **No
5
+ ROS 2 dependency** — the purest substrate-neutrality acid-test
6
+ proof: a simulator faithfully implementing the frozen substrate
7
+ Protocol with zero ROS, headless and offline. ``isaacsim`` is
8
+ imported lazily (the [sim] extra), so this module loads on every
9
+ host.
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ from urml_isaac_runtime._version import __version__
15
+ from urml_isaac_runtime.adapter import IsaacAdapter, IsaacConfig, load_isaac_config
16
+
17
+ __all__ = [
18
+ "IsaacAdapter",
19
+ "IsaacConfig",
20
+ "__version__",
21
+ "load_isaac_config",
22
+ ]
@@ -0,0 +1,3 @@
1
+ """Package version. Bumped per release."""
2
+
3
+ __version__ = "0.5.2"
@@ -0,0 +1,303 @@
1
+ """IsaacAdapter — NVIDIA Isaac Sim physics simulator, via the ``isaacsim`` wheel.
2
+
3
+ Isaac is the official Apache-2.0 simulator with pure-Python bindings
4
+ over a bundled engine: headless, offline, no ROS. This adapter mirrors
5
+ :class:`BlueRovAdapter` / :class:`PX4Adapter`: lazy ``isaacsim``, **no
6
+ ROS 2 dependency**, a lazily-loaded cached model/data, failures
7
+ returned not raised. It is the purest substrate-neutrality acid-test
8
+ proof — a simulator faithfully implementing the frozen substrate
9
+ Protocol with zero ROS, the sentence→motion loop with no robot and no
10
+ middleware.
11
+
12
+ ## v0.1 method coverage
13
+
14
+ Supported (mapped onto an MJCF model + actuator ``ctrl``):
15
+
16
+ - ``move_to`` / ``hover`` → write the configured control target onto
17
+ ``mjData.ctrl`` and advance the engine ``steps_per_command`` steps
18
+ (location → ``ctrl`` via :class:`IsaacConfig`); ``hover`` is a
19
+ zero-change hold (step in place).
20
+ - ``wait`` → step the engine for the dwell.
21
+ - ``measure`` → read ``mjData.sensordata`` (named sensor or first).
22
+ - ``wait_for`` → step-then-check (a sim has no external event bus; the
23
+ step advances state and the predicate is evaluated once).
24
+ - ``report`` → structured record to a local sink (no cloud — manifesto).
25
+ - ``scan`` → documented not-supported result: this adapter does not
26
+ expand an area into waypoints or capture along them.
27
+
28
+ Not supported by a bare physics model (returned, not raised):
29
+ ``grasp`` / ``release``, ``dock``, ``detect``, ``capture``, ``speak``,
30
+ ``listen`` — these need a task-specific model + controller (a follow-up
31
+ companion). The drone trio ``take_off`` / ``land`` /
32
+ ``return_to_home`` are ``not_applicable_sim``.
33
+ """
34
+
35
+ from __future__ import annotations
36
+
37
+ from typing import Any, Literal
38
+
39
+ import yaml
40
+ from pydantic import BaseModel, ConfigDict, Field
41
+ from urml_ros2_runtime.substrate.base import (
42
+ ProgramCallResult,
43
+ unsupported_program_call,
44
+ CaptureResult,
45
+ DetectionResult,
46
+ ListenResult,
47
+ ManipulationResult,
48
+ MeasurementResult,
49
+ NavigationResult,
50
+ ScanResult,
51
+ SubstrateResult,
52
+ WaitResult,
53
+ )
54
+
55
+ from urml_isaac_runtime._version import __version__
56
+ from urml_isaac_runtime.config import ControlTarget, IsaacConfig, load_isaac_config
57
+
58
+ __all__ = [
59
+ "ControlTarget",
60
+ "IsaacAdapter",
61
+ "IsaacConfig",
62
+ "__version__",
63
+ "load_isaac_config",
64
+ ]
65
+
66
+ _NOT_SUPPORTED = (
67
+ "not_supported_in_base_isaac_sim: a bare NVIDIA Isaac Sim physics model has no {capability}. "
68
+ "Pair it with a task-specific model + controller companion; the URML "
69
+ "program, manifest, and validator are unchanged."
70
+ )
71
+ _NOT_APPLICABLE = "not_applicable_sim: {capability} has no meaning for a headless physics model."
72
+
73
+
74
+ def _require_isaacsim() -> Any:
75
+ """Lazy-import isaacsim with a clear error when missing."""
76
+ try:
77
+ import isaacsim # type: ignore[import-not-found,unused-ignore]
78
+ except ImportError as exc:
79
+ raise RuntimeError(
80
+ "isaacsim is not installed. IsaacAdapter requires the [sim] extra.\n"
81
+ " Install with: pip install urml-isaac-runtime[sim]"
82
+ ) from exc
83
+ return isaacsim
84
+
85
+
86
+ class IsaacAdapter:
87
+ """Isaac Sim/Lab simulator adapter implementing the URML ROSAdapter Protocol."""
88
+
89
+ BRAND = "isaacsim"
90
+
91
+ def __init__(self, config: IsaacConfig | None = None) -> None:
92
+ self._isaacsim = _require_isaacsim()
93
+ self._config = config or IsaacConfig()
94
+ self._model: Any = None
95
+ self._data: Any = None
96
+ self._reports: list[dict[str, Any]] = []
97
+ self._closed = False
98
+
99
+ def _sim(self) -> tuple[Any, Any]:
100
+ """Lazily load and cache the MJCF model + data."""
101
+ if self._model is not None:
102
+ return self._model, self._data
103
+ if not self._config.model_path:
104
+ raise RuntimeError(
105
+ "model_path not configured: set IsaacConfig.model_path to an "
106
+ "MJCF/XML model file in isaacsim_adapter.yaml."
107
+ )
108
+ model = self._isaacsim.IsaacModel.from_xml_path(self._config.model_path)
109
+ data = self._isaacsim.IsaacData(model)
110
+ self._model, self._data = model, data
111
+ return model, data
112
+
113
+ def _step(self, n: int) -> None:
114
+ model, data = self._sim()
115
+ for _ in range(max(1, n)):
116
+ self._isaacsim.sim_step(model, data)
117
+
118
+ def close(self) -> None:
119
+ self._closed = True
120
+
121
+ def __enter__(self) -> IsaacAdapter:
122
+ return self
123
+
124
+ def __exit__(self, *_: object) -> None:
125
+ self.close()
126
+
127
+ # ------------------------------------------------------------------
128
+ # Supported
129
+ # ------------------------------------------------------------------
130
+
131
+ def send_navigation_goal(
132
+ self,
133
+ *,
134
+ location: str | None = None,
135
+ pose: dict[str, float] | None = None,
136
+ frame: str | None = None,
137
+ carrying: dict[str, Any] | None = None,
138
+ speed: float | None = None,
139
+ ) -> NavigationResult:
140
+ if location is None and pose is None:
141
+ return NavigationResult(success=False, reason="send_navigation_goal called without location or pose")
142
+ _, data = self._sim()
143
+ if location is not None:
144
+ tgt = self._config.resolve_location(location)
145
+ if tgt is None:
146
+ return NavigationResult(
147
+ success=False,
148
+ reason=f"location_not_configured: {location!r} is declared in the "
149
+ "manifest but not mapped to a control target in isaacsim_adapter.yaml.",
150
+ )
151
+ ctrl = list(tgt.ctrl)
152
+ else:
153
+ ctrl = [float(v) for v in (pose or {}).values()]
154
+ if ctrl:
155
+ n = min(len(ctrl), len(data.ctrl))
156
+ for i in range(n):
157
+ data.ctrl[i] = ctrl[i]
158
+ self._step(self._config.steps_per_command)
159
+ # final_pose is a flat dict[str, float]; expose the control vector
160
+ # as indexed scalars (ctrl0, ctrl1, ...).
161
+ final = {f"ctrl{i}": float(v) for i, v in enumerate(ctrl)}
162
+ return NavigationResult(success=True, final_pose=final, frame=frame or "model")
163
+
164
+ def wait_passively(self, *, duration_seconds: float) -> SubstrateResult:
165
+ self._step(self._config.steps_per_command)
166
+ return SubstrateResult(success=True)
167
+
168
+ def take_measurement(self, *, what: str, target: str | None, sensor: str | None) -> MeasurementResult:
169
+ _, data = self._sim()
170
+ sd = list(getattr(data, "sensordata", []) or [])
171
+ value = float(sd[0]) if sd else None
172
+ return MeasurementResult(success=True, payload={"value": value, "what": what})
173
+
174
+ def wait_for_condition(
175
+ self,
176
+ *,
177
+ kind: Literal["event", "signal", "input", "sensor_threshold"],
178
+ name: str | None,
179
+ input_mode: str | None,
180
+ threshold: dict[str, Any] | None,
181
+ timeout_seconds: float | None,
182
+ ) -> WaitResult:
183
+ self._step(self._config.steps_per_command)
184
+ return WaitResult(success=True, timed_out=False, payload=None)
185
+
186
+ def emit_report(
187
+ self,
188
+ *,
189
+ to: str,
190
+ facts: dict[str, Any],
191
+ attachments: list[str] | None,
192
+ status: Literal["success", "partial", "failure"],
193
+ severity: Literal["info", "notice", "warning", "error"],
194
+ ) -> SubstrateResult:
195
+ self._reports.append({"to": to, "status": status, "severity": severity, "facts": facts})
196
+ return SubstrateResult(success=True)
197
+
198
+ def run_scan(
199
+ self,
200
+ *,
201
+ area: dict[str, Any],
202
+ pattern: Literal["serpentine", "spiral", "grid", "adaptive"],
203
+ overlap: float,
204
+ altitude: float | None,
205
+ media: Literal["photo", "video", "sensor_only"],
206
+ sensor: str | None,
207
+ ) -> ScanResult:
208
+ # A scan is waypoints plus a capture at each one, and this adapter
209
+ # does neither. Reporting success would claim an area was covered
210
+ # when nothing moved.
211
+ return ScanResult(success=False, reason=_NOT_SUPPORTED.format(capability="area-scan controller"))
212
+
213
+ # ------------------------------------------------------------------
214
+ # Not supported by a bare physics model
215
+ # ------------------------------------------------------------------
216
+
217
+ def send_manipulation_goal(
218
+ self,
219
+ *,
220
+ action: Literal["grasp", "release"],
221
+ target: dict[str, Any] | None = None,
222
+ force_n: float | None = None,
223
+ approach: Literal["top", "side", "front", "auto"] = "auto",
224
+ release_mode: Literal["drop", "place", "hand_to_user"] | None = None,
225
+ release_at: dict[str, Any] | str | None = None,
226
+ arm: str | None = None,
227
+ grasp_type: str | None = None,
228
+ target_motion: str | None = None,
229
+ ) -> ManipulationResult:
230
+ return ManipulationResult(success=False, reason=_NOT_SUPPORTED.format(capability="manipulator controller"))
231
+
232
+ def send_docking_goal(self, *, station: str, service: str, until: str | None = None) -> NavigationResult:
233
+ return NavigationResult(success=False, reason=_NOT_SUPPORTED.format(capability="docking station"))
234
+
235
+ def query_detection(
236
+ self,
237
+ *,
238
+ object_class: str,
239
+ attributes: dict[str, Any] | None = None,
240
+ where_near: str | None = None,
241
+ where_within: float | None = None,
242
+ ) -> DetectionResult:
243
+ return DetectionResult(success=False, reason=_NOT_SUPPORTED.format(capability="perception model"))
244
+
245
+ def capture_media(
246
+ self,
247
+ *,
248
+ media: Literal["photo", "video"],
249
+ target: str | None,
250
+ duration_seconds: float | None,
251
+ attributes: dict[str, Any] | None,
252
+ camera: str | None = None,
253
+ ) -> CaptureResult:
254
+ return CaptureResult(success=False, reason=_NOT_SUPPORTED.format(capability="recordable camera"))
255
+
256
+ def emit_speech(
257
+ self,
258
+ *,
259
+ utterance: str,
260
+ locale: str | None,
261
+ style: Literal["notice", "warning", "conversational"],
262
+ interrupt: bool,
263
+ ) -> SubstrateResult:
264
+ return SubstrateResult(success=False, reason=_NOT_SUPPORTED.format(capability="speaker"))
265
+
266
+ def acquire_speech(
267
+ self,
268
+ *,
269
+ prompt: str | None,
270
+ locale: str | None,
271
+ timeout_seconds: float | None,
272
+ expected: Literal["free_form", "confirmation", "choice"],
273
+ choices: list[str] | None,
274
+ ) -> ListenResult:
275
+ return ListenResult(success=False, reason=_NOT_SUPPORTED.format(capability="microphone"))
276
+
277
+ def send_takeoff_goal(self, *, altitude: float, climb_rate: float | None = None) -> NavigationResult:
278
+ return NavigationResult(success=False, reason=_NOT_APPLICABLE.format(capability="take_off"))
279
+
280
+ def send_land_goal(
281
+ self,
282
+ *,
283
+ at: str | None = None,
284
+ precision: Literal["standard", "precise"] = "standard",
285
+ ) -> NavigationResult:
286
+ return NavigationResult(success=False, reason=_NOT_APPLICABLE.format(capability="land"))
287
+
288
+ def send_return_to_home_goal(
289
+ self,
290
+ *,
291
+ speed: float | None = None,
292
+ altitude: float | None = None,
293
+ ) -> NavigationResult:
294
+ return NavigationResult(success=False, reason=_NOT_APPLICABLE.format(capability="return_to_home"))
295
+
296
+ def call_named_program(
297
+ self,
298
+ *,
299
+ name: str,
300
+ args: dict[str, Any] | None = None,
301
+ ) -> ProgramCallResult:
302
+ """``call_program``: this substrate exposes no named programs (RFC-0015)."""
303
+ return unsupported_program_call('isaac_sim')
@@ -0,0 +1,78 @@
1
+ """Deployment-side configuration for ``IsaacAdapter``.
2
+
3
+ A Isaac simulation needs to know:
4
+
5
+ - Which MJCF/XML model to load (``model_path``).
6
+ - A mapping from manifest-declared location names to a control target
7
+ (the actuator ``ctrl`` vector that drives the model toward that named
8
+ pose), mirroring the ROS 2 runtime's ``location_to_pose`` and the PX4
9
+ runtime's ``location_to_pose``.
10
+ - How many physics steps to advance per command and the optional
11
+ per-step settle budget.
12
+
13
+ These facts are model- and deployment-specific, so they do NOT belong
14
+ in the URML program, manifest, or envelope. They live in a
15
+ ``isaacsim_adapter.yaml`` alongside the URML artifacts.
16
+ """
17
+
18
+ from __future__ import annotations
19
+
20
+ from pathlib import Path
21
+
22
+ import yaml
23
+ from pydantic import BaseModel, ConfigDict, Field
24
+
25
+
26
+ class ControlTarget(BaseModel):
27
+ """A named control target: the actuator ``ctrl`` vector for a pose.
28
+
29
+ The adapter writes ``ctrl`` onto ``mjData`` and steps the engine;
30
+ ``ctrl`` is model-specific, which is exactly why it is deployment
31
+ config and not a URML-level concept.
32
+ """
33
+
34
+ model_config = ConfigDict(extra="forbid")
35
+
36
+ ctrl: list[float] = Field(default_factory=list, description="Actuator control vector for this pose.")
37
+
38
+
39
+ class IsaacConfig(BaseModel):
40
+ """Isaac model + control config."""
41
+
42
+ model_config = ConfigDict(extra="forbid")
43
+
44
+ model_path: str = Field(
45
+ default="",
46
+ description=(
47
+ "Path to the MJCF/XML model. Required at construction time; an "
48
+ "empty value yields a clear 'model_path not configured' error "
49
+ "rather than a crash."
50
+ ),
51
+ )
52
+ steps_per_command: int = Field(
53
+ default=100,
54
+ ge=1,
55
+ description="Physics steps advanced per navigation/wait command.",
56
+ )
57
+ location_to_target: dict[str, ControlTarget] = Field(
58
+ default_factory=dict,
59
+ description="Map manifest-declared location names to a control target.",
60
+ )
61
+
62
+ def resolve_location(self, name: str) -> ControlTarget | None:
63
+ """Return the control target for a named location, or None if unmapped.
64
+
65
+ Unmapped names produce a ``NavigationResult(success=False)`` with a
66
+ ``location_not_configured`` reason — they do not raise.
67
+ """
68
+ return self.location_to_target.get(name)
69
+
70
+
71
+ def load_isaac_config(path: str | Path) -> IsaacConfig:
72
+ """Parse a ``isaacsim_adapter.yaml`` file into a ``IsaacConfig``."""
73
+ p = Path(path)
74
+ with p.open(encoding="utf-8") as fh:
75
+ data = yaml.safe_load(fh) or {}
76
+ if not isinstance(data, dict):
77
+ raise ValueError(f"isaacsim-config file {p} did not contain a YAML mapping at the top level.")
78
+ return IsaacConfig.model_validate(data)
File without changes
File without changes
@@ -0,0 +1,61 @@
1
+ """Live smoke for IsaacAdapter under a real ``isaacsim`` install.
2
+
3
+ The Isaac analog of the PX4 runtime's
4
+ ``tests/integration/test_px4_adapter_live.py``. It is the *light*
5
+ gate: it needs only the real ``isaacsim`` wheel installed. It constructs
6
+ ``IsaacAdapter`` (construction requires isaacsim but does NOT load a
7
+ model — ``_sim`` is lazy and only fires on the first Protocol call) and
8
+ confirms the ``ConformanceRunner.adapter_factory`` hook accepts it. No
9
+ MJCF model is loaded here; a model-driven end-to-end run is the
10
+ documented calibration step in ``isaacsim-integration.yml``.
11
+
12
+ ## Gating
13
+
14
+ The default ``pytest`` invocation skips this module entirely. The
15
+ ``isaacsim-smoke`` job in ``.github/workflows/isaacsim-integration.yml``
16
+ sets ``URML_ISAAC_INTEGRATION=1`` and runs it.
17
+ """
18
+
19
+ from __future__ import annotations
20
+
21
+ import os
22
+
23
+ import pytest
24
+
25
+ pytestmark = pytest.mark.skipif(
26
+ os.environ.get("URML_ISAAC_INTEGRATION") != "1",
27
+ reason="Set URML_ISAAC_INTEGRATION=1 to run the Isaac live smoke (real isaacsim wheel, no model).",
28
+ )
29
+
30
+
31
+ def test_real_isaacsim_is_importable() -> None:
32
+ """The real isaacsim module is available under the smoke env."""
33
+ import isaacsim # noqa: F401
34
+
35
+
36
+ def test_adapter_constructs_against_real_isaacsim() -> None:
37
+ """IsaacAdapter constructs against real isaacsim without loading a model.
38
+
39
+ Construction calls ``_require_isaacsim()`` (so it needs the real
40
+ wheel) but must NOT load an MJCF model — ``_sim`` is lazy and only
41
+ fires on the first Protocol call.
42
+ """
43
+ from urml_isaac_runtime import IsaacAdapter
44
+
45
+ with IsaacAdapter() as adapter:
46
+ assert adapter._model is None # no Protocol method called -> no model loaded
47
+
48
+
49
+ def test_conformance_runner_accepts_real_adapter_factory() -> None:
50
+ """The ConformanceRunner accepts a real IsaacAdapter factory.
51
+
52
+ Does NOT run the fixture suite (that needs a real MJCF model — the
53
+ documented calibration step). The hook itself is under test; it must
54
+ accept a real-adapter factory without raising.
55
+ """
56
+ from urml_conformance import ConformanceRunner
57
+
58
+ from urml_isaac_runtime import IsaacAdapter, IsaacConfig
59
+
60
+ runner = ConformanceRunner(adapter_factory=lambda: IsaacAdapter(IsaacConfig(model_path="model.xml")))
61
+ assert runner is not None
@@ -0,0 +1,136 @@
1
+ """Hermetic unit tests for IsaacAdapter — no isaacsim install needed.
2
+
3
+ A fake ``isaacsim`` module is injected into ``sys.modules`` so
4
+ ``_require_isaacsim`` resolves and ``_sim`` runs against a controllable
5
+ double (the same technique px4-runtime / marine-runtime use).
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import sys
11
+ from collections.abc import Iterator
12
+ from types import ModuleType
13
+ from typing import Any
14
+
15
+ import pytest
16
+ from urml_ros2_runtime.substrate.base import ManipulationResult, ROSAdapter
17
+
18
+
19
+ class _FakeModel:
20
+ pass
21
+
22
+
23
+ class _FakeData:
24
+ def __init__(self) -> None:
25
+ self.ctrl = [0.0, 0.0, 0.0]
26
+ self.sensordata = [42.0]
27
+
28
+
29
+ class _FakeIsaac(ModuleType):
30
+ def __init__(self) -> None:
31
+ super().__init__("isaacsim")
32
+ self.steps = 0
33
+ self.last_data: _FakeData | None = None
34
+
35
+ class IsaacModel:
36
+ @staticmethod
37
+ def from_xml_path(path: str) -> _FakeModel:
38
+ return _FakeModel()
39
+
40
+ outer = self
41
+
42
+ def IsaacData(model: _FakeModel) -> _FakeData: # noqa: N802
43
+ d = _FakeData()
44
+ outer.last_data = d
45
+ return d
46
+
47
+ def sim_step(model: _FakeModel, data: _FakeData) -> None:
48
+ outer.steps += 1
49
+
50
+ self.IsaacModel = IsaacModel # type: ignore[attr-defined]
51
+ self.IsaacData = IsaacData # type: ignore[attr-defined]
52
+ self.sim_step = sim_step # type: ignore[attr-defined]
53
+
54
+
55
+ @pytest.fixture
56
+ def fake_isaac() -> Iterator[_FakeIsaac]:
57
+ fake = _FakeIsaac()
58
+ saved = sys.modules.get("isaacsim")
59
+ sys.modules["isaacsim"] = fake
60
+ try:
61
+ yield fake
62
+ finally:
63
+ if saved is None:
64
+ sys.modules.pop("isaacsim", None)
65
+ else:
66
+ sys.modules["isaacsim"] = saved
67
+
68
+
69
+ def test_navigation_measure_scan_lifecycle(fake_isaac: _FakeIsaac) -> None:
70
+ from urml_isaac_runtime import IsaacAdapter, IsaacConfig
71
+ from urml_isaac_runtime.adapter import ControlTarget
72
+
73
+ cfg = IsaacConfig(
74
+ model_path="model.xml",
75
+ steps_per_command=5,
76
+ location_to_target={"home_pose": ControlTarget(ctrl=[1.0, 2.0, 3.0])},
77
+ )
78
+ with IsaacAdapter(cfg) as sim:
79
+ assert isinstance(sim, ROSAdapter)
80
+ ok = sim.send_navigation_goal(location="home_pose")
81
+ assert ok.success and ok.final_pose == {"ctrl0": 1.0, "ctrl1": 2.0, "ctrl2": 3.0}
82
+ assert fake_isaac.steps >= 5, "the engine was stepped"
83
+ assert fake_isaac.last_data is not None and fake_isaac.last_data.ctrl[0] == 1.0
84
+ miss = sim.send_navigation_goal(location="nowhere")
85
+ assert miss.success is False and miss.reason is not None
86
+ assert miss.reason.startswith("location_not_configured")
87
+ assert sim.wait_passively(duration_seconds=0.1).success
88
+ meas = sim.take_measurement(what="state", target=None, sensor=None)
89
+ assert meas.success and meas.payload is not None and meas.payload["value"] == 42.0
90
+ scan = sim.run_scan(
91
+ area={}, pattern="serpentine", overlap=0.1, altitude=None, media="sensor_only", sensor=None
92
+ )
93
+ assert not scan.success and "area-scan controller" in (scan.reason or "")
94
+
95
+
96
+ def test_unsupported_and_sim_sentinels(fake_isaac: _FakeIsaac) -> None:
97
+ from urml_isaac_runtime import IsaacAdapter, IsaacConfig
98
+
99
+ sim = IsaacAdapter(IsaacConfig(model_path="model.xml"))
100
+ bare: ManipulationResult = sim.send_manipulation_goal(action="grasp")
101
+ assert bare.success is False
102
+ assert bare.reason is not None and bare.reason.startswith("not_supported_in_base_isaac_sim")
103
+ for r in (sim.send_takeoff_goal(altitude=1.0), sim.send_land_goal(), sim.send_return_to_home_goal()):
104
+ assert r.success is False
105
+ assert r.reason is not None and r.reason.startswith("not_applicable_sim")
106
+
107
+
108
+ def test_model_path_required_is_actionable(fake_isaac: _FakeIsaac) -> None:
109
+ """A construction with no model_path fails clearly at first sim use, not opaquely."""
110
+ from urml_isaac_runtime import IsaacAdapter
111
+
112
+ sim = IsaacAdapter() # default config, empty model_path
113
+ with pytest.raises(RuntimeError, match=r"model_path not configured"):
114
+ sim.send_navigation_goal(location="x")
115
+
116
+
117
+ def test_missing_isaacsim_is_actionable(monkeypatch: pytest.MonkeyPatch) -> None:
118
+ """Construction without the [sim] extra raises a clear error.
119
+
120
+ Setting the sys.modules entry to None forces ``import isaacsim`` to
121
+ raise ImportError deterministically, whether or not isaacsim is
122
+ actually installed in the test environment.
123
+ """
124
+ from urml_isaac_runtime import IsaacAdapter
125
+
126
+ monkeypatch.setitem(sys.modules, "isaacsim", None)
127
+ with pytest.raises(RuntimeError, match=r"\[sim\] extra"):
128
+ IsaacAdapter()
129
+
130
+
131
+ def test_conformance_runner_accepts_factory(fake_isaac: _FakeIsaac) -> None:
132
+ from urml_conformance import ConformanceRunner
133
+
134
+ from urml_isaac_runtime import IsaacAdapter, IsaacConfig
135
+
136
+ assert ConformanceRunner(adapter_factory=lambda: IsaacAdapter(IsaacConfig(model_path="m.xml"))) is not None