Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions std_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ set(msg_files
"msg/Int8MultiArray.msg"
"msg/MultiArrayDimension.msg"
"msg/MultiArrayLayout.msg"
"msg/Result.msg"
"msg/String.msg"
"msg/UInt16.msg"
"msg/UInt16MultiArray.msg"
Expand Down
1 change: 1 addition & 0 deletions std_msgs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ For more information about ROS 2 interfaces, see [docs.ros.org](https://docs.ros
* [ColorRGBA](msg/ColorRGBA.msg): A single RGBA value for representing colors.
* [Empty](msg/Empty.msg): Does not hold any information, useful when the sending of a message would provide sufficient information.
* [Header](msg/Header.msg): Standard metadata for higher-level stamped data types used to communicate timestamped data in a particular coordinate frame.
* [Result](msg/Result.msg): Basic structure for returning information in a Service Response.

### Primitive Types
`std_msgs` provides the following wrappers for ROS primitive types, which are documented in the msg specification. It also contains the Empty type, which is useful for sending an empty signal. However, these types do not convey semantic meaning about their contents: every message simply has a field called "data". Therefore, while the messages in this package can be useful for quick prototyping, they are NOT intended for "long-term" usage. For ease of documentation and collaboration, we recommend that existing messages be used, or new messages created, that provide meaningful field name(s).
Expand Down
18 changes: 18 additions & 0 deletions std_msgs/msg/Result.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Result code and message for service calls.
# Note that additional results for specific services can defined within them using values above 100.

uint8 RESULT_FEATURE_UNSUPPORTED = 0 # Feature is not supported by the simulator, check GetSimulatorFeatures.
# While feature support can sometimes be deduced from presence of corresponding
# service / action interface, in other cases it is about supporting certain
# call parameters, formats and options within interface call.
uint8 RESULT_OK = 1
uint8 RESULT_NOT_FOUND = 2 # No match for input (such as when entity name does not exist).
uint8 RESULT_INCORRECT_STATE = 3 # Simulator is in an incorrect state for this interface call, e.g. a service
# requires paused state but the simulator is not paused.
uint8 RESULT_OPERATION_FAILED = 4 # Request could not be completed successfully even though feature is supported
# and the input is correct; check error_message for details.
# Implementation rule: check extended codes for called service
# (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.
Copy link
Collaborator

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?)

Copy link
Contributor Author

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)