Skip to content

Commit aafd90e

Browse files
authored
Add GetTypeDescription.srv (rep2011) (#153)
* Add GetTypeDescription.srv Signed-off-by: Emerson Knapp <[email protected]>
1 parent 18d891a commit aafd90e

File tree

5 files changed

+56
-2
lines changed

5 files changed

+56
-2
lines changed

type_description_interfaces/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ cmake_minimum_required(VERSION 3.5)
22

33
project(type_description_interfaces)
44

5-
# Default to C++14
5+
# Default to C++17
66
if(NOT CMAKE_CXX_STANDARD)
7-
set(CMAKE_CXX_STANDARD 14)
7+
set(CMAKE_CXX_STANDARD 17)
88
endif()
99
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
1010
add_compile_options(-Wall -Wextra -Wpedantic)
@@ -19,7 +19,10 @@ rosidl_generate_interfaces(${PROJECT_NAME}
1919
"msg/Field.msg"
2020
"msg/FieldType.msg"
2121
"msg/IndividualTypeDescription.msg"
22+
"msg/KeyValue.msg"
2223
"msg/TypeDescription.msg"
24+
"msg/TypeSource.msg"
25+
"srv/GetTypeDescription.srv"
2326
ADD_LINTER_TESTS
2427
)
2528

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Represents an arbitrary key-value pair for application-specific information.
2+
3+
string key
4+
string value
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Represents the original source of a ROS 2 interface definition.
2+
3+
# ROS interface type name, in PACKAGE/NAMESPACE/TYPENAME format.
4+
string type_name
5+
6+
# The type of the original source file, typically matching the file extension.
7+
# Well-known encodings: "idl", "msg", "srv", "action", "dynamic", "implicit".
8+
# "dynamic" specifies a type created programmatically by a user, thus having no source.
9+
# "implicit" specifies a type created automatically as a subtype of a
10+
# complex type (service or action) - such as the request message for a service.
11+
# Implicit types will have no contents, the full source will be available on the parent srv/action.
12+
string encoding
13+
14+
# Dumped contents of the interface definition source file.
15+
# If `encoding` is "dynamic" or "implicit", this field will be empty.
16+
string raw_file_contents

type_description_interfaces/package.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
<buildtool_depend>rosidl_core_generators</buildtool_depend>
1515

16+
<depend>service_msgs</depend>
17+
1618
<exec_depend>rosidl_core_runtime</exec_depend>
1719

1820
<test_depend>ament_lint_auto</test_depend>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# ROS interface type name, in PACKAGE/NAMESPACE/TYPENAME format.
2+
string type_name
3+
4+
# REP-2011 RIHS hash string.
5+
string type_hash
6+
7+
# Whether to return the original idl/msg/etc. source file(s) in the response.
8+
bool include_type_sources true
9+
---
10+
# True if the type description information is available and populated in the response.
11+
# If false, all other fields except `failure_reason` are considered undefined.
12+
bool successful
13+
# If `successful` is false, contains a reason for failure.
14+
# If `successful` is true, this is left empty.
15+
string failure_reason
16+
17+
# The parsed type description which can be used programmatically.
18+
TypeDescription type_description
19+
20+
# A list containing the interface definition source text of the requested type,
21+
# plus all types it recursively depends on.
22+
# Each source text is a copy of the original contents of the
23+
# .msg, .srv, .action, .idl, or other file if it exists, including comments and whitespace.
24+
# Sources can be matched with IndividualTypeDescriptions by their `type_name`.
25+
# The `encoding` field of each entry informs how to interpret its contents.
26+
TypeSource[] type_sources
27+
28+
# Key-value pairs of extra information.
29+
KeyValue[] extra_information

0 commit comments

Comments
 (0)