Skip to content

Lifecycle rewrite for separation of concerns #2212

Open
@tgroechel

Description

@tgroechel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions