ROS 2 rclcpp + rcl - kilted  kilted
ROS 2 C++ Client Library with ROS Client Library
logging_rosout.h
Go to the documentation of this file.
1 // Copyright 2018-2019 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__LOGGING_ROSOUT_H_
18 #define RCL__LOGGING_ROSOUT_H_
19 
20 #include "rcl/allocator.h"
21 #include "rcl/error_handling.h"
22 #include "rcl/node.h"
23 #include "rcl/macros.h"
24 #include "rcl/types.h"
25 #include "rcl/visibility_control.h"
26 
27 #include "rmw/qos_profiles.h"
28 
29 #ifdef __cplusplus
30 extern "C"
31 {
32 #endif
33 
35 
40 RCUTILS_DEPRECATED_WITH_MSG("use rmw_qos_profile_rosout_default instead")
41 static const rmw_qos_profile_t rcl_qos_profile_rosout_default =
42 {
43  RMW_QOS_POLICY_HISTORY_KEEP_LAST,
44  1000,
45  RMW_QOS_POLICY_RELIABILITY_RELIABLE,
46  RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL,
47  RMW_QOS_DEADLINE_DEFAULT,
48  {10, 0},
49  RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT,
50  RMW_QOS_LIVELINESS_LEASE_DURATION_DEFAULT,
51  false
52 };
53 
55 
73 RCL_PUBLIC
74 RCL_WARN_UNUSED
77  const rcl_allocator_t * allocator);
78 
80 
95 RCL_PUBLIC
96 RCL_WARN_UNUSED
99 
101 
126 RCL_PUBLIC
127 RCL_WARN_UNUSED
128 rcl_ret_t
130  rcl_node_t * node);
131 
133 
152 RCL_PUBLIC
153 RCL_WARN_UNUSED
154 rcl_ret_t
156  rcl_node_t * node);
157 
159 
185 RCL_PUBLIC
186 void
188  const rcutils_log_location_t * location,
189  int severity,
190  const char * name,
191  rcutils_time_point_value_t timestamp,
192  const char * format,
193  va_list * args);
194 
196 
224 RCL_PUBLIC
225 RCL_WARN_UNUSED
226 rcl_ret_t
228  const char * logger_name, const char * sublogger_name);
229 
231 
253 RCL_PUBLIC
254 RCL_WARN_UNUSED
255 rcl_ret_t
257  const char * logger_name, const char * sublogger_name);
258 
259 #ifdef __cplusplus
260 }
261 #endif
262 
263 #endif // RCL__LOGGING_ROSOUT_H_
rcutils_allocator_t rcl_allocator_t
Encapsulation of an allocator.
Definition: allocator.h:31
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_logging_rosout_add_sublogger(const char *logger_name, const char *sublogger_name)
Add a subordinate logger based on a logger.
RCL_PUBLIC void rcl_logging_rosout_output_handler(const rcutils_log_location_t *location, int severity, const char *name, rcutils_time_point_value_t timestamp, const char *format, va_list *args)
The output handler outputs log messages to rosout topics.
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_logging_rosout_init_publisher_for_node(rcl_node_t *node)
Creates a rosout publisher for a node and registers it to be used by the logging system.
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_logging_rosout_fini_publisher_for_node(rcl_node_t *node)
Deregisters a rosout publisher for a node and cleans up allocated resources.
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_logging_rosout_fini(void)
Uninitializes the rcl_logging_rosout features.
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_logging_rosout_init(const rcl_allocator_t *allocator)
Initializes the rcl_logging_rosout features.
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_logging_rosout_remove_sublogger(const char *logger_name, const char *sublogger_name)
Remove a subordinate logger and cleans up allocated resources.
Structure which encapsulates a ROS Node.
Definition: node.h:45
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.
Definition: types.h:24