Skip to content

Conversation

@SuperJappie08
Copy link

@SuperJappie08 SuperJappie08 commented Oct 22, 2025

Description

Adds a lifecycle component to composition (composition::LifecycleTalker)

Fixes #745

Is this user-facing behavior change?

Yes, a new component is added.

Did you use Generative AI?

No.

Additional Information

Currently I have put it in the composition package, since it is more of a note that a lifecycle component can exist (and therefore does not extensively focus on the lifecycle part).

@SuperJappie08 SuperJappie08 marked this pull request as ready for review October 30, 2025 15:07
@SuperJappie08
Copy link
Author

I think this is ready for review.
It could use some more tests, but adding tests would make more sense if #747 is fixed.

@fujitatomoya fujitatomoya added the help wanted Extra attention is needed label Dec 9, 2025
@SuperJappie08
Copy link
Author

SuperJappie08 commented Jan 16, 2026

This requires additional changes in order to align with #674

EDIT: This has been resolved

Signed-off-by: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com>
Signed-off-by: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com>
Signed-off-by: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com>
@SuperJappie08 SuperJappie08 force-pushed the rolling-lifecycle-component branch from c439c57 to 4df76db Compare January 16, 2026 12:47
const rclcpp_lifecycle::State & state) override;

rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn on_shutdown(
const rclcpp_lifecycle::State & state) override;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we exercise the other transitions on_activate, etc?

Copy link
Author

@SuperJappie08 SuperJappie08 Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure if I understand correctly, but do you mean 'Should we add the other transitions?'.

I haven't added them right now, as I intended this to be a minimal example for creating lifecycle components.
It isn't a full copy of lifecycle's LifecycleTalker as I wanted to keep this simple for testing (for example in ros2/launch_ros#479), because currently there is no suitable lifecycle component to test with.

I'm open to adding these extra transitions, but we should probably consider the 'difficulty order' or complexity of both lifecycle nodes and node components. (Thinking about 'the (fictitious) ROS 2 textbook chapter ordering'.)

For example, I would imagine most users (or at least beginners) would first learn about lifecycle nodes before node components.
This would make it safe to assume they are familiar with lifecycle nodes before looking at this, which would greatly limit the benefit of these nearly empty transitions while introducing more 'clutter'.

(Having written this, I'm second-guessing the ordering of my ROS 2 journey.)


// We hold an instance of a timer which periodically triggers the publish function.
// As for the beta version, this is a regular timer. In a future version, a
// lifecycle timer will be created which obeys the same lifecycle management as the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would definitely appreciate lifecycle timer contribution

Copy link
Member

@mjcarroll mjcarroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one comment about extra state transitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Lifecycle node component (for testing)

3 participants