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 
16 
17 #ifndef RCL__CLIENT_H_
18 #define RCL__CLIENT_H_
19 
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
25 #include "rosidl_runtime_c/service_type_support_struct.h"
26 
27 #include "rcl/macros.h"
28 #include "rcl/node.h"
29 #include "rcl/visibility_control.h"
30 
32 struct rcl_client_impl_t;
33 
35 typedef struct rcl_client_t
36 {
38  struct rcl_client_impl_t * impl;
39 } rcl_client_t;
40 
42 typedef struct rcl_client_options_t
43 {
47 
50 
52 
56 RCL_PUBLIC
57 RCL_WARN_UNUSED
60 
62 
155 RCL_PUBLIC
156 RCL_WARN_UNUSED
157 rcl_ret_t
159  rcl_client_t * client,
160  const rcl_node_t * node,
161  const rosidl_service_type_support_t * type_support,
162  const char * service_name,
163  const rcl_client_options_t * options);
164 
166 
186 RCL_PUBLIC
187 RCL_WARN_UNUSED
188 rcl_ret_t
189 rcl_client_fini(rcl_client_t * client, rcl_node_t * node);
190 
192 
198 RCL_PUBLIC
199 RCL_WARN_UNUSED
202 
204 
247 RCL_PUBLIC
248 RCL_WARN_UNUSED
249 rcl_ret_t
250 rcl_send_request(const rcl_client_t * client, const void * ros_request, int64_t * sequence_number);
251 
252 
254 
288 RCL_PUBLIC
289 RCL_WARN_UNUSED
290 rcl_ret_t
292  const rcl_client_t * client,
293  rmw_service_info_t * request_header,
294  void * ros_response);
295 
297 RCL_PUBLIC
298 RCL_WARN_UNUSED
299 rcl_ret_t
301  const rcl_client_t * client,
302  rmw_request_id_t * request_header,
303  void * ros_response);
304 
306 
327 RCL_PUBLIC
328 RCL_WARN_UNUSED
329 const char *
331 
333 
354 RCL_PUBLIC
355 RCL_WARN_UNUSED
356 const rcl_client_options_t *
357 rcl_client_get_options(const rcl_client_t * client);
358 
360 
385 RCL_PUBLIC
386 RCL_WARN_UNUSED
387 rmw_client_t *
389 
391 
408 RCL_PUBLIC
409 bool
410 rcl_client_is_valid(const rcl_client_t * client);
411 
412 #ifdef __cplusplus
413 }
414 #endif
415 
416 #endif // RCL__CLIENT_H_
rcl_node_t
Structure which encapsulates a ROS Node.
Definition: node.h:39
rcl_client_options_t
Options available for a rcl_client_t.
Definition: client.h:42
rcl_client_options_t::qos
rmw_qos_profile_t qos
Middleware quality of service settings for the client.
Definition: client.h:45
rcl_ret_t
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.
Definition: types.h:23
rcl_client_t
Structure which encapsulates a ROS Client.
Definition: client.h:35
rcl_take_response_with_info
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.
rmw_service_info_t
rcl_client_get_rmw_handle
rmw_client_t * rcl_client_get_rmw_handle(const rcl_client_t *client)
Return the rmw client handle.
rcl_client_get_options
const rcl_client_options_t * rcl_client_get_options(const rcl_client_t *client)
Return the rcl client options.
rmw_client_t
rcl_send_request
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.
node.h
rcl_get_zero_initialized_client
rcl_client_t rcl_get_zero_initialized_client(void)
Return a rcl_client_t struct with members set to NULL.
rcl_client_init
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.
rcl_client_get_service_name
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.
rmw_request_id_t
rcl_client_t::impl
struct rcl_client_impl_t * impl
Pointer to the client implementation.
Definition: client.h:38
rcutils_allocator_t
rcl_client_options_t
struct rcl_client_options_t rcl_client_options_t
Options available for a rcl_client_t.
rcl_client_options_t::allocator
rcl_allocator_t allocator
Custom allocator for the client, used for incidental allocations.
Definition: client.h:48
rmw_qos_profile_t
rcl_client_get_default_options
rcl_client_options_t rcl_client_get_default_options(void)
Return the default client options in a rcl_client_options_t.
rcl_client_fini
rcl_ret_t rcl_client_fini(rcl_client_t *client, rcl_node_t *node)
Finalize a rcl_client_t.
rcl_take_response
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
rcl_client_is_valid
bool rcl_client_is_valid(const rcl_client_t *client)
Check that the client is valid.
rcl_client_t
struct rcl_client_t rcl_client_t
Structure which encapsulates a ROS Client.