rcl  master
C API providing common ROS client library functionality.
client.h
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 #ifndef RCL__CLIENT_H_
16 #define RCL__CLIENT_H_
17 
18 #ifdef __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include "rosidl_runtime_c/service_type_support_struct.h"
24 
25 #include "rcl/macros.h"
26 #include "rcl/node.h"
27 #include "rcl/visibility_control.h"
28 
30 struct rcl_client_impl_t;
31 
33 typedef struct rcl_client_t
34 {
36  struct rcl_client_impl_t * impl;
37 } rcl_client_t;
38 
40 typedef struct rcl_client_options_t
41 {
45 
48 
50 
54 RCL_PUBLIC
55 RCL_WARN_UNUSED
57 rcl_get_zero_initialized_client(void);
58 
60 
153 RCL_PUBLIC
154 RCL_WARN_UNUSED
155 rcl_ret_t
156 rcl_client_init(
157  rcl_client_t * client,
158  const rcl_node_t * node,
159  const rosidl_service_type_support_t * type_support,
160  const char * service_name,
161  const rcl_client_options_t * options);
162 
164 
184 RCL_PUBLIC
185 RCL_WARN_UNUSED
186 rcl_ret_t
187 rcl_client_fini(rcl_client_t * client, rcl_node_t * node);
188 
190 
196 RCL_PUBLIC
197 RCL_WARN_UNUSED
199 rcl_client_get_default_options(void);
200 
202 
245 RCL_PUBLIC
246 RCL_WARN_UNUSED
247 rcl_ret_t
248 rcl_send_request(const rcl_client_t * client, const void * ros_request, int64_t * sequence_number);
249 
250 
252 
286 RCL_PUBLIC
287 RCL_WARN_UNUSED
288 rcl_ret_t
289 rcl_take_response_with_info(
290  const rcl_client_t * client,
291  rmw_service_info_t * request_header,
292  void * ros_response);
293 
295 RCL_PUBLIC
296 RCL_WARN_UNUSED
297 rcl_ret_t
298 rcl_take_response(
299  const rcl_client_t * client,
300  rmw_request_id_t * request_header,
301  void * ros_response);
302 
304 
325 RCL_PUBLIC
326 RCL_WARN_UNUSED
327 const char *
328 rcl_client_get_service_name(const rcl_client_t * client);
329 
331 
352 RCL_PUBLIC
353 RCL_WARN_UNUSED
354 const rcl_client_options_t *
355 rcl_client_get_options(const rcl_client_t * client);
356 
358 
383 RCL_PUBLIC
384 RCL_WARN_UNUSED
385 rmw_client_t *
386 rcl_client_get_rmw_handle(const rcl_client_t * client);
387 
389 
406 RCL_PUBLIC
407 bool
408 rcl_client_is_valid(const rcl_client_t * client);
409 
410 #ifdef __cplusplus
411 }
412 #endif
413 
414 #endif // RCL__CLIENT_H_
rcl_node_t
Structure which encapsulates a ROS Node.
Definition: node.h:37
rcl_client_options_t
Options available for a rcl_client_t.
Definition: client.h:40
rcl_client_options_t::qos
rmw_qos_profile_t qos
Middleware quality of service settings for the client.
Definition: client.h:43
rcl_client_t
Structure which encapsulates a ROS Client.
Definition: client.h:33
rmw_service_info_t
rmw_client_t
rmw_request_id_t
rcl_client_t::impl
struct rcl_client_impl_t * impl
Pointer to the client implementation.
Definition: client.h:36
rcutils_allocator_t
rcl_client_options_t::allocator
rcl_allocator_t allocator
Custom allocator for the client, used for incidental allocations.
Definition: client.h:46
rmw_qos_profile_t