rmw  master
C API providing a middleware abstraction layer which is used to implement the rest of ROS.
rmw.h
Go to the documentation of this file.
1 // Copyright 2014-2017 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
76 #ifndef RMW__RMW_H_
77 #define RMW__RMW_H_
78 
79 #if __cplusplus
80 extern "C"
81 {
82 #endif
83 
84 #include <stdbool.h>
85 #include <stddef.h>
86 #include <stdint.h>
87 
88 #include "rcutils/types.h"
89 
90 #include "rosidl_generator_c/message_type_support_struct.h"
91 #include "rosidl_generator_c/service_type_support_struct.h"
92 
93 #include "rmw/macros.h"
94 #include "rmw/qos_profiles.h"
95 #include "rmw/types.h"
96 #include "rmw/visibility_control.h"
97 
100 const char *
102 
105 rmw_ret_t
106 rmw_init(void);
107 
110 rmw_node_t *
112  const char * name,
113  const char * namespace_,
114  size_t domain_id,
115  const rmw_node_security_options_t * security_options);
116 
119 rmw_ret_t
121 
123 
152 const rmw_guard_condition_t *
154 
159  const rmw_node_t * node,
160  const rosidl_message_type_support_t * type_support,
161  const char * topic_name,
162  const rmw_qos_profile_t * qos_policies);
163 
166 rmw_ret_t
168 
171 rmw_ret_t
172 rmw_publish(const rmw_publisher_t * publisher, const void * ros_message);
173 
178  const rmw_node_t * node,
179  const rosidl_message_type_support_t * type_support,
180  const char * topic_name,
181  const rmw_qos_profile_t * qos_policies,
182  bool ignore_local_publications);
183 
186 rmw_ret_t
188 
191 rmw_ret_t
192 rmw_take(const rmw_subscription_t * subscription, void * ros_message, bool * taken);
193 
196 rmw_ret_t
198  const rmw_subscription_t * subscription,
199  void * ros_message,
200  bool * taken,
201  rmw_message_info_t * message_info);
202 
205 rmw_client_t *
207  const rmw_node_t * node,
208  const rosidl_service_type_support_t * type_support,
209  const char * service_name,
210  const rmw_qos_profile_t * qos_policies);
211 
214 rmw_ret_t
215 rmw_destroy_client(rmw_node_t * node, rmw_client_t * client);
216 
219 rmw_ret_t
221  const rmw_client_t * client,
222  const void * ros_request,
223  int64_t * sequence_id);
224 
227 rmw_ret_t
229  const rmw_client_t * client,
230  rmw_request_id_t * request_header,
231  void * ros_response,
232  bool * taken);
233 
238  const rmw_node_t * node,
239  const rosidl_service_type_support_t * type_support,
240  const char * service_name,
241  const rmw_qos_profile_t * qos_policies);
242 
245 rmw_ret_t
246 rmw_destroy_service(rmw_node_t * node, rmw_service_t * service);
247 
250 rmw_ret_t
252  const rmw_service_t * service,
253  rmw_request_id_t * request_header,
254  void * ros_request,
255  bool * taken);
256 
259 rmw_ret_t
261  const rmw_service_t * service,
262  rmw_request_id_t * request_header,
263  void * ros_response);
264 
269 
272 rmw_ret_t
274 
277 rmw_ret_t
278 rmw_trigger_guard_condition(const rmw_guard_condition_t * guard_condition);
279 
281 
293 rmw_create_wait_set(size_t max_conditions);
294 
297 rmw_ret_t
299 
301 
336 rmw_ret_t
337 rmw_wait(
338  rmw_subscriptions_t * subscriptions,
339  rmw_guard_conditions_t * guard_conditions,
340  rmw_services_t * services,
341  rmw_clients_t * clients,
342  rmw_wait_set_t * wait_set,
343  const rmw_time_t * wait_timeout);
344 
347 rmw_ret_t
349  const rmw_node_t * node,
350  rcutils_string_array_t * node_names);
351 
354 rmw_ret_t
356  const rmw_node_t * node,
357  const char * topic_name,
358  size_t * count);
359 
362 rmw_ret_t
364  const rmw_node_t * node,
365  const char * topic_name,
366  size_t * count);
367 
370 rmw_ret_t
371 rmw_get_gid_for_publisher(const rmw_publisher_t * publisher, rmw_gid_t * gid);
372 
375 rmw_ret_t
376 rmw_compare_gids_equal(const rmw_gid_t * gid1, const rmw_gid_t * gid2, bool * result);
377 
379 
407 rmw_ret_t
409  const rmw_node_t * node,
410  const rmw_client_t * client,
411  bool * is_available);
412 
413 #if __cplusplus
414 }
415 #endif
416 
417 #endif // RMW__RMW_H_
rmw_client_t * rmw_create_client(const rmw_node_t *node, const rosidl_service_type_support_t *type_support, const char *service_name, const rmw_qos_profile_t *qos_policies)
const rmw_guard_condition_t * rmw_node_get_graph_guard_condition(const rmw_node_t *node)
Return a guard condition which is triggered when the ROS graph changes.
rmw_guard_condition_t * rmw_create_guard_condition(void)
rmw_ret_t rmw_get_gid_for_publisher(const rmw_publisher_t *publisher, rmw_gid_t *gid)
#define RMW_PUBLIC
Definition: visibility_control.h:48
Definition: types.h:222
Array of service handles.
Definition: types.h:107
Array of subsciber handles.
Definition: types.h:92
#define RMW_WARN_UNUSED
Definition: macros.h:22
Definition: types.h:152
rmw_ret_t rmw_trigger_guard_condition(const rmw_guard_condition_t *guard_condition)
rmw_service_t * rmw_create_service(const rmw_node_t *node, const rosidl_service_type_support_t *type_support, const char *service_name, const rmw_qos_profile_t *qos_policies)
rmw_ret_t rmw_destroy_subscription(rmw_node_t *node, rmw_subscription_t *subscription)
const char * rmw_get_implementation_identifier(void)
rmw_subscription_t * rmw_create_subscription(const rmw_node_t *node, const rosidl_message_type_support_t *type_support, const char *topic_name, const rmw_qos_profile_t *qos_policies, bool ignore_local_publications)
int rmw_ret_t
Definition: types.h:29
rmw_ret_t rmw_destroy_client(rmw_node_t *node, rmw_client_t *client)
Definition: types.h:58
rmw_ret_t rmw_get_node_names(const rmw_node_t *node, rcutils_string_array_t *node_names)
rmw_ret_t rmw_take_request(const rmw_service_t *service, rmw_request_id_t *request_header, void *ros_request, bool *taken)
rmw_node_t * rmw_create_node(const char *name, const char *namespace_, size_t domain_id, const rmw_node_security_options_t *security_options)
rmw_ret_t rmw_count_subscribers(const rmw_node_t *node, const char *topic_name, size_t *count)
Definition: types.h:72
rmw_ret_t rmw_count_publishers(const rmw_node_t *node, const char *topic_name, size_t *count)
rmw_ret_t rmw_destroy_service(rmw_node_t *node, rmw_service_t *service)
rmw_ret_t rmw_wait(rmw_subscriptions_t *subscriptions, rmw_guard_conditions_t *guard_conditions, rmw_services_t *services, rmw_clients_t *clients, rmw_wait_set_t *wait_set, const rmw_time_t *wait_timeout)
Waits on sets of different waitable entities and returns when one is ready.
Definition: types.h:216
rmw_ret_t rmw_take_response(const rmw_client_t *client, rmw_request_id_t *request_header, void *ros_response, bool *taken)
rmw_ret_t rmw_destroy_wait_set(rmw_wait_set_t *wait_set)
rmw_publisher_t * rmw_create_publisher(const rmw_node_t *node, const rosidl_message_type_support_t *type_support, const char *topic_name, const rmw_qos_profile_t *qos_policies)
rmw_ret_t rmw_destroy_guard_condition(rmw_guard_condition_t *guard_condition)
rmw_ret_t rmw_destroy_publisher(rmw_node_t *node, rmw_publisher_t *publisher)
Definition: types.h:145
rmw_ret_t rmw_destroy_node(rmw_node_t *node)
rmw_ret_t rmw_publish(const rmw_publisher_t *publisher, const void *ros_message)
Definition: types.h:158
rmw_ret_t rmw_init(void)
Definition: types.h:79
Definition: types.h:65
Definition: types.h:170
Array of guard condition handles.
Definition: types.h:137
Definition: types.h:51
rmw_ret_t rmw_send_response(const rmw_service_t *service, rmw_request_id_t *request_header, void *ros_response)
rmw_ret_t rmw_take(const rmw_subscription_t *subscription, void *ros_message, bool *taken)
rmw_ret_t rmw_send_request(const rmw_client_t *client, const void *ros_request, int64_t *sequence_id)
Array of client handles.
Definition: types.h:122
rmw_ret_t rmw_take_with_info(const rmw_subscription_t *subscription, void *ros_message, bool *taken, rmw_message_info_t *message_info)
rmw_ret_t rmw_service_server_is_available(const rmw_node_t *node, const rmw_client_t *client, bool *is_available)
Check if a service server is available for the given service client.
rmw_ret_t rmw_compare_gids_equal(const rmw_gid_t *gid1, const rmw_gid_t *gid2, bool *result)
Definition: types.h:197
Definition: types.h:43
rmw_wait_set_t * rmw_create_wait_set(size_t max_conditions)
Create a wait set to store conditions that the middleware will block on.