Skip to content

Lifecycle rewrite for separation of concerns #2212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tgroechel opened this issue Jun 13, 2023 · 1 comment
Open

Lifecycle rewrite for separation of concerns #2212

tgroechel opened this issue Jun 13, 2023 · 1 comment

Comments

@tgroechel
Copy link

tgroechel commented Jun 13, 2023

Feature request

Rewrite rclcpp::lifecycle for clearer separation of concerns (SoC).

Initial PR: #2211

Feature description

I rewrote some of the lifecycle backend code while attempting to create async transitions (#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:

  1. managing ManagedEntities
  2. managing underlying rcl::state_machine
  3. managing services

I separated these out into files/classes.
Proposed architecture:
soc_lifecycle

This follows more closely to a model-view-controller design:
LifecycleNodeInterfaceImpl: ("controller") owner of:

  • EntitiesManager: (model:managed_entities)responsible for entity state
  • StateManager: (model:lifecycle_state) responsible for lifecycle state_machine
  • StateServicesManager: ("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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants