Add wait_for_message overload using node interfaces - #3230
Open
Yadunund wants to merge 1 commit into
Open
Conversation
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
Signed-off-by: Yadunund Vijay <yadunund@gmail.com>
Yadunund
force-pushed
the
yadu/generic_wait_for_message
branch
from
August 19, 2026 05:20
bf353ac to
834930e
Compare
skyegalaxy
approved these changes
Aug 20, 2026
skyegalaxy
left a comment
Member
There was a problem hiding this comment.
lgtm. surprised we didn't already have this in the API before
Member
|
Pulls: #3230 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add a
rclcpp::wait_for_messageoverload that takesNodeParametersInterfaceandNodeTopicsInterfaceinstead ofrclcpp::Node::SharedPtr.The existing topic convenience overload requires a
Node::SharedPtr, so it cannot be used withrclcpp_lifecycle::LifecycleNode, or during node construction whenshared_from_this()is unavailable. The new overload uses the samerclcpp::create_subscriptioninterface path already used elsewhere in rclcpp. TheNode::SharedPtroverload now delegates to it.Also extend coverage with:
rclcpprclcpp_lifecyclethat waits via aLifecycleNodeheld in aunique_ptr(noshared_from_this)Related to #1953 (LifecycleNode / non-
Node::SharedPtrsupport from the original proposal). This does not address the still-open executor / wait-set concern discussed there (callingwait_for_messagefrom inside a node already managed by an executor).Is this user-facing behavior change?
Yes. Callers can wait for a topic message using node interfaces, which enables
LifecycleNodeand construction-time use withoutshared_from_this(). ExistingNode::SharedPtrand subscription+context overloads are unchanged in behavior.Did you use Generative AI?
Yes. Cursor (Grok) was used to help draft the overload, tests, and this PR description. Changes were reviewed, adjusted and tested manually.
Additional Information
Example:
Tested via: