{"id":49511715,"url":"https://github.com/apajon/lifecore_ros2","last_synced_at":"2026-05-01T20:01:26.236Z","repository":{"id":353638767,"uuid":"1199976701","full_name":"apajon/lifecore_ros2","owner":"apajon","description":"lifecore_ros2 is a modular ROS 2 framework designed to structure robotic applications around lifecycle-aware components. It provides a clean separation between nodes and components, enforces strict lifecycle management, and enables scalable, maintainable architectures for complex robotic systems.","archived":false,"fork":false,"pushed_at":"2026-04-24T20:29:50.000Z","size":871,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-24T20:36:26.958Z","etag":null,"topics":["component-based","distributed-systems","lifecycle","middleware","modular-architecture","rclcpp","real-time-systems","robot-framework","robot-software","robotics","ros2","software-architecture"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apajon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":".github/SUPPORT.md","governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-02T22:53:55.000Z","updated_at":"2026-04-24T20:29:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/apajon/lifecore_ros2","commit_stats":null,"previous_names":["apajon/lifecore_ros2"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/apajon/lifecore_ros2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apajon%2Flifecore_ros2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apajon%2Flifecore_ros2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apajon%2Flifecore_ros2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apajon%2Flifecore_ros2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apajon","download_url":"https://codeload.github.com/apajon/lifecore_ros2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apajon%2Flifecore_ros2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32510815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["component-based","distributed-systems","lifecycle","middleware","modular-architecture","rclcpp","real-time-systems","robot-framework","robot-software","robotics","ros2","software-architecture"],"created_at":"2026-05-01T20:01:25.091Z","updated_at":"2026-05-01T20:01:26.216Z","avatar_url":"https://github.com/apajon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lifecore_ros2\n![Logo](docs/_static/Logo_main_light_HD.png#gh-light-mode-only)\n![Logo](docs/_static/Logo_main_dark_HD.png#gh-dark-mode-only)\n\n[![CI](https://github.com/apajon/lifecore_ros2/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/apajon/lifecore_ros2/actions/workflows/ci.yml) [![Docs](https://github.com/apajon/lifecore_ros2/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/apajon/lifecore_ros2/actions/workflows/docs.yml) [![Release](https://github.com/apajon/lifecore_ros2/actions/workflows/release.yml/badge.svg?branch=main)](https://github.com/apajon/lifecore_ros2/actions/workflows/release.yml)\n[![License: Apache 2.0](https://img.shields.io/github/license/apajon/lifecore_ros2)](LICENSE)[![Documentation](https://img.shields.io/badge/docs-github--pages-blue)](https://apajon.github.io/lifecore_ros2/)\n\n\u003c!-- Canonical positioning sentence — keep in sync with pyproject.toml project.description. See CONTRIBUTING.md. --\u003e\nlifecore_ros2 is a minimal lifecycle composition library for ROS 2 Jazzy — no hidden state machine.\n\n![Composed pipeline lifecycle walk-through: configure creates topics, activate streams data, deactivate stops data flow while topics remain (deactivate ≠ cleanup), cleanup releases resources.](docs/_static/composed_pipeline_demo.gif)\n\n*The `examples/composed_pipeline.py` walk-through highlights the key distinction the library makes explicit: **deactivate ≠ cleanup** — `/pipeline/*` topics persist across deactivate and only disappear on cleanup.*\n\n## Why lifecore_ros2 exists\n\n**Audience.** This library is for teams building modular ROS 2 nodes that need reusable lifecycle-aware components, especially in larger robotics stacks, embedded systems, or runtime-orchestrated applications.\n\n**Problem framing.** ROS 2 provides a powerful managed-node lifecycle (`configure → active → deactivate → cleanup`). In practice, using it for anything beyond a trivial node leads to recurring problems:\n\n- lifecycle logic gets scattered across monolithic node classes with no clear ownership\n- ROS resource setup and teardown (publishers, subscriptions, timers) are easy to make inconsistent — resources allocated in the wrong place or released too late\n- runtime gating (\"only process messages when active\") is hand-rolled differently each time, with no shared, tested pattern\n- reusable lifecycle-aware building blocks are awkward in raw `rclpy` because the lifecycle contract is on the node, not on reusable sub-units\n\nlifecore_ros2 solves these four problems with a small, explicit composition layer. It does not replace or extend the ROS 2 lifecycle state machine — it makes the lifecycle contract expressible at the component level.\n\n**Non-goals.** It is not a full application framework, not a plugin system, and not a replacement for native ROS 2 lifecycle semantics.\n\n## Architecture at a glance\n\n```mermaid\nflowchart LR\n    Lifecycle[ROS 2 Lifecycle]\n    Node[LifecycleComponentNode]\n    Components[LifecycleComponent instances]\n    Lifecycle \u003c--\u003e Node\n    Node \u003c--\u003e Components\n    Lifecycle -. drives .-\u003e Components\n```\n\n## What the library provides\n\nA small set of lifecycle-aware building blocks:\n\n| Symbol | Role |\n|---|---|\n| `LifecycleComponentNode` | Lifecycle node that owns and drives registered `LifecycleComponent` instances |\n| `LifecycleComponent` | Base class for a lifecycle-aware managed entity (abstract by convention — override `_on_*` hooks) |\n| `TopicComponent` | Base class for topic-oriented components (pub/sub) |\n| `LifecyclePublisherComponent` | Lifecycle-gated ROS publisher |\n| `LifecycleSubscriberComponent` | Lifecycle-gated ROS subscriber |\n| `LifecycleTimerComponent` | Lifecycle-gated ROS timer |\n| `ServiceComponent` | Base class for service-oriented components (server/client) |\n| `LifecycleServiceServerComponent` | Lifecycle-gated ROS service server |\n| `LifecycleServiceClientComponent` | Lifecycle-gated ROS service client |\n| `when_active` | Decorator that guards any method to the active state |\n| `LifecoreError` and subclasses | Typed exceptions for boundary violations |\n| `lifecore_ros2.testing` | Reusable fakes, fixtures, assertions, and helpers for lifecycle-focused tests |\n\n## Design rules and non-goals\n\nThe framework stays lifecycle-native, keeps ownership in `LifecycleComponentNode`, and treats component hooks as explicit extension points rather than hidden orchestration.\n\nSee [docs/architecture.rst](docs/architecture.rst) for lifecycle design rules, [docs/patterns.rst](docs/patterns.rst) for usage patterns, and [ROADMAP.md](ROADMAP.md) for non-goals and deferred scope.\nSee [Examples Repository Plan](docs/planning/examples_repo.rst) for the companion repository planning.\nSee [CHANGELOG.md](CHANGELOG.md) for shipped changes or the [GitHub Releases](https://github.com/apajon/lifecore_ros2/releases) page for tagged releases.\n\n## Prerequisites\n\n- Python 3.12 or newer\n- ROS 2 Jazzy installed on the system\n- `uv` available in the workspace\n\n`rclpy` is expected to come from the system ROS installation. It is intentionally not declared as a normal PyPI dependency.\n\n## Quickstart\n\nClone the repository, source ROS 2 Jazzy, and sync the local development environment:\n\n```bash\ngit clone https://github.com/apajon/lifecore_ros2.git\ncd lifecore_ros2\nsource /opt/ros/jazzy/setup.bash\nuv sync --extra dev\n```\n\nRun the smallest composed lifecycle example already in the repository:\n\n```bash\nuv run python examples/minimal_node.py\n```\n\nFrom another terminal in the same ROS 2 environment, drive the node through configure and activate:\n\n```bash\nsource /opt/ros/jazzy/setup.bash\nros2 lifecycle set /minimal_lifecore_node configure\nros2 lifecycle set /minimal_lifecore_node activate\n```\n\nFor the full walkthrough, see [docs/quickstart.rst](docs/quickstart.rst). For validation and documentation commands, see [docs/getting_started.rst](docs/getting_started.rst). For the activation-gated subscriber example, continue with [examples/minimal_subscriber.py](examples/minimal_subscriber.py) or [docs/examples.rst](docs/examples.rst).\n\n## Lifecycle reading path\n\nThe documentation now follows the same lifecycle vocabulary as the framework:\n\n- Configure: environment, prerequisites, ROS resource creation model\n- Activate: runtime enablement and activation gating\n- Run: examples, API usage, composed execution flow\n- Transition: ownership, propagation, and error handling rules\n- Shutdown: cleanup, release, and lifecycle end-state expectations\n\nRecommended order:\n\n1. [docs/quickstart.rst](docs/quickstart.rst)\n2. [docs/getting_started.rst](docs/getting_started.rst)\n3. [docs/concepts/mental_model.rst](docs/concepts/mental_model.rst)\n4. [docs/architecture.rst](docs/architecture.rst)\n5. [docs/patterns.rst](docs/patterns.rst)\n6. [docs/testing.rst](docs/testing.rst)\n7. [docs/examples.rst](docs/examples.rst)\n\n## Shortest-path example — subscriber\n\n[examples/minimal_subscriber.py](examples/minimal_subscriber.py) is the next runnable example if you want to see activation-gated message delivery after the minimal node quickstart.\n\nSee [examples/minimal_subscriber.py](examples/minimal_subscriber.py) for the complete runnable file, [docs/api_friction_audit.rst](docs/api_friction_audit.rst) for the regression baseline, and [docs/examples.rst](docs/examples.rst) for the walkthrough.\n\n\u003e Component + node definition: **24 lines** (regression baseline — see\n\u003e [`docs/api_friction_audit.rst`](docs/api_friction_audit.rst)).\n\n## Publisher and subscriber examples\n\nRun the publisher and observe activation gating:\n\n```bash\nuv run python examples/minimal_publisher.py\n# in another terminal:\nros2 lifecycle set /publisher_demo_node configure\nros2 lifecycle set /publisher_demo_node activate\nros2 topic echo /chatter\n```\n\nMessages appear only after `activate`. Deactivation stops them.\n\nFor the subscriber path, use the quickstart above or the full example walkthrough in [docs/examples.rst](docs/examples.rst).\n\n## Public API overview\n\nAll exported symbols and their stability levels are documented in [ROADMAP.md](ROADMAP.md#public-api-and-extension-model).\n\nThe extension model and API buckets are defined in [docs/architecture.rst](docs/architecture.rst) and [docs/api.rst](docs/api.rst).\n\n## Current limitations\n\n- the public API is in the `0.x` series — experimental stability level; minor bumps may include breaking changes\n- companion examples repository `lifecore_ros2_examples` is *planned — not yet published*; see `ROADMAP.md` for scope and the first applied example (sensor-fusion pipeline)\n\n## License\n\nThis project is licensed under the Apache-2.0 License — see [LICENSE](LICENSE).\n\n## Documentation\n\nDocumentation: https://apajon.github.io/lifecore_ros2/\n\nFull documentation lives under `docs/` and is built with Sphinx:\n\n```bash\nuv sync --extra dev --group docs\nuv run --group docs python -m sphinx -b html docs docs/_build/html\n```\n\nKey pages:\n- `docs/getting_started.rst` — setup and validation commands\n- `docs/architecture.rst` — lifecycle design rules, error policy, member conventions\n- `docs/patterns.rst` — recommended patterns and anti-patterns\n- `docs/testing.rst` — reusable lifecycle test fakes, fixtures, assertions, and helpers\n- `docs/migration_from_rclpy.rst` — before/after comparison with raw rclpy\n- `docs/api.rst` — generated API reference\n- `docs/examples.rst` — example walkthroughs\n\n## Versioning\n\nVersioning uses Conventional Commits and python-semantic-release. Preview the next version:\n\n```bash\nuv run --group release semantic-release version --print\n```\n\nRelease (version commit + tag, skip hosted release if no token):\n\n```bash\nuv run --group release semantic-release version --no-vcs-release\ngit push origin main --follow-tags\n```\n\nSee [ROADMAP.md](ROADMAP.md#versioning-strategy) for promotion-to-1.0.0 criteria.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapajon%2Flifecore_ros2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapajon%2Flifecore_ros2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapajon%2Flifecore_ros2/lists"}