From 186c1776b0befd962489ded21aa431a06df033ee Mon Sep 17 00:00:00 2001 From: yuanyuyuan Date: Wed, 18 Dec 2024 23:34:53 +0800 Subject: [PATCH 1/3] deps: bump up zenoh-cpp and zenoh-c --- rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp | 6 +++--- rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp | 6 +++--- zenoh_cpp_vendor/CMakeLists.txt | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp index b228c7cb..2ba987f2 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp +++ b/rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp @@ -109,8 +109,8 @@ std::shared_ptr PublisherData::make( zenoh::KeyExpr pub_ke(entity->topic_info()->topic_keyexpr_); // Create a Publication Cache if durability is transient_local. if (adapted_qos_profile.durability == RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL) { - zenoh::Session::PublicationCacheOptions pub_cache_opts = - zenoh::Session::PublicationCacheOptions::create_default(); + zenoh::ext::SessionExt::PublicationCacheOptions pub_cache_opts = + zenoh::ext::SessionExt::PublicationCacheOptions::create_default(); pub_cache_opts.history = adapted_qos_profile.depth; pub_cache_opts.queryable_complete = true; @@ -118,7 +118,7 @@ std::shared_ptr PublisherData::make( std::string queryable_prefix = entity->zid(); pub_cache_opts.queryable_prefix = zenoh::KeyExpr(queryable_prefix); - pub_cache = session->declare_publication_cache(pub_ke, std::move(pub_cache_opts), &result); + pub_cache = session->ext().declare_publication_cache(pub_ke, std::move(pub_cache_opts), &result); if (result != Z_OK) { RMW_SET_ERROR_MSG("unable to create zenoh publisher cache"); diff --git a/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp index dc1cba81..5acbd909 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp +++ b/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp @@ -181,8 +181,8 @@ bool SubscriptionData::init() // TODO(Yadunund): Rely on a separate function to return the sub // as we start supporting more qos settings. if (entity_->topic_info()->qos_.durability == RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL) { - zenoh::Session::QueryingSubscriberOptions sub_options = - zenoh::Session::QueryingSubscriberOptions::create_default(); + zenoh::ext::SessionExt::QueryingSubscriberOptions sub_options = + zenoh::ext::SessionExt::QueryingSubscriberOptions::create_default(); const std::string selector = "*/" + entity_->topic_info()->topic_keyexpr_; zenoh::KeyExpr selector_ke(selector); sub_options.query_keyexpr = std::move(selector_ke); @@ -200,7 +200,7 @@ bool SubscriptionData::init() zenoh::QueryConsolidation(zenoh::ConsolidationMode::Z_CONSOLIDATION_MODE_NONE); std::weak_ptr data_wp = shared_from_this(); - auto sub = context_impl->session()->declare_querying_subscriber( + auto sub = context_impl->session()->ext().declare_querying_subscriber( sub_ke, [data_wp](const zenoh::Sample & sample) { auto sub_data = data_wp.lock(); diff --git a/zenoh_cpp_vendor/CMakeLists.txt b/zenoh_cpp_vendor/CMakeLists.txt index 37bdbd41..1ec25cdf 100644 --- a/zenoh_cpp_vendor/CMakeLists.txt +++ b/zenoh_cpp_vendor/CMakeLists.txt @@ -26,7 +26,7 @@ set(ZENOHC_CARGO_FLAGS "--no-default-features$--features=shared-memor # - https://github.com/eclipse-zenoh/zenoh-c/pull/620 (fix ze_querying_subscriber_get API to query newly discovered publishers) ament_vendor(zenoh_c_vendor VCS_URL https://github.com/eclipse-zenoh/zenoh-c.git - VCS_VERSION 42e717ff7b633649f11ebb7800b71d4939cd21c7 + VCS_VERSION ff723e92e80dde381a535e35320b98b22ae4dcac CMAKE_ARGS "-DZENOHC_CARGO_FLAGS=${ZENOHC_CARGO_FLAGS}" "-DZENOHC_BUILD_WITH_UNSTABLE_API=TRUE" @@ -37,7 +37,7 @@ ament_export_dependencies(zenohc) ament_vendor(zenoh_cpp_vendor VCS_URL https://github.com/eclipse-zenoh/zenoh-cpp - VCS_VERSION e8eca99b4eaff0963e52aefd8405909c1552080d + VCS_VERSION e983fa88ea6fcbc9e190ab1c3e71a39b892ed55d CMAKE_ARGS -DZENOHCXX_ZENOHC=OFF ) From 951657cb2e05b7098bb00f9d3dc454c98bc3b2eb Mon Sep 17 00:00:00 2001 From: yuanyuyuan Date: Thu, 19 Dec 2024 00:41:39 +0800 Subject: [PATCH 2/3] fix: address the duplicated definition issue --- zenoh_cpp_vendor/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zenoh_cpp_vendor/CMakeLists.txt b/zenoh_cpp_vendor/CMakeLists.txt index 1ec25cdf..4d8e6536 100644 --- a/zenoh_cpp_vendor/CMakeLists.txt +++ b/zenoh_cpp_vendor/CMakeLists.txt @@ -26,7 +26,7 @@ set(ZENOHC_CARGO_FLAGS "--no-default-features$--features=shared-memor # - https://github.com/eclipse-zenoh/zenoh-c/pull/620 (fix ze_querying_subscriber_get API to query newly discovered publishers) ament_vendor(zenoh_c_vendor VCS_URL https://github.com/eclipse-zenoh/zenoh-c.git - VCS_VERSION ff723e92e80dde381a535e35320b98b22ae4dcac + VCS_VERSION 2f389597264c200d9ddf72bbabbfea878abd5179 CMAKE_ARGS "-DZENOHC_CARGO_FLAGS=${ZENOHC_CARGO_FLAGS}" "-DZENOHC_BUILD_WITH_UNSTABLE_API=TRUE" @@ -37,7 +37,7 @@ ament_export_dependencies(zenohc) ament_vendor(zenoh_cpp_vendor VCS_URL https://github.com/eclipse-zenoh/zenoh-cpp - VCS_VERSION e983fa88ea6fcbc9e190ab1c3e71a39b892ed55d + VCS_VERSION c549fbdf54e866b9d8f29c883e66359fcac88ed4 CMAKE_ARGS -DZENOHCXX_ZENOHC=OFF ) From 03b72cb883bf41906bae1b8a7cd3e0c18b24b5ea Mon Sep 17 00:00:00 2001 From: yuanyuyuan Date: Thu, 19 Dec 2024 01:09:48 +0800 Subject: [PATCH 3/3] style: linting --- rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp index 2ba987f2..7d83eec6 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp +++ b/rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp @@ -118,7 +118,8 @@ std::shared_ptr PublisherData::make( std::string queryable_prefix = entity->zid(); pub_cache_opts.queryable_prefix = zenoh::KeyExpr(queryable_prefix); - pub_cache = session->ext().declare_publication_cache(pub_ke, std::move(pub_cache_opts), &result); + pub_cache = session->ext().declare_publication_cache( + pub_ke, std::move(pub_cache_opts), &result); if (result != Z_OK) { RMW_SET_ERROR_MSG("unable to create zenoh publisher cache");