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에서 보기