Skip to content

Commit 3e6ae3e

Browse files
committed
Moved the rclrs_example_msgs package to the examples folder. This package was only ever used by examples. (#384)
1 parent 1471dea commit 3e6ae3e

File tree

5 files changed

+178
-0
lines changed

5 files changed

+178
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
3+
project(rclrs_example_msgs)
4+
5+
# Default to C++14
6+
if(NOT CMAKE_CXX_STANDARD)
7+
set(CMAKE_CXX_STANDARD 14)
8+
endif()
9+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
10+
add_compile_options(-Wall -Wextra -Wpedantic)
11+
endif()
12+
13+
find_package(ament_cmake REQUIRED)
14+
find_package(rosidl_default_generators REQUIRED)
15+
16+
set(msg_files
17+
"msg/NestedType.msg"
18+
"msg/VariousTypes.msg"
19+
"msg/MyMessage.idl"
20+
)
21+
22+
rosidl_generate_interfaces(${PROJECT_NAME}
23+
${msg_files}
24+
)
25+
26+
ament_export_dependencies(rosidl_default_runtime)
27+
28+
ament_package()
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
string effect "discombobulate"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Primitive types
2+
bool bool_member true
3+
int8 int8_member 1
4+
uint8 uint8_member 2
5+
byte byte_member 3
6+
float32 float32_member 1e-2
7+
8+
# Array/sequence of primitive type
9+
float32[3] float_array [1.0, 2.0, 3.0]
10+
float32[<=3] float_seq_bounded [4.0, 5.0]
11+
float32[] float_seq_unbounded [6.0]
12+
13+
# String types
14+
string string_member "Χαίρετε 你好"
15+
wstring wstring_member "αντίο σου 再见"
16+
string<=3 bounded_string_member "äöü"
17+
wstring<=3 bounded_wstring_member "äöü"
18+
19+
# Array/sequence of string type
20+
string[4] string_array ["R", "O", "S", "2"]
21+
string[<=4] string_seq_bounded ["R", "O", "S", "2"]
22+
string[] string_seq_unbounded ["R", "O", "S", "2"]
23+
string<=1[4] bounded_string_array ["R", "O", "S", "2"]
24+
string<=1[<=4] bounded_string_seq_bounded ["R", "O", "S", "2"]
25+
string<=1[] bounded_string_seq_unbounded ["R", "O", "S", "2"]
26+
27+
# Nested type
28+
NestedType nested_member
29+
30+
# Array/sequence of nested type
31+
NestedType[2] nested_array
32+
NestedType[] nested_seq_unbounded
33+
NestedType[<=3] nested_seq_bounded
34+
35+
36+
# binary, hexadecimal and octal constants are also possible
37+
int8 TWO_PLUS_TWO = 5
38+
# Only unbounded strings are possible
39+
string PASSWORD = "hunter2"
40+
# As determined by Edward J. Goodwin
41+
float32 PI = 3.0
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="3">
4+
<name>rclrs_example_msgs</name>
5+
<version>0.4.1</version>
6+
<description>A package containing some example message definitions.</description>
7+
<maintainer email="nnmmgit@gmail.com">Nikolai Morin</maintainer>
8+
<license>Apache License 2.0</license>
9+
10+
<buildtool_depend>ament_cmake</buildtool_depend>
11+
<buildtool_depend>rosidl_default_generators</buildtool_depend>
12+
13+
<exec_depend>rosidl_default_runtime</exec_depend>
14+
15+
<test_depend>ament_lint_common</test_depend>
16+
17+
<member_of_group>rosidl_interface_packages</member_of_group>
18+
19+
<export>
20+
<build_type>ament_cmake</build_type>
21+
</export>
22+
</package>

0 commit comments

Comments
 (0)