rcl  master
C API providing common ROS client library functionality.
graph.h
Go to the documentation of this file.
1 // Copyright 2016-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 
15 #ifndef RCL__GRAPH_H_
16 #define RCL__GRAPH_H_
17 
18 #ifdef __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include <rmw/names_and_types.h>
25 
26 #include "rcutils/types.h"
27 
28 #include "rosidl_generator_c/service_type_support_struct.h"
29 
30 #include "rcl/macros.h"
31 #include "rcl/client.h"
32 #include "rcl/node.h"
33 #include "rcl/visibility_control.h"
34 
36 
37 #define rcl_get_zero_initialized_names_and_types rmw_get_zero_initialized_names_and_types
38 
40 
87  const rcl_node_t * node,
88  rcl_allocator_t * allocator,
89  bool no_demangle,
90  const char * node_name,
91  const char * node_namespace,
92  rcl_names_and_types_t * topic_names_and_types);
93 
95 
140 rcl_ret_t
142  const rcl_node_t * node,
143  rcl_allocator_t * allocator,
144  bool no_demangle,
145  const char * node_name,
146  const char * node_namespace,
147  rcl_names_and_types_t * topic_names_and_types);
148 
150 
194 rcl_ret_t
196  const rcl_node_t * node,
197  rcl_allocator_t * allocator,
198  const char * node_name,
199  const char * node_namespace,
200  rcl_names_and_types_t * service_names_and_types);
201 
203 
246 rcl_ret_t
248  const rcl_node_t * node,
249  rcl_allocator_t * allocator,
250  bool no_demangle,
251  rcl_names_and_types_t * topic_names_and_types);
252 
254 
289 rcl_ret_t
291  const rcl_node_t * node,
292  rcl_allocator_t * allocator,
293  rcl_names_and_types_t * service_names_and_types);
294 
296 
320 rcl_ret_t
321 rcl_names_and_types_fini(rcl_names_and_types_t * names_and_types);
322 
324 
373 rcl_ret_t
375  const rcl_node_t * node,
376  rcl_allocator_t allocator,
377  rcutils_string_array_t * node_names,
378  rcutils_string_array_t * node_namespaces);
379 
381 
421 rcl_ret_t
423  const rcl_node_t * node,
424  const char * topic_name,
425  size_t * count);
426 
428 
468 rcl_ret_t
470  const rcl_node_t * node,
471  const char * topic_name,
472  size_t * count);
473 
475 
511 rcl_ret_t
513  const rcl_node_t * node,
514  const rcl_client_t * client,
515  bool * is_available);
516 
517 #ifdef __cplusplus
518 }
519 #endif
520 
521 #endif // RCL__GRAPH_H_
rcl_ret_t rcl_get_service_names_and_types_by_node(const rcl_node_t *node, rcl_allocator_t *allocator, const char *node_name, const char *node_namespace, rcl_names_and_types_t *service_names_and_types)
Return a list of service names and their types per node.
rmw_ret_t rcl_ret_t
Definition: types.h:20
rcl_ret_t rcl_get_publisher_names_and_types_by_node(const rcl_node_t *node, rcl_allocator_t *allocator, bool no_demangle, const char *node_name, const char *node_namespace, rcl_names_and_types_t *topic_names_and_types)
Return a list of publisher topic names and their types per node.
rcl_ret_t rcl_get_node_names(const rcl_node_t *node, rcl_allocator_t allocator, rcutils_string_array_t *node_names, rcutils_string_array_t *node_namespaces)
Return a list of available nodes in the ROS graph.
rmw_names_and_types_t rcl_names_and_types_t
Definition: graph.h:35
Structure which encapsulates a ROS Client.
Definition: client.h:33
rcl_ret_t rcl_get_subscriber_names_and_types_by_node(const rcl_node_t *node, rcl_allocator_t *allocator, bool no_demangle, const char *node_name, const char *node_namespace, rcl_names_and_types_t *topic_names_and_types)
Return a list of subcriber topic names and their types per node.
#define RCL_WARN_UNUSED
Ignored return values of functions with this macro will emit a warning.
Definition: macros.h:25
rcl_ret_t rcl_count_publishers(const rcl_node_t *node, const char *topic_name, size_t *count)
Return the number of publishers on a given topic.
#define RCL_PUBLIC
Definition: visibility_control.h:48
rcl_ret_t rcl_service_server_is_available(const rcl_node_t *node, const rcl_client_t *client, bool *is_available)
Check if a service server is available for the given service client.
rcl_ret_t rcl_get_topic_names_and_types(const rcl_node_t *node, rcl_allocator_t *allocator, bool no_demangle, rcl_names_and_types_t *topic_names_and_types)
Return a list of topic names and their types.
rcl_ret_t rcl_count_subscribers(const rcl_node_t *node, const char *topic_name, size_t *count)
Return the number of subscriptions on a given topic.
rcl_ret_t rcl_names_and_types_fini(rcl_names_and_types_t *names_and_types)
Finalize a rcl_names_and_types_t object.
Structure which encapsulates a ROS Node.
Definition: node.h:39
rcl_ret_t rcl_get_service_names_and_types(const rcl_node_t *node, rcl_allocator_t *allocator, rcl_names_and_types_t *service_names_and_types)
Return a list of service names and their types.