Report wait outcome from SyncParametersClient::get_parameters (#200)#3169
Open
PavelGuzenfeld wants to merge 1 commit into
Open
Report wait outcome from SyncParametersClient::get_parameters (#200)#3169PavelGuzenfeld wants to merge 1 commit into
PavelGuzenfeld wants to merge 1 commit into
Conversation
…outcome (ros2#200) SyncParametersClient::get_parameters() returns an empty vector both when the parameter server responds with no matching parameters and when the request does not complete (timeout or interruption), so a caller cannot tell a failed request apart from a legitimately empty response. Add a non-breaking overload that additionally reports the wait outcome through a rclcpp::FutureReturnCode out-parameter. The existing overloads delegate to it, so their behaviour is unchanged; callers that need to distinguish the cases use the new overload. Adds a regression test covering SUCCESS-with-value, SUCCESS-but-empty, and TIMEOUT (no server): the last two both return an empty vector but now report different outcomes. Refs ros2#200 Generated-by: Claude Opus 4.8 (Anthropic) Signed-off-by: Pavel Guzenfeld <pavelguzenfeld@gmail.com>
99b84ca to
9b061ab
Compare
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.
SyncParametersClient::get_parameters()returns an empty vector both when the server responds with no matching parameters and when the request does not complete (timeout or interruption), so a caller cannot tell a failed request apart from a legitimately empty response (#200).This adds a non-breaking overload that also reports the wait outcome through a
rclcpp::FutureReturnCodeout-parameter. The existing overloads delegate to it, so their behaviour is unchanged.Tests cover SUCCESS-with-value, SUCCESS-but-empty, and TIMEOUT (no server): the last two both return an empty vector but now report different outcomes.
The sibling sync methods (
describe_parameters,get_parameter_types,set_parameters,delete_parameters) share the same limitation; if this pattern looks right, I'm happy to extend it to them in a follow-up.Some of this change was produced with Claude Opus 4.8 (Anthropic).