Skip to content

Commit 40ba55b

Browse files
authored
Use 10sec lifespan in rosout publisher qos (#587)
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
1 parent f8f8b41 commit 40ba55b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rcl/src/rcl/logging_rosout.c

+3
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,11 @@ rcl_ret_t rcl_logging_rosout_init_publisher_for_node(
173173
const rosidl_message_type_support_t * type_support =
174174
rosidl_typesupport_c__get_message_type_support_handle__rcl_interfaces__msg__Log();
175175
rcl_publisher_options_t options = rcl_publisher_get_default_options();
176+
// Late joining subscriptions get the last 10 seconds of logs, up to 1000 logs.
176177
options.qos.depth = 1000;
177178
options.qos.durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL;
179+
options.qos.lifespan.sec = 10;
180+
options.qos.lifespan.nsec = 0;
178181
new_entry.publisher = rcl_get_zero_initialized_publisher();
179182
status =
180183
rcl_publisher_init(&new_entry.publisher, node, type_support, ROSOUT_TOPIC_NAME, &options);

0 commit comments

Comments
 (0)