Add wait_for_message overload using node interfaces (backport #3230) - #3233
Add wait_for_message overload using node interfaces (backport #3230)#3233mergify[bot] wants to merge 2 commits into
Conversation
Signed-off-by: Yadunund Vijay <yadunund@gmail.com> (cherry picked from commit 5dd47aa) # Conflicts: # rclcpp_lifecycle/CMakeLists.txt
|
Cherry-pick of 5dd47aa has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
Tick the box to add this pull request to the merge queue (same as
|
Signed-off-by: Tomoya.Fujita <fujita.tomoya@triorb.co.jp>
|
@Yadunund i need your approval on this before merge, since i resolved the conflicts. |
|
Pulls: #3233 |
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: