Metadata-Version: 2.5
Name: urml-embedded-runtime
Version: 0.5.2
Summary: Educational-MCU reference runtime for URML — micro:bit / Arduino-class over serial, zero ROS.
Project-URL: Homepage, https://github.com/urml-dev/URML
Project-URL: Repository, https://github.com/urml-dev/URML
Project-URL: Issues, https://github.com/urml-dev/URML/issues
Author: URML Maintainers
License: BUSL-1.1
Keywords: arduino,education,firmata,microbit,robotics,runtime,serial,urml
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Education
Requires-Python: >=3.11
Requires-Dist: pydantic<3,>=2.6
Requires-Dist: pyyaml<7,>=6.0
Requires-Dist: urml-ros2-runtime>=0.5.2
Requires-Dist: urml-validator>=0.5.2
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-cov>=5; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Provides-Extra: firmata
Requires-Dist: pyfirmata2>=2.4; extra == 'firmata'
Provides-Extra: serial
Requires-Dist: pyserial<4,>=3.5; extra == 'serial'
Description-Content-Type: text/markdown

<p align="center">
  <a href="https://urml.dev"><img src="https://urml.dev/favicon.svg" alt="URML" width="72" height="72"></a>
</p>

<p align="center">
  A small, opinionated, human-readable language for describing robot intent.
</p>

<p align="center">
  <a href="https://urml.dev"><b>urml.dev</b></a>
</p>

---

# urml-embedded-runtime

**Educational-MCU reference runtime for URML** — `EmbeddedAdapter` for **micro:bit / Arduino-class** buggies over a plain serial line, **zero ROS**.

URML scales *down* to a microcontroller: a buggy whose firmware reads short ASCII commands off serial. The educational-flywheel analog of the PX4/marine no-ROS proof (RFC-0011 educational profile), mirroring `BlueRovAdapter`: lazy `pyserial`, cached lazy port, failures returned not raised. Built against the frozen Protocol per [RFC-0014](../../docs/rfcs/0014-substrate-conformance.md).

## Method coverage

| URML primitive | v0.1 |
|---|---|
| `move_to` / `hover` | write the configured firmware command |
| `grasp` / `release` | write the configured gripper-servo command |
| `wait` | hold (success) |
| `measure` / `wait_for` | query + read one serial line |
| `report` | structured record to a local sink (no cloud) |
| `scan` | documented not-supported result: no area-scan controller (a scan is waypoints plus a capture at each one) |

`dock`, `detect`, `capture`, `speak`, `listen` return `not_supported_on_mcu`. The drone trio returns `not_applicable_mcu`.

## Spec gaps (RFC-0014 protocol)

A *mobile* buggy fits the v0.1 schema honestly (it really is `differential`). A non-mobile LED/sensor MCU node does not — filed as **RFC-0018 (Draft)**: a minimal-MCU manifest subset, explicitly cross-referencing **RFC-0017** for the raw-actuation verb (not duplicated). See [`SPEC-GAPS.md`](SPEC-GAPS.md). `educational` validates with no schema change (`program.profile` is an open `Identifier`).

## Install / use

```bash
pip install -e reference/embedded-runtime[serial]   # installs pyserial
```

```python
from urml_embedded_runtime import EmbeddedAdapter, EmbeddedConfig
cfg = EmbeddedConfig(port="/dev/ttyACM0",
                     location_to_command={"waypoint_a": "GO A", "dock": "HOME"})
with EmbeddedAdapter(cfg) as buggy:
    assert buggy.send_navigation_goal(location="waypoint_a").success
```

## Status

**v0.1 (this release):**
- `EmbeddedAdapter` + `EmbeddedConfig` (pyserial, no ROS). `microbit_edu` manifest + `conformance/fixtures/educational/01_buggy_patrol_positive.yaml` verified through the runner (hermetic against `MockROSAdapter`; adapter-agnostic against `EmbeddedAdapter`). First fixture under the new `educational` profile dir.
- Hermetic unit tests: nav (configured + unmapped), grasp, measure, scan (not supported), lifecycle, the not-supported / not-applicable sentinels, the missing-`[serial]`-extra error, the conformance hook; no pyserial install required.
- Gated `.github/workflows/embedded-integration.yml`: `embedded-smoke` (real pyserial loopback), `embedded-arm64-build` (Jetson-class QEMU), `embedded-board-e2e` placeholder against a real micro:bit/Arduino (opt-in via the `run_placeholder` dispatch input; first run is a calibration run by design).

**Follow-ups (not yet):** RFC-0018 outcome (minimal-MCU subset); a `pyfirmata2` path for stock Firmata sketches.

## Core Commitment

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. `pyserial`/`pyfirmata2` are optional extras imported lazily, never at module load.

## Related documents

- [`/reference/marine-runtime/`](../marine-runtime/) — the zero-ROS sibling whose structure this mirrors.
- [`/spec/profiles/educational/`](../../spec/profiles/educational/) — the RFC-0011 profile this serves.
- [`/docs/rfcs/0018-minimal-mcu-capability-subset.md`](../../docs/rfcs/0018-minimal-mcu-capability-subset.md) — the surfaced spec gap.
