Lifecycle Node (Managed Node)
生命周期节点AdvancedA ROS 2 node type with a standard state machine, letting an external manager configure, start, pause, and shut it down in order.
A lifecycle node is a node type ROS 2 introduced. An ordinary node starts working the moment it launches, and there's no guarantee about which of several nodes becomes ready first; a lifecycle node instead has a built-in standard state machine, with main states unconfigured, inactive, active, and finalized, moving between them through transitions such as configure, activate, deactivate, cleanup, and shutdown — each transition calling a callback the developer has written (for example, reading parameters and allocating resources during “configure,” or starting to publish messages during “activate”). An external manager can then bring up a group of nodes in a defined order, and shut them all down uniformly if something goes wrong, making system startup and fault handling controllable. Nav2's navigation stack uses a lifecycle manager to start up its various server nodes this way.
ExampleNav2's lifecycle_manager configures and activates the map server and localization node in sequence, then, once they're confirmed ready, activates the planner and controller — so the controller never starts outputting velocity commands before a map exists.
- Also called
- managed node, LifecycleNode
- Related
- ROS 2 · Node (ROS) · ROS 2 Navigation Stack (Nav2) · Finite State Machine · Launch File · ros2_control
- Sources
- ROS 2 Design: Managed nodes