ROS 2 - Lifecycle Nodes
Introduction
Concept
In contrast to regular nodes (inactive -> active), lifecycle nodes transition through 4 primary states:
- unconfigured
- action: configure
- inactive
- action: activate
- active
- finalised
This is described in the following diagram:

Note
The node lifecycles is handled by a lifecycle-manager node.
Use-Case
Nav2 navigation stack uses lifecycle nodes to manage transitions and ensure that the stack can successfully execute without missing any nodes.
It configures and activates nodes in a particular sequence to start up the stack, then goes in reverse order to bring it back down into a finalised state.
Whenever a single node fails to transition to configured state, other nodes are also blocked from becoming active. It also transitions down all nodes if any connected planning servers are non-responsive or have crashed.
- This is critical because
controller-serveris in charge of local obstacle avoidance. - If it fails its activation and isn't running correctly, the other navigation nodes should not start, as robot could collide into obstacles while executing its tasks.