From e9aac70eaa4aa42ae9103e09e4cf2138bf234a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez=20Moreno?= Date: Fri, 15 Jul 2022 09:35:41 +0200 Subject: [PATCH] Fix creation of datareader for content filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ricardo González Moreno --- rmw_fastrtps_shared_cpp/src/rmw_subscription.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rmw_fastrtps_shared_cpp/src/rmw_subscription.cpp b/rmw_fastrtps_shared_cpp/src/rmw_subscription.cpp index 983a21ac2..d6df6d9dc 100644 --- a/rmw_fastrtps_shared_cpp/src/rmw_subscription.cpp +++ b/rmw_fastrtps_shared_cpp/src/rmw_subscription.cpp @@ -189,6 +189,11 @@ __rmw_subscription_set_content_filter( RMW_SET_ERROR_MSG("create_datareader() could not create data reader"); return RMW_RET_ERROR; } + + // Initialize DataReader's StatusCondition to be notified when new data is available + info->data_reader_->get_statuscondition().set_enabled_statuses( + eprosima::fastdds::dds::StatusMask::data_available()); + // lambda to delete datareader auto cleanup_datareader = rcpputils::make_scope_exit( [subscriber, info]()