Repository navigation
Add deferred service response example - #478
Merged
skyegalaxy merged 1 commit intoNov 2, 2026
Merged
skyegalaxy merged 1 commit into
skyegalaxy merged 1 commit into
Conversation
Rayman
force-pushed
the
feature/add-deferred-service-response-example
branch
from
October 28, 2026 09:06
26568f6 to
75e4dfd
Compare
I want to implement a service server that defers sending the response. This feature was implemented in ros2/rclcpp#1709, but I could not find an existing example for this. So with this PR I've added an example. Signed-off-by: Ramon Wijnands <[email protected]>
Rayman
force-pushed
the
feature/add-deferred-service-response-example
branch
from
October 28, 2026 09:48
75e4dfd to
eee360d
Compare
skyegalaxy
self-requested a review
October 29, 2026 16:38
skyegalaxy
approved these changes
Oct 30, 2026
Member
|
Pulls: #478 |
ahcorde
pushed a commit
to ros2/rmw
that referenced
this pull request
Nov 24, 2026
In ros2/examples#478 I've noticed that rclcpp send_reponse takes a mutable reference to the response. I think this a bug in the API as you only need a constant reference to serialize a message. The documentation for rmw verifies that: Access to the given ROS service response is read-only but it is not synchronized. https://github.com/ros2/rmw/blob/0932be49fb6b3c9a8f3de82cf894bb628d7af59c/rmw/include/rmw/rmw.h#L2403 This bug affects multiple layers, so I'm starting the discussion here if my assumptions are correct. Can we change the message to a const reference? If we want this, this change must be accompanied by changes in the following packages: - rmw_implementation - rmw_fastrtps rmw_fastrtps_cpp - rcl - rclcpp - Other rmw implementations (Cyclone DDS, Connext, Zenoh, ...) need the same signature change. The alternative to this is to do a const_cast in rclcpp. Signed-off-by: Ramon Wijnands <[email protected]> Co-authored-by: Copilot <[email protected]>
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
I want to implement a service server that defers sending the response. This feature was implemented in
ros2/rclcpp#1709, but I could not find an existing example for this. So with this PR I've added an example.
Please note that the
send_reponsecall wants a mutable reference to the response. I suspect that is a bug in rclcpp.Fixes # (issue)
Is this user-facing behavior change?
No
Did you use Generative AI?
Yes, GitHub Copilot on Auto
Additional Information