-
Notifications
You must be signed in to change notification settings - Fork 126
Result.msg for Service Responses #279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DLu
wants to merge
3
commits into
ros2:rolling
Choose a base branch
from
DLu:result
base: rolling
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Result code and message for service calls. | ||
# Note that additional codes for specific services can defined within the service definition. | ||
# For example, you could define a service CalculateSquareRoot.srv as | ||
# float64 value | ||
# --- | ||
# int32 CODE_NEGATIVE_VALUE = -110 | ||
# std_msgs/Result result | ||
# float64 root | ||
# | ||
# If a negative value is provided, the server could return the generic CODE_INVALID_ARGUMENT | ||
# as result.code, or it could provide more context with CODE_NEGATIVE_VALUE. | ||
# | ||
# As a general guideline, | ||
# Positive values are successes | ||
# Negative values are failures | ||
# Values between -1 and -100 are for some generic high-level failures | ||
# Values between -101 and -1000 are for client (caller) errors (a la HTTP 4XX errors) | ||
# Values between -1001 and -2000 are for server errors (a la HTTP 5XX errors) | ||
|
||
int32 CODE_UNKNOWN = 0 | ||
int32 CODE_OK = 1 | ||
|
||
int32 CODE_GENERAL_FAILURE = -1 | ||
|
||
# Client Errors | ||
int32 CODE_CANCELLED = -101 | ||
int32 CODE_INVALID_ARGUMENT = -102 | ||
int32 CODE_NOT_FOUND = -103 | ||
int32 CODE_ALREADY_EXISTS = -104 | ||
int32 CODE_PERMISSION_DENIED = -105 | ||
int32 CODE_FAILED_PRECONDITION = -106 | ||
int32 CODE_OUT_OF_RANGE = -107 | ||
|
||
# Server Errors | ||
int32 CODE_INTERNAL = -1000 | ||
int32 CODE_UNIMPLEMENTED = -1001 | ||
int32 CODE_UNAVAILABLE = -1002 | ||
int32 CODE_DEADLINE_EXCEEDED = -1003 | ||
|
||
int32 code # Code number to be checked on return from service interface call | ||
string error_message # Additional error description when useful. | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
result and constants looks simulator specific, i do not think those are generic service response message in system layer. btw, do we not have something like
error_message
description when the service server returns the error? if that is missing, i think that would be useful for system? (user can leave it empty if they do not use it?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in the PMC, I copied it over "as-is". It's updated now.
That existed in ROS 1 but cannot exist in ROS 2 because of the DDS spec (someone else can probably back it up with more precise language)