event-handlers

Automate ROS 2 launch event handling for process lifecycle events.

18|2|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/wimblerobotics/ros2-copilot-skills --skill event-handlers-wimblerobotics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: event-handlers
Source: https://github.com/wimblerobotics/ros2-copilot-skills/tree/main/event-handlers
Command: npx skills add https://github.com/wimblerobotics/ros2-copilot-skills --skill event-handlers-wimblerobotics

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

ROS 2 launch workflows can become brittle when reacting to process lifecycle events. This skill provides a structured approach to respond to events like process start, exit, and IO, enabling automatic sequencing, cleanup, and dynamic configuration of launch descriptions.

Core Features & Use Cases

  • Event-driven launch sequencing: coordinate the startup order of nodes and processes using OnProcessStart and OnProcessExit.
  • Lifecycle-aware cleanup and recovery: implement cleanups, restarts, and conditional shutdowns based on exit codes or events.
  • Dynamic launch logic: adapt the launched graph at runtime with OpaqueFunction and conditional actions.
  • Operator-friendly patterns: guidance on safe usage, ordering, and avoiding common pitfalls in ROS 2 launch files.

Quick Start

Create a LaunchDescription that registers an OnProcessStart handler to launch a dependent node after the driver begins.

Frequently Asked Questions about event-handlers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I coordinate ROS 2 launch startup order across multiple nodes?

Coordinate ROS 2 launch startup order by registering OnProcessStart handlers to trigger dependent nodes automatically once a primary process begins. This event-driven sequencing prevents brittle launch workflows and ensures nodes activate in the correct order.

Can I automate cleanup and recovery actions when a ROS 2 process exits?

Automate ROS 2 process cleanup and recovery by applying OnProcessExit handlers to execute restarts, cleanups, or conditional shutdowns based on exit codes. This lifecycle-aware approach ensures resources are released and failures are handled dynamically.

What is event-driven orchestration in ROS 2 launch files?

Event-driven orchestration in ROS 2 launch files is a structured approach to react to process lifecycle events dynamically. It uses handlers like OnProcessStart, OnProcessExit, OnProcessIO, and TimerAction to adapt the launched graph at runtime.

Does this ROS 2 launch event handling approach support Jazzy and Rolling distributions?

Yes, this ROS 2 launch event handling approach applies to both Jazzy and Rolling distributions. It supports ordered startup, lifecycle transitions, and cleanup actions across multiple nodes within these specific ROS 2 project environments.

How do I adapt the ROS 2 launch graph dynamically at runtime?

Adapt the ROS 2 launch graph dynamically at runtime using OpaqueFunction and conditional actions within your launch description. This allows the launched graph to change based on runtime events and process IO.

Why do my ROS 2 launch workflows become brittle when reacting to process events?

ROS 2 launch workflows become brittle when reacting to process events due to a lack of structured event handling. Using documented patterns for OnProcessStart and OnProcessExit ensures safe usage, proper ordering, and avoids common launch file pitfalls.