Lifecycle rewrite for separation of concerns
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 805
- Forks
- 564
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 27
Description
Feature request
Rewrite rclcpp::lifecycle for clearer separation of concerns (SoC).
Initial PR: https://github.com/ros2/rclcpp/pull/2211
Feature description
I rewrote some of the lifecycle backend code while attempting to create async transitions (https://github.com/ros2/rclcpp/pull/2214). It was suggested it would be best to separate this SoC contribution out into its own issue/PR.
The primary goal was to separate out some of LifecycleNodeInterfaceImpl is responsible for. Currently the LifecycleNodeInterfaceImpl is responsible for:
- managing
ManagedEntities - managing underlying
rcl::state_machine - managing services
I separated these out into files/classes.
Proposed architecture:
This follows more closely to a model-view-controller design:
LifecycleNodeInterfaceImpl: ("controller") owner of:
EntitiesManager: (model:managed_entities)responsible for entity stateStateManager: (model:lifecycle_state) responsible for lifecyclestate_machineStateServicesManager: ("view + controller") public interface of services
I also separated out the change_state process into multiple functions to allow for easier splitting when creating async transitions. Additionally, I did some miscellaneous function cleanup and added helper functions for readability.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing LifecycleNodeInterfaceImpl and the proposed architecture, then read PRs #2211 and #2214 for the existing separation and async-transition context. Done means responsibilities are split among EntitiesManager, StateManager, and StateServicesManager, with change_state separated into smaller functions and existing behavior preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- robotics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100