|
13 | 13 |
|
14 | 14 | cfg_if::cfg_if! { |
15 | 15 | if #[cfg(feature="use_ros_shim")] { |
16 | | - #[repr(C)] |
17 | | - #[derive(Debug)] |
18 | | - pub struct rcl_allocator_t; |
| 16 | + include!( |
| 17 | + concat!( |
| 18 | + env!("CARGO_MANIFEST_DIR"), |
| 19 | + "/src/rcl_bindings_generated_", |
| 20 | + "rolling", // rolling will always be a valid ROS distro |
| 21 | + ".rs", |
| 22 | + ) |
| 23 | + ); |
19 | 24 |
|
20 | | - #[repr(C)] |
21 | | - #[derive(Debug)] |
22 | | - pub struct rcl_arguments_t; |
23 | | - |
24 | | - #[repr(C)] |
25 | | - #[derive(Debug)] |
26 | | - pub struct rcl_client_t; |
27 | | - |
28 | | - #[repr(C)] |
29 | | - #[derive(Debug)] |
30 | | - pub struct rcl_clock_t; |
31 | | - |
32 | | - #[repr(C)] |
33 | | - #[derive(Debug)] |
34 | | - pub struct rcl_clock_type_t; |
35 | | - |
36 | | - #[repr(C)] |
37 | | - #[derive(Debug)] |
38 | | - pub struct rcl_context_t; |
39 | | - |
40 | | - #[repr(C)] |
41 | | - #[derive(Debug)] |
42 | | - pub struct rcl_guard_condition_t; |
43 | | - |
44 | | - #[repr(C)] |
45 | | - #[derive(Debug)] |
46 | | - pub struct rcl_names_and_types_t; |
47 | | - |
48 | | - #[repr(C)] |
49 | | - #[derive(Debug)] |
50 | | - pub struct rcl_node_options_t; |
51 | | - |
52 | | - #[repr(C)] |
53 | | - #[derive(Debug)] |
54 | | - pub struct rcl_node_params_t; |
55 | | - |
56 | | - #[repr(C)] |
57 | | - #[derive(Debug)] |
58 | | - pub struct rcl_node_t; |
59 | | - |
60 | | - #[repr(C)] |
61 | | - #[derive(Debug)] |
62 | | - pub struct rcl_params_t; |
63 | | - |
64 | | - #[repr(C)] |
65 | | - #[derive(Debug)] |
66 | | - pub struct rcl_publisher_t; |
67 | | - |
68 | | - #[repr(C)] |
69 | | - #[derive(Debug)] |
70 | | - pub struct rcl_ret_t; |
71 | | - |
72 | | - #[repr(C)] |
73 | | - #[derive(Debug)] |
74 | | - pub struct rcl_service_t; |
75 | | - |
76 | | - #[repr(C)] |
77 | | - #[derive(Debug)] |
78 | | - pub struct rcl_subscription_t; |
79 | | - |
80 | | - #[repr(C)] |
81 | | - #[derive(Debug)] |
82 | | - pub struct rcl_topic_endpoint_info_array_t; |
83 | | - |
84 | | - #[repr(C)] |
85 | | - #[derive(Debug)] |
86 | | - pub struct rcl_variant_t; |
87 | | - |
88 | | - #[repr(C)] |
89 | | - #[derive(Debug)] |
90 | | - pub struct rcl_wait_set_t; |
91 | | - |
92 | | - #[repr(C)] |
93 | | - #[derive(Debug)] |
94 | | - pub struct rcl_timer_t; |
95 | | - |
96 | | - #[repr(C)] |
97 | | - #[derive(Debug)] |
98 | | - pub struct rcutils_string_array_t; |
99 | | - |
100 | | - #[repr(C)] |
101 | | - #[derive(Debug)] |
102 | | - pub struct rmw_message_info_t; |
103 | | - |
104 | | - #[repr(C)] |
105 | | - #[derive(Debug)] |
106 | | - pub struct rmw_names_and_types_t; |
107 | | - |
108 | | - #[repr(C)] |
109 | | - #[derive(Debug)] |
110 | | - pub struct rmw_qos_durability_policy_t; |
111 | | - |
112 | | - #[repr(C)] |
113 | | - #[derive(Debug)] |
114 | | - pub struct rmw_qos_history_policy_t; |
115 | | - |
116 | | - #[repr(C)] |
117 | | - #[derive(Debug)] |
118 | | - pub struct rmw_qos_liveliness_policy_t; |
119 | | - |
120 | | - #[repr(C)] |
121 | | - #[derive(Debug)] |
122 | | - pub struct rmw_qos_profile_t; |
123 | | - |
124 | | - #[repr(C)] |
125 | | - #[derive(Debug)] |
126 | | - pub struct rmw_qos_reliability_policy_t; |
127 | | - |
128 | | - #[repr(C)] |
129 | | - #[derive(Debug)] |
130 | | - pub struct rmw_request_id_t; |
131 | | - |
132 | | - #[repr(C)] |
133 | | - #[derive(Debug)] |
134 | | - pub struct rmw_time_t; |
135 | | - |
136 | | - #[repr(C)] |
137 | | - #[derive(Debug)] |
138 | | - pub struct rmw_topic_endpoint_info_array_t; |
139 | | - |
140 | | - #[repr(C)] |
141 | | - #[derive(Debug)] |
142 | | - pub struct rosidl_message_type_support_t; |
143 | | - |
144 | | - pub const RMW_GID_STORAGE_SIZE: usize = 24; |
145 | | - |
146 | | - extern "C" { |
147 | | - pub fn rcl_context_is_valid(context: *const rcl_context_t) -> bool; |
148 | | - } |
149 | 25 | } else { |
150 | | - include!(concat!(env!("OUT_DIR"), "/rcl_bindings_generated.rs")); |
| 26 | + include!( |
| 27 | + concat!( |
| 28 | + env!("CARGO_MANIFEST_DIR"), |
| 29 | + "/src/rcl_bindings_generated_", |
| 30 | + env!("ROS_DISTRO"), |
| 31 | + ".rs", |
| 32 | + ) |
| 33 | + ); |
151 | 34 |
|
152 | 35 | pub const RMW_GID_STORAGE_SIZE: usize = rmw_gid_storage_size_constant; |
153 | 36 | } |
|
0 commit comments