ROS 2 rclcpp + rcl - rolling  rolling-a919a6e5
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 "rcl/macros.h"
24 #include "rcl/node.h"
25 #include "rcl/publisher.h"
26 #include "rcl/service_introspection.h"
27 #include "rcl/time.h"
28 #include "rcl/types.h"
29 #include "rcl/visibility_control.h"
30 
31 #include "rosidl_runtime_c/service_type_support_struct.h"
32 
34 {
40  rcl_service_introspection_state_t introspection_state;
46  const rosidl_service_type_support_t * service_type_support;
48 
50 
54 RCL_PUBLIC
55 RCL_WARN_UNUSED
57 rcl_get_zero_initialized_service_event_publisher(void);
58 
60 
97 RCL_PUBLIC
98 RCL_WARN_UNUSED
100 rcl_service_event_publisher_init(
101  rcl_service_event_publisher_t * service_event_publisher,
102  const rcl_node_t * node,
103  rcl_clock_t * clock,
104  const rcl_publisher_options_t publisher_options,
105  const char * service_name,
106  const rosidl_service_type_support_t * service_type_support);
107 
109 
129 RCL_PUBLIC
130 RCL_WARN_UNUSED
131 rcl_ret_t
132 rcl_service_event_publisher_fini(
133  rcl_service_event_publisher_t * service_event_publisher,
134  rcl_node_t * node);
135 
137 
154 RCL_PUBLIC
155 bool
156 rcl_service_event_publisher_is_valid(const rcl_service_event_publisher_t * service_event_publisher);
157 
159 
188 RCL_PUBLIC
189 RCL_WARN_UNUSED
190 rcl_ret_t
191 rcl_send_service_event_message(
192  const rcl_service_event_publisher_t * service_event_publisher,
193  uint8_t event_type,
194  const void * ros_response_request,
195  int64_t sequence_number,
196  const uint8_t guid[16]);
197 
199 
205 RCL_PUBLIC
206 rcl_ret_t
207 rcl_service_event_publisher_change_state(
208  rcl_service_event_publisher_t * service_event_publisher,
209  rcl_service_introspection_state_t introspection_state);
210 
211 #ifdef __cplusplus
212 }
213 #endif
214 #endif // RCL__SERVICE_EVENT_PUBLISHER_H_
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
Structure which encapsulates a ROS Publisher.
Definition: publisher.h:37
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:24