@@ -40,7 +40,7 @@ Both line comments (`//`) as well as block comments (`/* ... */`) are being supp
40
40
41
41
#### 7.2.3 Identifiers
42
42
43
- An identifier must start with an is an ASCII alphabetic characteran followed by any number of ASCII alphabetic, digit and underscore (` _ ` ) characters.
43
+ An identifier must start with an ASCII alphabetic character followed by any number of ASCII alphabetic, digit and underscore (` _ ` ) characters.
44
44
45
45
#### 7.2.6 Literals
46
46
@@ -129,7 +129,7 @@ the DDS-XTypes specification 1.2 defines it with 16-bit.
129
129
| ---------------------- | ---------------------------------------------------------- |
130
130
| sequence\< type\_ spec> | sequence of items of the specific type\_ spec |
131
131
| | the sequence is unbounded and no maximum size is specified |
132
- | sequence<type_spec, N> | sequence of of up to N items of the specified type\_ spec |
132
+ | sequence<type_spec, N> | sequence of up to N items of the specified type\_ spec |
133
133
| | the sequence is bounded and contain between 0 and N items |
134
134
135
135
#### 7.4.1.4.4.3.2 Strings
@@ -159,6 +159,60 @@ An enumerated type consist of an ordered list of enumerators.
159
159
A multidimensional, fixed-size array is defined by the type of each item and the explicit sizes for each dimension.
160
160
For now only a one-dimensional, fixed-size array is supported though.
161
161
162
+ ### Interface Identification
163
+
164
+ #### Uniform Resource Name (URN)
165
+
166
+ Following 7.5.1 from the IDL 4.2 specification, every IDL definition can be uniquely identified with a qualified name of the form
167
+ ** <scoped\_ name>::<identifier >** .
168
+ In addition to the specification, the scope of an IDL definition is prefixed with the package name from which the defintions is derived.
169
+ This is to guarantee uniqueness of definitions across packages (under the assumption that package names are unique).
170
+ Therefore, each interface defintion can be resolved with a URN of the form: ** <package\_ name>/<scoped\_ name>/<identifier >** .
171
+
172
+ #### Uniform Resource Locator (URL)
173
+
174
+ For source code to use an interface (e.g. include or import) there needs to be a way to reference the file containing the defintion.
175
+ To reference the location of an IDL defintion we use a URL of the form: ** rosidl:<package\_ name>/<subfolder >/<file >** .
176
+ Where * <subfolder >* is the relative path from the root of the package where generated defintions can be found.
177
+
178
+ #### Example
179
+
180
+ Imagine we have a package ` foo_pkg ` containing an IDL file ` Bar.idl ` with the following contents:
181
+
182
+ ``` idl
183
+ struct MsgA {
184
+ boolean bool_member;
185
+ };
186
+
187
+ module bar {
188
+ const int8 MY_CONSTANT = 42;
189
+
190
+ struct MsgB {
191
+ int8 int_member;
192
+ };
193
+
194
+ module baz {
195
+ struct MsgC {
196
+ string string_member;
197
+ };
198
+ };
199
+ };
200
+ ```
201
+
202
+ Also imagine the message generation pipeline places the generated implementation to a subfolder ` interface ` .
203
+
204
+ Then, we can reference the interfaces with the following URNs:
205
+
206
+ - ` foo_pkg/MsgA `
207
+ - ` foo_pkg/bar/MY_CONSTANT `
208
+ - ` foo_pkg/bar/MsgB `
209
+ - ` foo_pkg/bar/baz/MsgC `
210
+
211
+ And all can be located with the URL: ` rosidl:foo_pkg/interface/Bar ` .
212
+
213
+ For example, the definitions could be included in C++ with ` #include <foo_pkg/interface/Bar.hpp> `
214
+ or imported in Python with ` import foo_pkg.interface.Bar ` .
215
+
162
216
### Annotations
163
217
164
218
The syntax for arbitrary annotations is supported.
0 commit comments