rcl  master
C API providing common ROS client library functionality.
client.h
Go to the documentation of this file.
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 #if __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include "rosidl_generator_c/service_type_support.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 {
35  struct rcl_client_impl_t * impl;
36 } rcl_client_t;
37 
39 typedef struct rcl_client_options_t
40 {
44 
47 
49 
57 
58 
60 
154 rcl_ret_t
156  rcl_client_t * client,
157  const rcl_node_t * node,
158  const rosidl_service_type_support_t * type_support,
159  const char * service_name,
160  const rcl_client_options_t * options);
161 
163 
184 rcl_ret_t
185 rcl_client_fini(rcl_client_t * client, rcl_node_t * node);
186 
188 
198 
200 
245 rcl_ret_t
246 rcl_send_request(const rcl_client_t * client, const void * ros_request, int64_t * sequence_number);
247 
248 
250 
282 rcl_ret_t
284  const rcl_client_t * client,
285  rmw_request_id_t * request_header,
286  void * ros_response);
287 
289 
312 const char *
314 
316 
339 const rcl_client_options_t *
340 rcl_client_get_options(const rcl_client_t * client);
341 
343 
370 rmw_client_t *
372 
374 
392 bool
393 rcl_client_is_valid(const rcl_client_t * client);
394 
395 #if __cplusplus
396 }
397 #endif
398 
399 #endif // RCL__CLIENT_H_
rcl_allocator_t allocator
Custom allocator for the client, used for incidental allocations.
Definition: client.h:45
rmw_ret_t rcl_ret_t
Definition: types.h:20
struct rcl_client_impl_t * impl
Definition: client.h:35
bool rcl_client_is_valid(const rcl_client_t *client)
Check that the client is valid.
Structure which encapsulates a ROS Client.
Definition: client.h:33
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.
rmw_qos_profile_t qos
Middleware quality of service settings for the client.
Definition: client.h:42
rmw_client_t * rcl_client_get_rmw_handle(const rcl_client_t *client)
Return the rmw client handle.
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.
#define RCL_WARN_UNUSED
Ignored return values of functions with this macro will emit a warning.
Definition: macros.h:25
const rcl_client_options_t * rcl_client_get_options(const rcl_client_t *client)
Return the rcl client options.
#define RCL_PUBLIC
Definition: visibility_control.h:48
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.
rcl_client_options_t rcl_client_get_default_options(void)
Return the default client options in a rcl_client_options_t.
struct rcl_client_options_t rcl_client_options_t
Options available for a rcl_client_t.
rcl_client_t rcl_get_zero_initialized_client(void)
Return a rcl_client_t struct with members set to NULL.
rcl_ret_t rcl_client_fini(rcl_client_t *client, rcl_node_t *node)
Finalize a rcl_client_t.
rcl_ret_t rcl_take_response(const rcl_client_t *client, rmw_request_id_t *request_header, void *ros_response)
Take a ROS response using a client.
struct rcl_client_t rcl_client_t
Structure which encapsulates a ROS Client.
Structure which encapsulates a ROS Node.
Definition: node.h:37
Options available for a rcl_client_t.
Definition: client.h:39