Skip to content
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

Add GetTypeDescription.srv (rep2011) #153

2 changes: 2 additions & 0 deletions type_description_interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ rosidl_generate_interfaces(${PROJECT_NAME}
"msg/Field.msg"
"msg/FieldType.msg"
"msg/IndividualTypeDescription.msg"
"msg/KeyValue.msg"
"msg/TypeDescription.msg"
"srv/GetTypeDescription.srv"
ADD_LINTER_TESTS
)

Expand Down
2 changes: 2 additions & 0 deletions type_description_interfaces/msg/KeyValue.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
string key
string value
2 changes: 2 additions & 0 deletions type_description_interfaces/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

<buildtool_depend>rosidl_core_generators</buildtool_depend>

<depend>service_msgs</depend>

<exec_depend>rosidl_core_runtime</exec_depend>

<test_depend>ament_lint_auto</test_depend>
Expand Down
42 changes: 42 additions & 0 deletions type_description_interfaces/srv/GetTypeDescription.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# ROS interface type name, in PACKAGE/NAMESPACE/TYPENAME format
string type_name

# REP-2011 RIHS hash string, which looks like RIHSxx_hashvalue
string type_version_hash

# Whether to return the raw idl or msg file(s) in the response, if available
bool include_raw_description true
---
# include_raw_description requested, and provided successfully
uint8 RAW_DESCRIPTION_REQUESTED_PROVIDED = 0
# include_raw_description disabled, so type_description_raw was left empty
uint8 RAW_DESCRIPTION_NOT_REQUESTED_NOT_PROVIDED = 1
# include_raw_description requested, but no raw version available (perhaps for )
emersonknapp marked this conversation as resolved.
Show resolved Hide resolved
uint8 RAW_DESCRIPTION_REQUESTED_NOT_AVAILABLE = 2

# True if the type description information is available and populated in the response
emersonknapp marked this conversation as resolved.
Show resolved Hide resolved
bool successful
# If `successful` is false, contains a reason for failure.
# On success, may contain a reason for missing type_description_raw.
string reason

# Contains a value from RAW_DESCRIPTION_ constants,
# explaining the value of `type_description_raw_file_name` and `type_description_raw`
emersonknapp marked this conversation as resolved.
Show resolved Hide resolved
uint8 type_description_raw_result

# The idl or msg file name
# Empty if not available, which will be noted in `reason`
string type_description_raw_file_name

# The idl or msg file, with comments and whitespace
# The file extension and/or the contents can be used to determine the format
# This contains all recursive raw files, each separated by a line of 80 '=' characters
# The order will be the same as the TypeDescription -
# which is top level interface, then referenced type descriptions in alphabetical order by type_name
string type_description_raw
emersonknapp marked this conversation as resolved.
Show resolved Hide resolved
emersonknapp marked this conversation as resolved.
Show resolved Hide resolved

# The parsed type description which can be used programmatically
TypeDescription type_description

# Key-value pairs of extra information.
KeyValue[] extra_information