|
| 1 | +// Taken and slightly adapted from |
| 2 | +// https://github.com/ros2/rosidl/blob/iron/rosidl_parser/test/msg/MyMessage.idl |
| 3 | + |
| 4 | +module rclrs_example_msgs { |
| 5 | + module msg { |
| 6 | + module MyMessage_Constants { |
| 7 | + const short SHORT_CONSTANT = -23; |
| 8 | + const unsigned long UNSIGNED_LONG_CONSTANT = 42; |
| 9 | + const float FLOAT_CONSTANT = 1.25; |
| 10 | + const boolean BOOLEAN_CONSTANT = TRUE; |
| 11 | + const string STRING_CONSTANT = "string_value"; |
| 12 | + const wstring WSTRING_CONSTANT = "wstring_value_\u2122"; |
| 13 | + const string EMPTY_STRING_CONSTANT = ""; |
| 14 | + }; |
| 15 | + |
| 16 | + @verbatim ( language="comment", text="Documentation of MyMessage." "Adjacent string literal." ) |
| 17 | + @transfer_mode(SHMEM_REF) |
| 18 | + struct MyMessage { |
| 19 | + short short_value, short_value2; |
| 20 | + @default ( value=123 ) |
| 21 | + unsigned short unsigned_short_value; |
| 22 | + @key |
| 23 | + @range ( min=-10, max=10 ) |
| 24 | + long long_value; |
| 25 | + @verbatim (language="comment", text="") |
| 26 | + unsigned long unsigned_long_value; |
| 27 | + long long long_long_value; |
| 28 | + unsigned long long unsigned_long_long_value; |
| 29 | + float float_value; |
| 30 | + double double_value; |
| 31 | +// long double long_double_value; |
| 32 | + char char_value; |
| 33 | + wchar wchar_value; |
| 34 | + boolean boolean_value; |
| 35 | + octet octet_value; |
| 36 | + int8 int8_value; |
| 37 | + uint8 uint8_value; |
| 38 | + int16 int16_value; |
| 39 | + uint16 uint16_value; |
| 40 | + int32 int32_value; |
| 41 | + uint32 uint32_value; |
| 42 | + int64 int64_value; |
| 43 | + uint64 uint64_value; |
| 44 | + string string_value; |
| 45 | + string<5> bounded_string_value; |
| 46 | + wstring wstring_value; |
| 47 | + wstring<23> bounded_wstring_value; |
| 48 | +// wstring<UNSIGNED_LONG_CONSTANT> constant_bounded_wstring_value; |
| 49 | + sequence<short> unbounded_short_values; |
| 50 | + sequence<short, 5> bounded_short_values; |
| 51 | + sequence<string<3>> unbounded_values_of_bounded_strings; |
| 52 | + sequence<string<3>, 4> bounded_values_of_bounded_strings; |
| 53 | + short array_short_values[23]; |
| 54 | + |
| 55 | + // Tests of the floating point parser (7.2.6.4) |
| 56 | + @default ( value=1.9e10 ) |
| 57 | + float int_and_frac_with_positive_scientific; |
| 58 | + @default ( value=1.9e+10 ) |
| 59 | + float int_and_frac_with_explicit_positive_scientific; |
| 60 | + @default ( value=1.1e-10) |
| 61 | + float int_and_frac_with_negative_scientific; |
| 62 | + @default ( value=0.00009 ) |
| 63 | + float int_and_frac; |
| 64 | + @default ( value = 1. ) |
| 65 | + float int_with_empty_frac; |
| 66 | + @default ( value = .1 ) |
| 67 | + float frac_only; |
| 68 | + @default ( value=9e05 ) |
| 69 | + float int_with_positive_scientific; |
| 70 | + @default ( value=9e+05 ) |
| 71 | + float int_with_explicit_positive_scientific; |
| 72 | + @default ( value=9e-05 ) |
| 73 | + float int_with_negative_scientific; |
| 74 | + |
| 75 | + // Tests of the fixed point parser (7.2.6.5) |
| 76 | + @default ( value=8.7d ) |
| 77 | + float fixed_int_and_frac; |
| 78 | + @default ( value=4.d ) |
| 79 | + float fixed_int_with_dot_only; |
| 80 | + @default ( value=.3d ) |
| 81 | + float fixed_frac_only; |
| 82 | + @default ( value=7d ) |
| 83 | + float fixed_int_only; |
| 84 | + }; |
| 85 | + }; |
| 86 | +}; |
0 commit comments