rcl  master
C API providing common ROS client library functionality.
node.h
Go to the documentation of this file.
1 // Copyright 2015 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__NODE_H_
16 #define RCL__NODE_H_
17 
18 #ifdef __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include <stdint.h>
24 
25 #include "rcl/allocator.h"
26 #include "rcl/arguments.h"
27 #include "rcl/context.h"
28 #include "rcl/macros.h"
29 #include "rcl/types.h"
30 #include "rcl/visibility_control.h"
31 
33 #define RCL_NODE_OPTIONS_DEFAULT_DOMAIN_ID SIZE_MAX
34 
36 struct rcl_node_impl_t;
37 
39 typedef struct rcl_node_t
40 {
43 
45  struct rcl_node_impl_t * impl;
46 } rcl_node_t;
47 
49 typedef struct rcl_node_options_t
50 {
51  // bool anonymous_name;
52 
53  // rmw_qos_profile_t parameter_qos;
54 
56  // bool no_parameters;
57 
59 
69  size_t domain_id;
70 
73 
76 
80 
82 
93 
99 
101 
188 rcl_ret_t
190  rcl_node_t * node,
191  const char * name,
192  const char * namespace_,
194  const rcl_node_options_t * options);
195 
197 
221 rcl_ret_t
222 rcl_node_fini(rcl_node_t * node);
223 
225 
244 rcl_ret_t
246  const rcl_node_options_t * options,
247  rcl_node_options_t * options_out);
248 
250 
285 bool
286 rcl_node_is_valid(const rcl_node_t * node);
287 
289 
298 bool
300 
302 
325 const char *
326 rcl_node_get_name(const rcl_node_t * node);
327 
329 
352 const char *
353 rcl_node_get_namespace(const rcl_node_t * node);
354 
356 
379 const rcl_node_options_t *
380 rcl_node_get_options(const rcl_node_t * node);
381 
383 
412 rcl_ret_t
413 rcl_node_get_domain_id(const rcl_node_t * node, size_t * domain_id);
414 
416 
443 rmw_node_t *
444 rcl_node_get_rmw_handle(const rcl_node_t * node);
445 
447 
472 uint64_t
474 
476 
505 const struct rcl_guard_condition_t *
507 
509 
532 const char *
534 
535 #ifdef __cplusplus
536 }
537 #endif
538 
539 #endif // RCL__NODE_H_
uint64_t rcl_node_get_rcl_instance_id(const rcl_node_t *node)
Return the associated rcl instance id.
rmw_ret_t rcl_ret_t
Definition: types.h:20
struct rcl_node_options_t rcl_node_options_t
Structure which encapsulates the options for creating a rcl_node_t.
const char * rcl_node_get_logger_name(const rcl_node_t *node)
Return the logger name of the node.
Hold output of parsing command line arguments.
Definition: arguments.h:31
rcl_context_t * context
Context associated with this node.
Definition: node.h:42
rcl_ret_t rcl_node_get_domain_id(const rcl_node_t *node, size_t *domain_id)
Return the ROS domain ID that the node is using.
size_t domain_id
If true, no parameter infrastructure will be setup.
Definition: node.h:69
rcl_arguments_t arguments
Command line arguments that apply only to this node.
Definition: node.h:78
const rcl_node_options_t * rcl_node_get_options(const rcl_node_t *node)
Return the rcl node options.
bool rcl_node_is_valid(const rcl_node_t *node)
Return true if the node is valid, else false.
rcl_ret_t rcl_node_init(rcl_node_t *node, const char *name, const char *namespace_, rcl_context_t *context, const rcl_node_options_t *options)
Initialize a ROS node.
bool use_global_arguments
If false then only use arguments in this struct, otherwise use global arguments also.
Definition: node.h:75
#define RCL_WARN_UNUSED
Ignored return values of functions with this macro will emit a warning.
Definition: macros.h:25
struct rcl_node_impl_t * impl
Private implementation pointer.
Definition: node.h:45
#define RCL_PUBLIC
Definition: visibility_control.h:48
rcl_node_options_t rcl_node_get_default_options(void)
Return the default node options in a rcl_node_options_t.
rcl_ret_t rcl_node_options_copy(const rcl_node_options_t *options, rcl_node_options_t *options_out)
Copy one options structure into another.
bool rcl_node_is_valid_except_context(const rcl_node_t *node)
Return true if node is valid, except for the context being valid.
rcl_allocator_t allocator
Custom allocator used for internal allocations.
Definition: node.h:72
rmw_node_t * rcl_node_get_rmw_handle(const rcl_node_t *node)
Return the rmw node handle.
Structure which encapsulates the options for creating a rcl_node_t.
Definition: node.h:49
const char * rcl_node_get_name(const rcl_node_t *node)
Return the name of the node.
const char * rcl_node_get_namespace(const rcl_node_t *node)
Return the namespace of the node.
Encapsulates the non-global state of an init/shutdown cycle.
Definition: context.h:108
const struct rcl_guard_condition_t * rcl_node_get_graph_guard_condition(const rcl_node_t *node)
Return a guard condition which is triggered when the ROS graph changes.
rcl_ret_t rcl_node_fini(rcl_node_t *node)
Finalize a rcl_node_t.
struct rcl_node_t rcl_node_t
Structure which encapsulates a ROS Node.
Handle for a rcl guard condition.
Definition: guard_condition.h:33
Structure which encapsulates a ROS Node.
Definition: node.h:39
rcl_node_t rcl_get_zero_initialized_node(void)
Return a rcl_node_t struct with members initialized to NULL.