Skip to main content

ros2-lifecycle

Author and debug ROS 2 managed (lifecycle) nodes, lifecycle publishers, ordered bringup, and bond-style managers (Nav2-like). Use when implementing configure/activate/deactivate, inactive topics dropping data, or lifecycle managers.

ソース情報

リポジトリ
guilyx/dotfiles
ソースの最終更新活動
2026年8月12日 19:39
検出された SKILL.md の言語
英語
スター
0
フォーク
0

インストール方法

デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。

ソースファイルを確認

インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。

SKILL.md を表示中

SKILL.md
ソースの指示 · 読み取り専用プレビュー
name
ros2-lifecycle
description
Author and debug ROS 2 managed (lifecycle) nodes, lifecycle publishers, ordered bringup, and bond-style managers (Nav2-like). Use when implementing configure/activate/deactivate, inactive topics dropping data, or lifecycle managers.
# ROS 2 Lifecycle (Managed Nodes) ## State machine `unconfigured → inactive → active → finalized` Error from any state → `on_error` → typically back to unconfigured. | Transition | Put here | |------------|----------| | `on_configure` | Allocate, declare params, create pubs/subs that should exist while inactive; load plugins | | `on_activate` | Start processing; activate lifecycle publishers; start bonds | | `on_deactivate` | Stop commanding; keep allocations; deactivate lifecycle pubs | | `on_cleanup` | Destroy entities, unload plugins → unconfigured | | `on_shutdown` | Final teardown | | `on_error` | Best-effort recover; assume hardware may be wedged | ## Lifecycle publishers A `LifecyclePublisher` **does not publish while inactive**. Ordinary `create_publisher` **will** — do not mix unless intentional (e.g. diagnostics always on). ## Ordered bringup (Nav2-style) Activate **dependencies first**: drivers / maps → localization → planning → control → mission. Deactivate **reverse**. Prefer a **lifecycle manager** (service transitions + optional **bond/heartbeat**) over launch `TimerAction` sleeps. If a bonded node dies, deactivate dependents so controllers stop commanding. ## CLI ```bash ros2 lifecycle list /node ros2 lifecycle get /node ros2 lifecycle set /node configure ros2 lifecycle set /node activate ros2 lifecycle set /node deactivate ``` Launch: `LifecycleNode` + `ChangeState` / `OnStateTransition`, or a manager node. ## Failure modes - Stuck `unconfigured`: `on_configure` FAILURE — params, device open, plugin load. - Publisher in graph but silence: still **inactive**, or lifecycle pub not activated. - Crash on activate: work that needed live data done in the wrong transition. - Double-create across cycles: destroy in `on_cleanup`. ## Tests configure-fail; activate; deactivate→reactivate (no leak / no double subscribe); shutdown from each state; kill process under bond and assert safe stop.
GitHubで見る