ROS 2 rclcpp + rcl - rolling  rolling-e7363f10
ROS 2 C++ Client Library with ROS Client Library
service_event_publisher.h
1 // Copyright 2022 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__SERVICE_EVENT_PUBLISHER_H_
16 #define RCL__SERVICE_EVENT_PUBLISHER_H_
17 
18 #ifdef __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include <stdbool.h>
24 #include <stdint.h>
25 
26 #include "rcl/macros.h"
27 #include "rcl/node.h"
28 #include "rcl/publisher.h"
29 #include "rcl/service_introspection.h"
30 #include "rcl/time.h"
31 #include "rcl/types.h"
32 #include "rcl/visibility_control.h"
33 
34 #include "rosidl_runtime_c/service_type_support_struct.h"
35 
37 {
43  rcl_service_introspection_state_t introspection_state;
49  const rosidl_service_type_support_t * service_type_support;
51 
53 
57 RCL_PUBLIC
58 RCL_WARN_UNUSED
60 rcl_get_zero_initialized_service_event_publisher(void);
61 
63 
100 RCL_PUBLIC
101 RCL_WARN_UNUSED
102 rcl_ret_t
103 rcl_service_event_publisher_init(
104  rcl_service_event_publisher_t * service_event_publisher,
105  const rcl_node_t * node,
106  rcl_clock_t * clock,
107  const rcl_publisher_options_t publisher_options,
108  const char * service_name,
109  const rosidl_service_type_support_t * service_type_support);
110 
112 
132 RCL_PUBLIC
133 RCL_WARN_UNUSED
134 rcl_ret_t
135 rcl_service_event_publisher_fini(
136  rcl_service_event_publisher_t * service_event_publisher,
137  rcl_node_t * node);
138 
140 
157 RCL_PUBLIC
158 bool
159 rcl_service_event_publisher_is_valid(const rcl_service_event_publisher_t * service_event_publisher);
160 
162 
191 RCL_PUBLIC
192 RCL_WARN_UNUSED
193 rcl_ret_t
194 rcl_send_service_event_message(
195  const rcl_service_event_publisher_t * service_event_publisher,
196  uint8_t event_type,
197  const void * ros_response_request,
198  int64_t sequence_number,
199  const uint8_t guid[16]);
200 
202 
208 RCL_PUBLIC
209 rcl_ret_t
210 rcl_service_event_publisher_change_state(
211  rcl_service_event_publisher_t * service_event_publisher,
212  rcl_service_introspection_state_t introspection_state);
213 
214 #ifdef __cplusplus
215 }
216 #endif
217 #endif // RCL__SERVICE_EVENT_PUBLISHER_H_
Encapsulation of a time source.
Definition: time.h:141
Structure which encapsulates a ROS Node.
Definition: node.h:49
Options available for a rcl publisher.
Definition: publisher.h:51
Structure which encapsulates a ROS Publisher.
Definition: publisher.h:44
char * service_event_topic_name
Name of service introspection topic: <service_name>/<RCL_SERVICE_INTROSPECTION_TOPIC_POSTFIX>
const rosidl_service_type_support_t * service_type_support
Handle to service typesupport.
rcl_publisher_options_t publisher_options
Publisher options for service event publisher.
rcl_service_introspection_state_t introspection_state
Current state of introspection; off, metadata, or contents.
rcl_publisher_t * publisher
Handle to publisher for publishing service events.
rcl_clock_t * clock
Handle to clock for timestamping service events.
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.
Definition: types.h:25