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 #ifdef __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 
175 
189 rmw_ret_t
191  const rmw_publisher_t * publisher, const rmw_serialized_message_t * serialized_message);
192 
194 
208 rmw_ret_t
210  const void * ros_message,
211  const rosidl_message_type_support_t * type_support,
212  rmw_serialized_message_t * serialized_message);
213 
215 
232 rmw_ret_t
234  const rmw_serialized_message_t * serialized_message,
235  const rosidl_message_type_support_t * type_support,
236  void * ros_message);
237 
242  const rmw_node_t * node,
243  const rosidl_message_type_support_t * type_support,
244  const char * topic_name,
245  const rmw_qos_profile_t * qos_policies,
246  bool ignore_local_publications);
247 
250 rmw_ret_t
252 
255 rmw_ret_t
256 rmw_take(const rmw_subscription_t * subscription, void * ros_message, bool * taken);
257 
260 rmw_ret_t
262  const rmw_subscription_t * subscription,
263  void * ros_message,
264  bool * taken,
265  rmw_message_info_t * message_info);
266 
268 
285 rmw_ret_t
287  const rmw_subscription_t * subscription,
288  rmw_serialized_message_t * serialized_message,
289  bool * taken);
290 
292 
305 rmw_ret_t
307  const rmw_subscription_t * subscription,
308  rmw_serialized_message_t * serialized_message,
309  bool * taken,
310  rmw_message_info_t * message_info);
311 
314 rmw_client_t *
316  const rmw_node_t * node,
317  const rosidl_service_type_support_t * type_support,
318  const char * service_name,
319  const rmw_qos_profile_t * qos_policies);
320 
323 rmw_ret_t
324 rmw_destroy_client(rmw_node_t * node, rmw_client_t * client);
325 
328 rmw_ret_t
330  const rmw_client_t * client,
331  const void * ros_request,
332  int64_t * sequence_id);
333 
336 rmw_ret_t
338  const rmw_client_t * client,
339  rmw_request_id_t * request_header,
340  void * ros_response,
341  bool * taken);
342 
347  const rmw_node_t * node,
348  const rosidl_service_type_support_t * type_support,
349  const char * service_name,
350  const rmw_qos_profile_t * qos_policies);
351 
354 rmw_ret_t
355 rmw_destroy_service(rmw_node_t * node, rmw_service_t * service);
356 
359 rmw_ret_t
361  const rmw_service_t * service,
362  rmw_request_id_t * request_header,
363  void * ros_request,
364  bool * taken);
365 
368 rmw_ret_t
370  const rmw_service_t * service,
371  rmw_request_id_t * request_header,
372  void * ros_response);
373 
378 
381 rmw_ret_t
383 
386 rmw_ret_t
387 rmw_trigger_guard_condition(const rmw_guard_condition_t * guard_condition);
388 
390 
402 rmw_create_wait_set(size_t max_conditions);
403 
406 rmw_ret_t
408 
410 
445 rmw_ret_t
446 rmw_wait(
447  rmw_subscriptions_t * subscriptions,
448  rmw_guard_conditions_t * guard_conditions,
449  rmw_services_t * services,
450  rmw_clients_t * clients,
451  rmw_wait_set_t * wait_set,
452  const rmw_time_t * wait_timeout);
453 
456 rmw_ret_t
458  const rmw_node_t * node,
459  rcutils_string_array_t * node_names);
460 
463 rmw_ret_t
465  const rmw_node_t * node,
466  const char * topic_name,
467  size_t * count);
468 
471 rmw_ret_t
473  const rmw_node_t * node,
474  const char * topic_name,
475  size_t * count);
476 
479 rmw_ret_t
480 rmw_get_gid_for_publisher(const rmw_publisher_t * publisher, rmw_gid_t * gid);
481 
484 rmw_ret_t
485 rmw_compare_gids_equal(const rmw_gid_t * gid1, const rmw_gid_t * gid2, bool * result);
486 
488 
516 rmw_ret_t
518  const rmw_node_t * node,
519  const rmw_client_t * client,
520  bool * is_available);
521 
524 rmw_ret_t
526 
527 #ifdef __cplusplus
528 }
529 #endif
530 
531 #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_ret_t rmw_set_log_severity(rmw_log_severity_t severity)
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:234
rmw_ret_t rmw_publish_serialized_message(const rmw_publisher_t *publisher, const rmw_serialized_message_t *serialized_message)
Publish an already serialized message.
Array of service handles.
Definition: types.h:110
Definition: types.h:225
enum RWM_PUBLIC_TYPE rmw_log_severity_t
Array of subsciber handles.
Definition: types.h:95
#define RMW_WARN_UNUSED
Definition: macros.h:22
Definition: types.h:155
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:32
rmw_ret_t rmw_destroy_client(rmw_node_t *node, rmw_client_t *client)
Definition: types.h:61
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:75
rmw_ret_t rmw_take_serialized_message(const rmw_subscription_t *subscription, rmw_serialized_message_t *serialized_message, bool *taken)
Take a message without deserializing it.
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:219
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_serialize(const void *ros_message, const rosidl_message_type_support_t *type_support, rmw_serialized_message_t *serialized_message)
Serialize a ROS message into a rmw_serialized_message_t.
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:148
rmw_ret_t rmw_destroy_node(rmw_node_t *node)
rmw_ret_t rmw_take_serialized_message_with_info(const rmw_subscription_t *subscription, rmw_serialized_message_t *serialized_message, bool *taken, rmw_message_info_t *message_info)
Take a message without deserializing it and with its additional message information.
rmw_ret_t rmw_publish(const rmw_publisher_t *publisher, const void *ros_message)
Definition: types.h:161
rmw_ret_t rmw_deserialize(const rmw_serialized_message_t *serialized_message, const rosidl_message_type_support_t *type_support, void *ros_message)
Deserialize a ROS message.
rmw_ret_t rmw_init(void)
Definition: types.h:82
Definition: types.h:68
Definition: types.h:173
Array of guard condition handles.
Definition: types.h:140
Definition: types.h:54
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:125
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:200
Definition: types.h:46
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.