Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add LifecycleTimer - #3263

Open
armaho wants to merge 3 commits into
ros2:rollingfrom
armaho:lifecycle_timer
Open

add LifecycleTimer#3263
armaho wants to merge 3 commits into
ros2:rollingfrom
armaho:lifecycle_timer

Conversation

@armaho

@armaho armaho commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Description

Resolves #3255

Adds LifecycleTimer, as requested per issue.

Is this user-facing behavior change?

Methods create_timer and create_wall_timer of LifecycleNode are deprecated in favor of create_lifecycle_timer and create_lifecycle_wall_timer.

Did you use Generative AI?

I asked questions from Claude, but the code is completely mine.

Additional Information

@armaho
armaho marked this pull request as draft September 10, 2026 13:47
@armaho
armaho force-pushed the lifecycle_timer branch 2 times, most recently from 25aa67c to ee55b3f Compare September 11, 2026 09:55
@armaho
armaho marked this pull request as ready for review September 11, 2026 09:57

@fujitatomoya fujitatomoya left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i am not sure if we want to have the APIs something like these under LifecycleNode namespace. i mean that there is already LifecyclePublisher created by LifecycleNode::create_publisher, that tells me create_timer should be lifecycle-managed without having dedicated API? or probably with optional flag like lifecycle_managed?

@jmachowinski @mjcarroll @skyegalaxy wdyt?

Comment thread rclcpp_lifecycle/test/test_lifecycle_timer.cpp Outdated
Comment thread rclcpp_lifecycle/test/test_lifecycle_timer.cpp
@armaho

armaho commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@fujitatomoya

Yes I get that and I actually mentioned it here. The trouble is that since LifecycleTimer is inheriting from GenericTimer if we change the return type, code previously written will compile without a warning. That code might rely on the timer not following the lifecycle of node and this sudden change in behavior may go unnoticed by the developer. The idea of changing the return type seemed a bit dangerous to me.

Signed-off-by: Arman Hosseini <[email protected]>
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

Successfully merging this pull request may close these issues.

Support lifecycle-managed timers in rclcpp_lifecycle::LifecycleNode

2 participants