Skip to content

Commit 6a01b03

Browse files
committed
Result.msg for Service Responses
Signed-off-by: David V. Lu <[email protected]>
1 parent 3631ac9 commit 6a01b03

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

std_msgs/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ set(msg_files
3737
"msg/Int8MultiArray.msg"
3838
"msg/MultiArrayDimension.msg"
3939
"msg/MultiArrayLayout.msg"
40+
"msg/Result.msg"
4041
"msg/String.msg"
4142
"msg/UInt16.msg"
4243
"msg/UInt16MultiArray.msg"

std_msgs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ For more information about ROS 2 interfaces, see [docs.ros.org](https://docs.ros
88
* [ColorRGBA](msg/ColorRGBA.msg): A single RGBA value for representing colors.
99
* [Empty](msg/Empty.msg): Does not hold any information, useful when the sending of a message would provide sufficient information.
1010
* [Header](msg/Header.msg): Standard metadata for higher-level stamped data types used to communicate timestamped data in a particular coordinate frame.
11+
* [Result](msg/Result.msg): Basic structure for returning information in a Service Response.
1112

1213
### Primitive Types
1314
`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).

std_msgs/msg/Result.msg

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Result code and message for service calls.
2+
# Note that additional results for specific services can defined within them using values above 100.
3+
4+
uint8 RESULT_FEATURE_UNSUPPORTED = 0 # Feature is not supported by the simulator, check GetSimulatorFeatures.
5+
# While feature support can sometimes be deduced from presence of corresponding
6+
# service / action interface, in other cases it is about supporting certain
7+
# call parameters, formats and options within interface call.
8+
uint8 RESULT_OK = 1
9+
uint8 RESULT_NOT_FOUND = 2 # No match for input (such as when entity name does not exist).
10+
uint8 RESULT_INCORRECT_STATE = 3 # Simulator is in an incorrect state for this interface call, e.g. a service
11+
# requires paused state but the simulator is not paused.
12+
uint8 RESULT_OPERATION_FAILED = 4 # Request could not be completed successfully even though feature is supported
13+
# and the input is correct; check error_message for details.
14+
# Implementation rule: check extended codes for called service
15+
# (e.g. SpawnEntity) to provide a return code which is more specific.
16+
17+
uint8 result # Result to be checked on return from service interface call
18+
string error_message # Additional error description when useful.

0 commit comments

Comments
 (0)