ROS 2 rclcpp + rcl - lyrical  lyrical
ROS 2 C++ Client Library with ROS Client Library
client.c
1 // Copyright 2016 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 #ifdef __cplusplus
16 extern "C"
17 {
18 #endif
19 
20 #include "rcl/client.h"
21 
22 #include <stdio.h>
23 #include <string.h>
24 
25 #include "rcl/error_handling.h"
26 #include "rcl/node.h"
27 #include "rcl/node_type_cache.h"
28 #include "rcl/publisher.h"
29 #include "rcl/time.h"
30 #include "rcutils/logging_macros.h"
31 #include "rcutils/macros.h"
32 #include "rcutils/stdatomic_helper.h"
33 #include "rmw/error_handling.h"
34 #include "rmw/rmw.h"
35 #include "service_msgs/msg/service_event_info.h"
36 #include "tracetools/tracetools.h"
37 
38 #include "rosidl_runtime_c/service_type_support_struct.h"
39 
40 #include "./common.h"
41 #include "./client_impl.h"
42 #include "./service_event_publisher.h"
43 
46 {
47  // All members are initialized to 0 or NULL by C99 6.7.8/10.
48  static rcl_client_t null_client;
49  return null_client;
50 }
51 
52 static
54 unconfigure_service_introspection(
55  rcl_node_t * node,
56  struct rcl_client_impl_s * client_impl,
57  rcl_allocator_t * allocator)
58 {
59  if (client_impl == NULL) {
60  return RCL_RET_ERROR;
61  }
62 
63  if (client_impl->service_event_publisher == NULL) {
64  return RCL_RET_OK;
65  }
66 
67  rcl_ret_t ret = rcl_service_event_publisher_fini(client_impl->service_event_publisher, node);
68 
69  allocator->deallocate(client_impl->service_event_publisher, allocator->state);
70  client_impl->service_event_publisher = NULL;
71 
72  return ret;
73 }
74 
77  rcl_client_t * client,
78  const rcl_node_t * node,
79  const rosidl_service_type_support_t * type_support,
80  const char * service_name,
81  const rcl_client_options_t * options)
82 {
83  // check the options and allocator first, so the allocator can be passed to errors
84  RCL_CHECK_ARGUMENT_FOR_NULL(options, RCL_RET_INVALID_ARGUMENT);
85  rcl_allocator_t * allocator = (rcl_allocator_t *)&options->allocator;
86  RCL_CHECK_ALLOCATOR_WITH_MSG(allocator, "invalid allocator", return RCL_RET_INVALID_ARGUMENT);
87  RCL_CHECK_ARGUMENT_FOR_NULL(client, RCL_RET_INVALID_ARGUMENT);
88  if (!rcl_node_is_valid(node)) {
89  return RCL_RET_NODE_INVALID; // error already set
90  }
91  RCL_CHECK_ARGUMENT_FOR_NULL(type_support, RCL_RET_INVALID_ARGUMENT);
92  RCL_CHECK_ARGUMENT_FOR_NULL(service_name, RCL_RET_INVALID_ARGUMENT);
93  RCUTILS_LOG_DEBUG_NAMED(
94  ROS_PACKAGE_NAME, "Initializing client for service name '%s'", service_name);
95  if (client->impl) {
96  RCL_SET_ERROR_MSG("client already initialized, or memory was unintialized");
97  return RCL_RET_ALREADY_INIT;
98  }
99 
100  // Allocate space for the implementation struct.
101  client->impl = (rcl_client_impl_t *)allocator->zero_allocate(
102  1, sizeof(rcl_client_impl_t), allocator->state);
103  RCL_CHECK_FOR_NULL_WITH_MSG(
104  client->impl, "allocating memory failed",
105  return RCL_RET_BAD_ALLOC;);
106 
107  // Expand the given service name.
109  node,
110  service_name,
111  *allocator,
112  true,
113  false,
114  &client->impl->remapped_service_name);
115  if (ret != RCL_RET_OK) {
118  } else if (RCL_RET_BAD_ALLOC != ret) {
119  ret = RCL_RET_ERROR;
120  }
121  goto free_client_impl;
122  }
123  RCUTILS_LOG_DEBUG_NAMED(
124  ROS_PACKAGE_NAME, "Expanded and remapped service name '%s'",
125  client->impl->remapped_service_name);
126 
127  // Fill out implementation struct.
128  // rmw handle (create rmw client)
129  // TODO(wjwwood): pass along the allocator to rmw when it supports it
130  client->impl->rmw_handle = rmw_create_client(
132  type_support,
133  client->impl->remapped_service_name,
134  &options->qos);
135  if (!client->impl->rmw_handle) {
136  RCL_SET_ERROR_MSG(rmw_get_error_string().str);
137  ret = RCL_RET_ERROR;
138  goto free_remapped_service_name;
139  }
140 
141  // get actual qos, and store it
142  rmw_ret_t rmw_ret = rmw_client_request_publisher_get_actual_qos(
143  client->impl->rmw_handle,
144  &client->impl->actual_request_publisher_qos);
145  if (RMW_RET_OK != rmw_ret) {
146  RCL_SET_ERROR_MSG(rmw_get_error_string().str);
147  ret = rcl_convert_rmw_ret_to_rcl_ret(rmw_ret);
148  goto destroy_client;
149  }
150 
151  rmw_ret = rmw_client_response_subscription_get_actual_qos(
152  client->impl->rmw_handle,
153  &client->impl->actual_response_subscription_qos);
154  if (RMW_RET_OK != rmw_ret) {
155  RCL_SET_ERROR_MSG(rmw_get_error_string().str);
156  ret = rcl_convert_rmw_ret_to_rcl_ret(rmw_ret);
157  goto destroy_client;
158  }
159 
160  // ROS specific namespacing conventions avoidance
161  // is not retrieved by get_actual_qos
162  client->impl->actual_request_publisher_qos.avoid_ros_namespace_conventions =
163  options->qos.avoid_ros_namespace_conventions;
164  client->impl->actual_response_subscription_qos.avoid_ros_namespace_conventions =
165  options->qos.avoid_ros_namespace_conventions;
166 
167  // options
168  client->impl->options = *options;
169  atomic_init(&client->impl->sequence_number, 0);
170  client->impl->in_use_by_waitset = false;
171 
172  const rosidl_type_hash_t * hash = type_support->get_type_hash_func(type_support);
173  if (hash == NULL) {
174  RCL_SET_ERROR_MSG("Failed to get the type hash");
176  goto destroy_client;
177  }
178 
179  if (RCL_RET_OK != rcl_node_type_cache_register_type(
180  node, hash, type_support->get_type_description_func(type_support),
181  type_support->get_type_description_sources_func(type_support)))
182  {
183  rcutils_reset_error();
184  RCL_SET_ERROR_MSG("Failed to register type for client");
185  ret = RCL_RET_ERROR;
186  goto destroy_client;
187  }
188  client->impl->type_hash = *hash;
189 
190  RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Client initialized");
191  TRACETOOLS_TRACEPOINT(
193  (const void *)client,
194  (const void *)node,
195  (const void *)client->impl->rmw_handle,
196  client->impl->remapped_service_name);
197 
198  return RCL_RET_OK;
199 
200 destroy_client:
201  rmw_ret = rmw_destroy_client(rcl_node_get_rmw_handle(node), client->impl->rmw_handle);
202  if (RMW_RET_OK != rmw_ret) {
203  RCUTILS_SAFE_FWRITE_TO_STDERR(rmw_get_error_string().str);
204  RCUTILS_SAFE_FWRITE_TO_STDERR("\n");
205  }
206 
207 free_remapped_service_name:
208  allocator->deallocate(client->impl->remapped_service_name, allocator->state);
209  client->impl->remapped_service_name = NULL;
210 
211 free_client_impl:
212  allocator->deallocate(client->impl, allocator->state);
213  client->impl = NULL;
214 
215  return ret;
216 }
217 
218 rcl_ret_t
220 {
221  RCUTILS_CAN_RETURN_WITH_ERROR_OF(RCL_RET_INVALID_ARGUMENT);
222  RCUTILS_CAN_RETURN_WITH_ERROR_OF(RCL_RET_NODE_INVALID);
223  RCUTILS_CAN_RETURN_WITH_ERROR_OF(RCL_RET_ERROR);
224 
225  RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Finalizing client");
226  rcl_ret_t result = RCL_RET_OK;
227  RCL_CHECK_ARGUMENT_FOR_NULL(client, RCL_RET_INVALID_ARGUMENT);
229  return RCL_RET_NODE_INVALID; // error already set
230  }
231 
232  if (client->impl) {
233  rcl_allocator_t allocator = client->impl->options.allocator;
234  rmw_node_t * rmw_node = rcl_node_get_rmw_handle(node);
235  if (!rmw_node) {
237  }
238 
239  rcl_ret_t rcl_ret = unconfigure_service_introspection(node, client->impl, &allocator);
240  if (RCL_RET_OK != rcl_ret) {
241  RCL_SET_ERROR_MSG(rcl_get_error_string().str);
242  result = rcl_ret;
243  }
244 
245  rmw_ret_t ret = rmw_destroy_client(rmw_node, client->impl->rmw_handle);
246  if (ret != RMW_RET_OK) {
247  RCL_SET_ERROR_MSG(rmw_get_error_string().str);
248  result = RCL_RET_ERROR;
249  }
250 
251  if (
252  ROSIDL_TYPE_HASH_VERSION_UNSET != client->impl->type_hash.version &&
253  RCL_RET_OK != rcl_node_type_cache_unregister_type(node, &client->impl->type_hash))
254  {
255  RCUTILS_SAFE_FWRITE_TO_STDERR(rcl_get_error_string().str);
256  result = RCL_RET_ERROR;
257  }
258 
259  allocator.deallocate(client->impl->remapped_service_name, allocator.state);
260  client->impl->remapped_service_name = NULL;
261 
262  allocator.deallocate(client->impl, allocator.state);
263  client->impl = NULL;
264  }
265  RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Client finalized");
266  return result;
267 }
268 
271 {
272  // !!! MAKE SURE THAT CHANGES TO THESE DEFAULTS ARE REFLECTED IN THE HEADER DOC STRING
273  rcl_client_options_t default_options;
274  // Must set the allocator and qos after because they are not a compile time constant.
275  default_options.qos = rmw_qos_profile_services_default;
276  default_options.allocator = rcl_get_default_allocator();
277  return default_options;
278 }
279 
280 const char *
282 {
283  if (!rcl_client_is_valid(client)) {
284  return NULL; // error already set
285  }
286  return client->impl->rmw_handle->service_name;
287 }
288 
289 const rcl_client_options_t *
291 {
292  if (!rcl_client_is_valid(client)) {
293  return NULL; // error already set
294  }
295  return &client->impl->options;
296 }
297 
298 rmw_client_t *
300 {
301  if (!rcl_client_is_valid(client)) {
302  return NULL; // error already set
303  }
304  return client->impl->rmw_handle;
305 }
306 
307 rcl_ret_t
308 rcl_send_request(const rcl_client_t * client, const void * ros_request, int64_t * sequence_number)
309 {
310  RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Client sending service request");
311  if (!rcl_client_is_valid(client)) {
312  return RCL_RET_CLIENT_INVALID; // error already set
313  }
314  RCL_CHECK_ARGUMENT_FOR_NULL(ros_request, RCL_RET_INVALID_ARGUMENT);
315  RCL_CHECK_ARGUMENT_FOR_NULL(sequence_number, RCL_RET_INVALID_ARGUMENT);
316  *sequence_number = rcutils_atomic_load_int64_t(&client->impl->sequence_number);
317  if (rmw_send_request(
318  client->impl->rmw_handle, ros_request, sequence_number) != RMW_RET_OK)
319  {
320  RCL_SET_ERROR_MSG(rmw_get_error_string().str);
321  return RCL_RET_ERROR;
322  }
323  rcutils_atomic_exchange_int64_t(&client->impl->sequence_number, *sequence_number);
324 
325  if (client->impl->service_event_publisher != NULL) {
326  rmw_gid_t gid;
327  rmw_ret_t rmw_ret = rmw_get_gid_for_client(client->impl->rmw_handle, &gid);
328  if (rmw_ret != RMW_RET_OK) {
329  RCL_SET_ERROR_MSG(rmw_get_error_string().str);
330  return rcl_convert_rmw_ret_to_rcl_ret(rmw_ret);
331  }
332  rcl_ret_t ret = rcl_send_service_event_message(
333  client->impl->service_event_publisher,
334  service_msgs__msg__ServiceEventInfo__REQUEST_SENT,
335  ros_request,
336  *sequence_number,
337  gid.data);
338  if (RCL_RET_OK != ret) {
339  RCL_SET_ERROR_MSG(rcl_get_error_string().str);
340  return ret;
341  }
342  }
343  return RCL_RET_OK;
344 }
345 
346 rcl_ret_t
348  const rcl_client_t * client,
349  rmw_service_info_t * request_header,
350  void * ros_response)
351 {
352  RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Client taking service response");
353  if (!rcl_client_is_valid(client)) {
354  return RCL_RET_CLIENT_INVALID; // error already set
355  }
356 
357  RCL_CHECK_ARGUMENT_FOR_NULL(request_header, RCL_RET_INVALID_ARGUMENT);
358  RCL_CHECK_ARGUMENT_FOR_NULL(ros_response, RCL_RET_INVALID_ARGUMENT);
359 
360  bool taken = false;
361  request_header->source_timestamp = 0;
362  request_header->received_timestamp = 0;
363  if (rmw_take_response(
364  client->impl->rmw_handle, request_header, ros_response, &taken) != RMW_RET_OK)
365  {
366  RCL_SET_ERROR_MSG(rmw_get_error_string().str);
367  return RCL_RET_ERROR;
368  }
369  RCUTILS_LOG_DEBUG_NAMED(
370  ROS_PACKAGE_NAME, "Client take response succeeded: %s", taken ? "true" : "false");
371  if (!taken) {
373  }
374 
375  if (client->impl->service_event_publisher != NULL) {
376  rmw_gid_t gid;
377  rmw_ret_t rmw_ret = rmw_get_gid_for_client(client->impl->rmw_handle, &gid);
378  if (rmw_ret != RMW_RET_OK) {
379  RCL_SET_ERROR_MSG(rmw_get_error_string().str);
380  return rcl_convert_rmw_ret_to_rcl_ret(rmw_ret);
381  }
382  rcl_ret_t ret = rcl_send_service_event_message(
383  client->impl->service_event_publisher,
384  service_msgs__msg__ServiceEventInfo__RESPONSE_RECEIVED,
385  ros_response,
386  request_header->request_id.sequence_number,
387  gid.data);
388  if (RCL_RET_OK != ret) {
389  RCL_SET_ERROR_MSG(rcl_get_error_string().str);
390  return ret;
391  }
392  }
393  return RCL_RET_OK;
394 }
395 
396 rcl_ret_t
398  const rcl_client_t * client,
399  rmw_request_id_t * request_header,
400  void * ros_response)
401 {
402  rmw_service_info_t header;
403  header.request_id = *request_header;
404  rcl_ret_t ret = rcl_take_response_with_info(client, &header, ros_response);
405  *request_header = header.request_id;
406  return ret;
407 }
408 
409 bool
411 {
412  RCL_CHECK_FOR_NULL_WITH_MSG(client, "client pointer is invalid", return false);
413  RCL_CHECK_FOR_NULL_WITH_MSG(
414  client->impl, "client's rmw implementation is invalid", return false);
415  RCL_CHECK_FOR_NULL_WITH_MSG(
416  client->impl->rmw_handle, "client's rmw handle is invalid", return false);
417  return true;
418 }
419 
420 const rmw_qos_profile_t *
422 {
423  if (!rcl_client_is_valid(client)) {
424  return NULL;
425  }
426  return &client->impl->actual_request_publisher_qos;
427 }
428 
429 const rmw_qos_profile_t *
431 {
432  if (!rcl_client_is_valid(client)) {
433  return NULL;
434  }
435  return &client->impl->actual_response_subscription_qos;
436 }
437 
438 rcl_ret_t
440  const rcl_client_t * client,
441  rcl_event_callback_t callback,
442  const void * user_data)
443 {
444  if (!rcl_client_is_valid(client)) {
445  // error state already set
447  }
448 
449  return rmw_client_set_on_new_response_callback(
450  client->impl->rmw_handle,
451  callback,
452  user_data);
453 }
454 
455 rcl_ret_t
457  rcl_client_t * client,
458  rcl_node_t * node,
459  rcl_clock_t * clock,
460  const rosidl_service_type_support_t * type_support,
461  const rcl_publisher_options_t publisher_options,
462  rcl_service_introspection_state_t introspection_state)
463 {
464  if (!rcl_client_is_valid(client)) {
465  return RCL_RET_CLIENT_INVALID; // error already set
466  }
467  RCL_CHECK_ARGUMENT_FOR_NULL(node, RCL_RET_INVALID_ARGUMENT);
468  RCL_CHECK_ARGUMENT_FOR_NULL(clock, RCL_RET_INVALID_ARGUMENT);
469  RCL_CHECK_ARGUMENT_FOR_NULL(type_support, RCL_RET_INVALID_ARGUMENT);
470 
471  rcl_allocator_t allocator = client->impl->options.allocator;
472 
473  if (introspection_state == RCL_SERVICE_INTROSPECTION_OFF) {
474  return unconfigure_service_introspection(node, client->impl, &allocator);
475  }
476 
477  if (client->impl->service_event_publisher == NULL) {
478  // We haven't been introspecting, so we need to allocate the service event publisher
479 
480  client->impl->service_event_publisher = allocator.allocate(
481  sizeof(rcl_service_event_publisher_t), allocator.state);
482  RCL_CHECK_FOR_NULL_WITH_MSG(
483  client->impl->service_event_publisher, "allocating memory failed", return RCL_RET_BAD_ALLOC;);
484 
485  *client->impl->service_event_publisher = rcl_get_zero_initialized_service_event_publisher();
486  rcl_ret_t ret = rcl_service_event_publisher_init(
487  client->impl->service_event_publisher, node, clock, publisher_options,
488  client->impl->remapped_service_name, type_support);
489  if (RCL_RET_OK != ret) {
490  allocator.deallocate(client->impl->service_event_publisher, allocator.state);
491  client->impl->service_event_publisher = NULL;
492  return ret;
493  }
494  }
495 
496  return rcl_service_event_publisher_change_state(
497  client->impl->service_event_publisher, introspection_state);
498 }
499 
500 #ifdef __cplusplus
501 }
502 #endif
#define rcl_get_default_allocator
Return a properly initialized rcl_allocator_t with default values.
Definition: allocator.h:37
#define RCL_CHECK_ALLOCATOR_WITH_MSG(allocator, msg, fail_statement)
Check that the given allocator is initialized, or fail with a message.
Definition: allocator.h:56
rcutils_allocator_t rcl_allocator_t
Encapsulation of an allocator.
Definition: allocator.h:31
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_take_response_with_info(const rcl_client_t *client, rmw_service_info_t *request_header, void *ros_response)
Take a ROS response using a client.
Definition: client.c:347
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_client_configure_service_introspection(rcl_client_t *client, rcl_node_t *node, rcl_clock_t *clock, const rosidl_service_type_support_t *type_support, const rcl_publisher_options_t publisher_options, rcl_service_introspection_state_t introspection_state)
Configures service introspection features for the client.
Definition: client.c:456
RCL_PUBLIC RCL_WARN_UNUSED const rmw_qos_profile_t * rcl_client_request_publisher_get_actual_qos(const rcl_client_t *client)
Get the actual qos settings of the client's request publisher.
Definition: client.c:421
RCL_PUBLIC RCL_WARN_UNUSED const char * rcl_client_get_service_name(const rcl_client_t *client)
Get the name of the service that this client will request a response from.
Definition: client.c:281
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_client_fini(rcl_client_t *client, rcl_node_t *node)
Finalize a rcl_client_t.
Definition: client.c:219
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_client_init(rcl_client_t *client, const rcl_node_t *node, const rosidl_service_type_support_t *type_support, const char *service_name, const rcl_client_options_t *options)
Initialize a rcl client.
Definition: client.c:76
RCL_PUBLIC RCL_WARN_UNUSED rcl_client_options_t rcl_client_get_default_options(void)
Return the default client options in a rcl_client_options_t.
Definition: client.c:270
RCL_PUBLIC RCL_WARN_UNUSED rmw_client_t * rcl_client_get_rmw_handle(const rcl_client_t *client)
Return the rmw client handle.
Definition: client.c:299
RCL_PUBLIC RCL_WARN_UNUSED rcl_client_t rcl_get_zero_initialized_client(void)
Return a rcl_client_t struct with members set to NULL.
Definition: client.c:45
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_take_response(const rcl_client_t *client, rmw_request_id_t *request_header, void *ros_response)
backwards compatibility function that takes a rmw_request_id_t only
Definition: client.c:397
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_client_set_on_new_response_callback(const rcl_client_t *client, rcl_event_callback_t callback, const void *user_data)
Set the on new response callback function for the client.
Definition: client.c:439
RCL_PUBLIC bool rcl_client_is_valid(const rcl_client_t *client)
Check that the client is valid.
Definition: client.c:410
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_send_request(const rcl_client_t *client, const void *ros_request, int64_t *sequence_number)
Send a ROS request using a client.
Definition: client.c:308
RCL_PUBLIC RCL_WARN_UNUSED const rmw_qos_profile_t * rcl_client_response_subscription_get_actual_qos(const rcl_client_t *client)
Get the actual qos settings of the client's response subscription.
Definition: client.c:430
RCL_PUBLIC RCL_WARN_UNUSED const rcl_client_options_t * rcl_client_get_options(const rcl_client_t *client)
Return the rcl client options.
Definition: client.c:290
RCL_PUBLIC bool rcl_node_is_valid(const rcl_node_t *node)
Return true if the node is valid, else false.
Definition: node.c:402
RCL_PUBLIC RCL_WARN_UNUSED rmw_node_t * rcl_node_get_rmw_handle(const rcl_node_t *node)
Return the rmw node handle.
Definition: node.c:466
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_node_resolve_name(const rcl_node_t *node, const char *input_name, rcl_allocator_t allocator, bool is_service, bool only_expand, char **output_name)
Expand a given name into a fully-qualified topic name and apply remapping rules.
RCL_PUBLIC bool rcl_node_is_valid_except_context(const rcl_node_t *node)
Return true if node is valid, except for the context being valid.
Definition: node.c:392
Options available for a rcl_client_t.
Definition: client.h:50
rcl_allocator_t allocator
Custom allocator for the client, used for incidental allocations.
Definition: client.h:55
rmw_qos_profile_t qos
Middleware quality of service settings for the client.
Definition: client.h:52
Structure which encapsulates a ROS Client.
Definition: client.h:43
rcl_client_impl_t * impl
Pointer to the client implementation.
Definition: client.h:45
Encapsulation of a time source.
Definition: time.h:138
Structure which encapsulates a ROS Node.
Definition: node.h:45
Options available for a rcl publisher.
Definition: publisher.h:44
#define RCL_RET_CLIENT_INVALID
Invalid rcl_client_t given return code.
Definition: types.h:79
#define RCL_RET_CLIENT_TAKE_FAILED
Failed to take a response from the client return code.
Definition: types.h:81
#define RCL_RET_UNKNOWN_SUBSTITUTION
Topic name substitution is unknown.
Definition: types.h:51
#define RCL_RET_SERVICE_NAME_INVALID
Service name (same as topic name) does not pass validation.
Definition: types.h:49
#define RCL_RET_ALREADY_INIT
rcl_init() already called return code.
Definition: types.h:41
#define RCL_RET_OK
Success return code.
Definition: types.h:27
#define RCL_RET_BAD_ALLOC
Failed to allocate memory return code.
Definition: types.h:33
#define RCL_RET_INVALID_ARGUMENT
Invalid argument return code.
Definition: types.h:35
#define RCL_RET_ERROR
Unspecified error return code.
Definition: types.h:29
#define RCL_RET_NODE_INVALID
Invalid rcl_node_t given return code.
Definition: types.h:59
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.
Definition: types.h:24