-
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
base: rolling
Are you sure you want to change the base?
Conversation
Signed-off-by: David V. Lu <[email protected]>
Added to PMC agenda for May 6th. |
# (e.g. SpawnEntity) to provide a return code which is more specific. | ||
|
||
uint8 result # Result to be checked on return from service interface call | ||
string error_message # Additional error description when useful. |
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.
result and constants looks simulator specific
As discussed in the PMC, I copied it over "as-is". It's updated now.
btw, do we not have something like
error_message
description when the service server returns the error? i
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)
Overall I think that adding this sort of message is a good idea. We'll need to evolve this to be slightly more generic than the current simluation specific descriptions but we've seen similar patterns in other places like nav2 as well With the goal of not reinventing the wheel. As we look to make this slightly more canonical there's a relatively well established set of error codes used in Abseil and gRPC https://abseil.io/docs/cpp/guides/status-codes As a first suggestion I might suggest that we leverage this existing standard instead of making a new one. |
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros-pmc-minutes-for-may-6-2025/43576/1 |
Wanted to add a textual +1: I've used a similar message/structure in many projects, especially when error recovery is (at least partially) delegated to/implemented by machines. It also aligns with how many RPC systems work, especially in more traditional and established fields. re: fields: error messages are nice, for humans. Error codes make things like state machines and behaviour trees -- and the humans implementing/modelling them -- much happier. (although perhaps with LLMs we could argue error messages could also be used now, but that doesn't mean we can't cater to both) The current set of constants is of course specific to what was discussed in ros-simulation/simulation_interfaces#1, but that can be changed and should not be a blocker here. re: constant values: I second @tfoote's suggestion to try and reuse an existing specification -- although perhaps not necessarily limiting candidates to two Google projects. I would also suggest making Could even be nice to introduce categories akin to HTTP response codes ( |
I will note that the |
Co-authored-by: G.A. vd. Hoorn <[email protected]> Signed-off-by: David V. Lu!! <[email protected]>
Signed-off-by: David V. Lu <[email protected]>
I have taken the suggestions, and rewritten the message with
Generally, I was using the
I now have two separate blocks for Client and Server errors. I would have liked to make it so that there was a particular bit set for each, but in the negative number space, I feel like that takes more mental load than its worth to just do a range check. |
Will this promotion be a part of the upcoming Kilted release? |
No, this is being planned for a future release. |
This is the definition of
Result.msg
as it is defined in ros-simulation/simulation_interfaces#1From the README:
This PR is for discussing its promotion to
common_interfaces
instd_msgs
in some future distro.The other option is it gets integrated into the service mechanism itself, as it was in ROS 1.