|
| 1 | +# Represents the type of a field and related meta-data. |
| 2 | + |
| 3 | +# A constant for each type supported according to: |
| 4 | +# http://design.ros2.org/articles/legacy_interface_definition.html |
| 5 | +# and: |
| 6 | +# http://design.ros2.org/articles/idl_interface_definition.html |
| 7 | +# Order is loosely coupled to the order of appearance in the IDL 4.2 spec: |
| 8 | +# https://www.omg.org/spec/IDL/4.2 |
| 9 | + |
| 10 | +# Layout of constants across the 0-255 decimal values in the uint8: |
| 11 | +# |
| 12 | +# - 000 : Reserved for "not set" |
| 13 | +# - 001-048: Primitive types, strings, and reserved space for future primitive types |
| 14 | +# - 049-096: Fixed sized array of primitive and string types |
| 15 | +# - 097-144: Bounded Sequences of primitive and string types |
| 16 | +# - 145-192: Unbounded Sequences of primitive and string types |
| 17 | +# - 193-255: Reserved space for future array/sequence-like types |
| 18 | + |
| 19 | +uint8 FIELD_TYPE_NOT_SET = 0 |
| 20 | + |
| 21 | +# Nested type defined in other .msg/.idl files. |
| 22 | +uint8 FIELD_TYPE_NESTED_TYPE = 1 |
| 23 | + |
| 24 | +# Integer Types |
| 25 | +uint8 FIELD_TYPE_INT8 = 2 |
| 26 | +uint8 FIELD_TYPE_UINT8 = 3 |
| 27 | +uint8 FIELD_TYPE_INT16 = 4 |
| 28 | +uint8 FIELD_TYPE_UINT16 = 5 |
| 29 | +uint8 FIELD_TYPE_INT32 = 6 |
| 30 | +uint8 FIELD_TYPE_UINT32 = 7 |
| 31 | +uint8 FIELD_TYPE_INT64 = 8 |
| 32 | +uint8 FIELD_TYPE_UINT64 = 9 |
| 33 | + |
| 34 | +# Floating-Point Types |
| 35 | +uint8 FIELD_TYPE_FLOAT = 10 |
| 36 | +uint8 FIELD_TYPE_DOUBLE = 11 |
| 37 | +uint8 FIELD_TYPE_LONG_DOUBLE = 12 |
| 38 | + |
| 39 | +# Char and WChar Types |
| 40 | +uint8 FIELD_TYPE_CHAR = 13 |
| 41 | +uint8 FIELD_TYPE_WCHAR = 14 |
| 42 | + |
| 43 | +# Boolean Type |
| 44 | +uint8 FIELD_TYPE_BOOLEAN = 15 |
| 45 | + |
| 46 | +# Byte/Octet Type |
| 47 | +uint8 FIELD_TYPE_BYTE = 16 |
| 48 | + |
| 49 | +# String Types |
| 50 | +uint8 FIELD_TYPE_STRING = 17 |
| 51 | +uint8 FIELD_TYPE_WSTRING = 18 |
| 52 | + |
| 53 | +# Fixed String Types |
| 54 | +uint8 FIELD_TYPE_FIXED_STRING = 19 |
| 55 | +uint8 FIELD_TYPE_FIXED_WSTRING = 20 |
| 56 | + |
| 57 | +# Bounded String Types |
| 58 | +uint8 FIELD_TYPE_BOUNDED_STRING = 21 |
| 59 | +uint8 FIELD_TYPE_BOUNDED_WSTRING = 22 |
| 60 | + |
| 61 | +# Fixed Sized Array Types |
| 62 | +uint8 FIELD_TYPE_NESTED_TYPE_ARRAY = 49 |
| 63 | +uint8 FIELD_TYPE_INT8_ARRAY = 50 |
| 64 | +uint8 FIELD_TYPE_UINT8_ARRAY = 51 |
| 65 | +uint8 FIELD_TYPE_INT16_ARRAY = 52 |
| 66 | +uint8 FIELD_TYPE_UINT16_ARRAY = 53 |
| 67 | +uint8 FIELD_TYPE_INT32_ARRAY = 54 |
| 68 | +uint8 FIELD_TYPE_UINT32_ARRAY = 55 |
| 69 | +uint8 FIELD_TYPE_INT64_ARRAY = 56 |
| 70 | +uint8 FIELD_TYPE_UINT64_ARRAY = 57 |
| 71 | +uint8 FIELD_TYPE_FLOAT_ARRAY = 58 |
| 72 | +uint8 FIELD_TYPE_DOUBLE_ARRAY = 59 |
| 73 | +uint8 FIELD_TYPE_LONG_DOUBLE_ARRAY = 60 |
| 74 | +uint8 FIELD_TYPE_CHAR_ARRAY = 61 |
| 75 | +uint8 FIELD_TYPE_WCHAR_ARRAY = 62 |
| 76 | +uint8 FIELD_TYPE_BOOLEAN_ARRAY = 63 |
| 77 | +uint8 FIELD_TYPE_BYTE_ARRAY = 64 |
| 78 | +uint8 FIELD_TYPE_STRING_ARRAY = 65 |
| 79 | +uint8 FIELD_TYPE_WSTRING_ARRAY = 66 |
| 80 | +uint8 FIELD_TYPE_FIXED_STRING_ARRAY = 67 |
| 81 | +uint8 FIELD_TYPE_FIXED_WSTRING_ARRAY = 68 |
| 82 | +uint8 FIELD_TYPE_BOUNDED_STRING_ARRAY = 69 |
| 83 | +uint8 FIELD_TYPE_BOUNDED_WSTRING_ARRAY = 70 |
| 84 | + |
| 85 | +# Bounded Sequence Types |
| 86 | +uint8 FIELD_TYPE_NESTED_TYPE_BOUNDED_SEQUENCE = 97 |
| 87 | +uint8 FIELD_TYPE_INT8_BOUNDED_SEQUENCE = 98 |
| 88 | +uint8 FIELD_TYPE_UINT8_BOUNDED_SEQUENCE = 99 |
| 89 | +uint8 FIELD_TYPE_INT16_BOUNDED_SEQUENCE = 100 |
| 90 | +uint8 FIELD_TYPE_UINT16_BOUNDED_SEQUENCE = 101 |
| 91 | +uint8 FIELD_TYPE_INT32_BOUNDED_SEQUENCE = 102 |
| 92 | +uint8 FIELD_TYPE_UINT32_BOUNDED_SEQUENCE = 103 |
| 93 | +uint8 FIELD_TYPE_INT64_BOUNDED_SEQUENCE = 104 |
| 94 | +uint8 FIELD_TYPE_UINT64_BOUNDED_SEQUENCE = 105 |
| 95 | +uint8 FIELD_TYPE_FLOAT_BOUNDED_SEQUENCE = 106 |
| 96 | +uint8 FIELD_TYPE_DOUBLE_BOUNDED_SEQUENCE = 107 |
| 97 | +uint8 FIELD_TYPE_LONG_DOUBLE_BOUNDED_SEQUENCE = 108 |
| 98 | +uint8 FIELD_TYPE_CHAR_BOUNDED_SEQUENCE = 109 |
| 99 | +uint8 FIELD_TYPE_WCHAR_BOUNDED_SEQUENCE = 110 |
| 100 | +uint8 FIELD_TYPE_BOOLEAN_BOUNDED_SEQUENCE = 111 |
| 101 | +uint8 FIELD_TYPE_BYTE_BOUNDED_SEQUENCE = 112 |
| 102 | +uint8 FIELD_TYPE_STRING_BOUNDED_SEQUENCE = 113 |
| 103 | +uint8 FIELD_TYPE_WSTRING_BOUNDED_SEQUENCE = 114 |
| 104 | +uint8 FIELD_TYPE_FIXED_STRING_BOUNDED_SEQUENCE = 115 |
| 105 | +uint8 FIELD_TYPE_FIXED_WSTRING_BOUNDED_SEQUENCE = 116 |
| 106 | +uint8 FIELD_TYPE_BOUNDED_STRING_BOUNDED_SEQUENCE = 117 |
| 107 | +uint8 FIELD_TYPE_BOUNDED_WSTRING_BOUNDED_SEQUENCE = 118 |
| 108 | + |
| 109 | +# Unbounded Sequence Types |
| 110 | +uint8 FIELD_TYPE_NESTED_TYPE_UNBOUNDED_SEQUENCE = 145 |
| 111 | +uint8 FIELD_TYPE_INT8_UNBOUNDED_SEQUENCE = 146 |
| 112 | +uint8 FIELD_TYPE_UINT8_UNBOUNDED_SEQUENCE = 147 |
| 113 | +uint8 FIELD_TYPE_INT16_UNBOUNDED_SEQUENCE = 148 |
| 114 | +uint8 FIELD_TYPE_UINT16_UNBOUNDED_SEQUENCE = 149 |
| 115 | +uint8 FIELD_TYPE_INT32_UNBOUNDED_SEQUENCE = 150 |
| 116 | +uint8 FIELD_TYPE_UINT32_UNBOUNDED_SEQUENCE = 151 |
| 117 | +uint8 FIELD_TYPE_INT64_UNBOUNDED_SEQUENCE = 152 |
| 118 | +uint8 FIELD_TYPE_UINT64_UNBOUNDED_SEQUENCE = 153 |
| 119 | +uint8 FIELD_TYPE_FLOAT_UNBOUNDED_SEQUENCE = 154 |
| 120 | +uint8 FIELD_TYPE_DOUBLE_UNBOUNDED_SEQUENCE = 155 |
| 121 | +uint8 FIELD_TYPE_LONG_DOUBLE_UNBOUNDED_SEQUENCE = 156 |
| 122 | +uint8 FIELD_TYPE_CHAR_UNBOUNDED_SEQUENCE = 157 |
| 123 | +uint8 FIELD_TYPE_WCHAR_UNBOUNDED_SEQUENCE = 158 |
| 124 | +uint8 FIELD_TYPE_BOOLEAN_UNBOUNDED_SEQUENCE = 159 |
| 125 | +uint8 FIELD_TYPE_BYTE_UNBOUNDED_SEQUENCE = 160 |
| 126 | +uint8 FIELD_TYPE_STRING_UNBOUNDED_SEQUENCE = 161 |
| 127 | +uint8 FIELD_TYPE_WSTRING_UNBOUNDED_SEQUENCE = 162 |
| 128 | +uint8 FIELD_TYPE_FIXED_STRING_UNBOUNDED_SEQUENCE = 163 |
| 129 | +uint8 FIELD_TYPE_FIXED_WSTRING_UNBOUNDED_SEQUENCE = 164 |
| 130 | +uint8 FIELD_TYPE_BOUNDED_STRING_UNBOUNDED_SEQUENCE = 165 |
| 131 | +uint8 FIELD_TYPE_BOUNDED_WSTRING_UNBOUNDED_SEQUENCE = 166 |
| 132 | + |
| 133 | +# Identifying number for the type of the field, using one of the above constants. |
| 134 | +uint8 type_id 0 |
| 135 | + |
| 136 | +# Only used when the type is an array or a bounded sequence. |
| 137 | +# In the case of an array, this is the fixed capacity of the array. |
| 138 | +# In the case of a bounded sequence, this is the maximum capacity of the sequence. |
| 139 | +# In all other cases this field is unused. |
| 140 | +uint64 capacity |
| 141 | + |
| 142 | +# Only used when the type is a fixed or bounded string/wstring, or a array/sequence of those. |
| 143 | +# In the case of a fixed string/wstring, it is the fixed length of the string. |
| 144 | +# In the case of a bounded string/wstring, it is the maximum capacity of the string. |
| 145 | +# In the case of an array/sequence of fixed string/wstring, it is the fixed length of the strings. |
| 146 | +# In the case of an array/sequence of bounded string/wstring, it is the maximum capacity of the strings. |
| 147 | +# It is not currently possible to have different string capacities per element in the array/sequence. |
| 148 | +uint64 string_capacity |
| 149 | + |
| 150 | +# Only used when the type is a nested type or array/sequence of nested types. |
| 151 | +# This is limited to 255 characters. |
| 152 | +# TODO(wjwwood): this 255 character limit was chosen due to this being the limit |
| 153 | +# for DDSI-RTPS based middlewares, which is the most commonly used right now. |
| 154 | +# We lack a ROS 2 specific limit in our design documents, but we should update |
| 155 | +# this and/or link to the design doc when that is available. |
| 156 | +string<=255 nested_type_name |
0 commit comments