Field guide
ROS 2 Lifecycle Nodes: Startup and Restart Readiness
Separate process health, lifecycle state, and task readiness with a source-based ROS 2 startup worksheet and a worked dependency-restart review.
The short answer
Accept startup only when you can distinguish three things: a process exists, its lifecycle transition succeeded, and the application has evidence that it is ready for the current task. A restarted process or an active lifecycle state is not enough by itself.
ROS 2 lifecycle nodes provide a framework for configuration, activation, deactivation, cleanup, and shutdown. The managed-node design describes how an external supervisor can coordinate those transitions. It does not supply your application’s dependency checks, command-validity rules, or physical restart authorization.
This guide provides a reusable startup record and a worked dependency-restart review. Its technical examples use the ROS 2 Jazzy lifecycle demo, pinned to a repository revision and reviewed October 30, 2026. We inspected documentation and source code. We did not run ROS, measure recovery time, or test a robot. The proposed acceptance criteria below are our engineering synthesis, not ROS certification requirements or observed results.
Process health, lifecycle state, and task readiness are different
A process manager can report that an executable is running while its application has not completed configuration. A managed node can reach active while an application-specific prerequisite remains unchecked. A supervisor therefore needs more than one status field.
| Layer | Evidence to collect | What it does not establish |
|---|---|---|
| Process health | Process identity, launch configuration, exit status, restart history | Successful node configuration or valid task inputs |
| Lifecycle state | Requested transition, callback result, resulting state, transition timing | Correct calibration, fresh perception, or permission to resume a task |
| Application readiness | Explicit checks for the named task, dependencies, configuration, and input validity | Physical safety certification or performance outside the reviewed conditions |
The distinction is visible in the official Jazzy demo: starting the lifecycle talker leaves it unconfigured. Configuration moves it to inactive. Activation then enables its main publishing function. Process startup and functional activation are separate steps even in this small example.
Our developer stack guide covers the broader integration boundary. This article focuses specifically on when a component should be allowed to start or resume work.
When readiness depends on runtime settings, use the parameter-change rollout worksheet to distinguish a consistent accepted configuration from controller application.
Use the state machine without overstating it
The ROS 2 design document defines four primary states: unconfigured, inactive, active, and finalized. Transition callbacks perform setup or teardown between them.
For a review, attach a concrete resource question to each stage:
- Configure: Which parameters, publishers, buffers, and device resources are prepared? What configuration failure prevents progress?
- Activate: Which outputs or resources become enabled? Which readiness checks must succeed first?
- Deactivate: Which outputs are disabled, and what remains running or allocated?
- Cleanup: Which resources and application state are released before another configuration attempt?
- Shutdown: What must be released before the node reaches its terminal finalized state?
These questions are proposed review criteria. The callback names alone do not answer them. In the Jazzy demo README, lifecycle callbacks have positive default return values, allowing state changes without every callback being overridden. A successful transition can therefore be weaker evidence than a reviewer expects if application checks were never implemented.
The design describes error processing that can return to unconfigured after successful cleanup or end in finalized when recovery fails. The demo README separately documents its error-callback behavior. Do not translate either description into a promise that every failed driver will automatically recover. Record the callback implementation and the supervisor’s policy for the actual installed package.
Why inactive does not mean all code has stopped
The design document’s inactive-state description concerns managed behavior. It should not be used as proof that arbitrary application code, timers, threads, or hardware outputs have stopped.
The pinned lifecycle talker implementation makes the boundary concrete. Its configuration callback creates a publisher and a wall timer. The timer calls publish(). That method checks whether the lifecycle publisher is activated, logs the distinction, and calls the publisher even when inactive. The lifecycle publisher blocks message transfer while inactive. The README explicitly explains that calls can occur outside the active state although messages are only published while active.
Suppressed publication is not the same as zero code execution. Nor does it establish what an unrelated device thread or ordinary publisher does. Review each path capable of issuing commands, not just the node’s reported state.
This also matters for diagnostics. Silence on one topic can mean intentional inactivity, missing configuration, incompatible communication, or another fault. The QoS and stale-data guide covers why an empty subscriber is not a complete health test.
A startup and restart acceptance worksheet
Freeze the ROS distribution, package versions, launch definition, supervisor configuration, node names, and dependency list before using this worksheet. Test only in an isolated non-actuating environment first. Fault injection against physical hardware requires a separately reviewed procedure.
Every row below is a proposed application acceptance check, informed by the lifecycle sources. No result has been measured by Physical AI Guide.
| Case | Proposed decision rule | Evidence your team must collect |
|---|---|---|
| Process starts, configuration has not completed | Do not equate process existence with readiness | Process identity, current lifecycle state, configuration status |
| Required configuration is rejected | Do not authorize dependent work | Callback result, resulting state, diagnostic reason, supervisor decision |
| Configuration succeeds, node remains inactive | Only the explicitly permitted inactive behavior occurs | Managed outputs, ordinary publishers, timers, threads, and device behavior |
| Activation succeeds | Permit work only after named application prerequisites pass | Transition result plus dependency and input-validity observations |
| Required dependency disappears | Apply the application’s reviewed degraded or stopped behavior | Detection event, response, affected outputs, and unresolved dependencies |
| Dependency process restarts | Do not treat its new process as restored task readiness | New process/session identity, configuration, valid outputs, and readiness decision |
| Cleanup and reconfiguration occur | Resolve retained state before reactivation | Resource release, replacement configuration, retained messages, pending work |
| Resume is requested | Require the defined task and restart authorization | Current task identity, invalidated old work, approver or policy, final decision |
Choose actual limits from application requirements. This article supplies no universal timeout, safe stopping distance, or recovery-time threshold. Measure those separately where applicable.
Worked review: a perception dependency restarts
Consider an illustrative pipeline with a camera component, a perception component, and a task component. This is a review example, not an observed customer deployment. Suppose the perception process restarts while the task component remains active.
A weak acceptance rule is: “The perception process is running again, so resume.” A slightly stronger but still incomplete rule is: “Perception reports active, so resume.” Neither establishes whether the next output belongs to the current configuration and task.
Our proposed review sequence is:
- Identify the interruption. Record which dependency failed and what the task component did in response. Do not infer a physical stop from a software status change.
- Separate the replacement session. Record the restarted process and the configuration it loaded. Decide how the application distinguishes new outputs from retained or in-flight data.
- Re-establish input validity. Check the observation’s timestamp, frame, and calibration against the accepted configuration. The coordinate-frame guide covers those geometric checks.
- Reconcile pending work. Decide whether an old target, queued command, or partially completed task is still valid. Explicitly invalidate work that cannot be reconciled.
- Collect readiness evidence. Record the successful lifecycle transitions and the separate application checks. An unchecked dependency remains unknown, not passed.
- Apply restart authority. Resume only under the policy defined for this task and system, keeping physical validation separate from the software review.
For a reusable record, copy this template into the team’s review system:
Case and configuration:
Interrupted dependency:
Process/session before and after:
Requested transition and result:
Observed lifecycle state:
Required application checks:
Observation timestamp, frame, and configuration:
Pending work retained, rejected, or reconciled:
Output behavior during interruption:
Restart authorization:
Observed result: NOT TESTED
Decision and unresolved evidence:
The value of this record is the separation of claims. “Configured,” “active,” “fresh output observed,” and “resume authorized” each need their own evidence. For trace collection, our incident-recording guide explains how to retain clocks, coverage gaps, and original versus replayed outputs.
Keep supervision and physical protection separate
The managed-node design expects external management to coordinate transitions and recovery. That does not make a lifecycle manager a physical protective system. A process can hang, the supervisor can lose communication, or a device can retain an output outside the reviewed managed path. These are cases to evaluate, not behavior this article has measured.
For an acceptance handoff, assign an owner for dependency ordering, failed transitions, restart loops, retained task state, and restart permission. Keep communications security separate too: an authorized lifecycle request is not automatically an appropriate operational decision. Our ROS 2 security checklist addresses identity and permissions.
Deactivation is a software operation. It does not by itself prove torque removal, a safe physical stop, prevention of unexpected restart, or compliance with a safety standard. The robot safety standards guide provides the adjacent system-level context.
The acceptance statement should name the configuration, transitions, dependency failures, and readiness evidence actually reviewed. Avoid the much broader claim that lifecycle support makes startup or recovery safe.
Sources and evidence limits
First-party material reviewed October 30, 2026:
- ROS 2 managed nodes design, written June 2015 and last modified February 2021. Used for the state-machine concept, transition responsibilities, error processing, and external supervision. It is an architectural design document, not a current test report for every implementation.
- ROS 2 Jazzy lifecycle demo README, pinned to the reviewed revision. Used for the talker/listener example, configuration versus activation, default callbacks, and error handling.
- Lifecycle talker source at the same revision, used to inspect timer creation, publication calls, and lifecycle-publisher activation. This is source inspection, not execution evidence.
The three-layer readiness model, acceptance worksheet, dependency-restart example, and evidence template are our editorial synthesis. They are intended to make an integration review more precise, not to imply first-hand robot testing, measured reliability, or certification.
Frequently asked questions
Does an active ROS 2 lifecycle node prove a robot is ready?
No. Active is a software lifecycle state. Task readiness also requires application evidence such as valid dependencies, fresh observations, the intended configuration, and authorization to resume the current task.
Does inactive mean that every callback has stopped?
Do not assume that. In the reviewed Jazzy lifecycle talker, a timer can call publish while the lifecycle publisher is inactive. The lifecycle publisher suppresses message transfer, but the example still runs code. Review the actual resources and execution paths your application manages.
Is deactivating a ROS 2 node a safety-rated stop?
No. A software state transition does not establish physical stopping behavior or safety certification. Hardware behavior, independent protective functions, and restart authorization require separate system-level validation.