Skip to content

Commit

Permalink
Update to Zenoh version 1.0.0 (#191)
Browse files Browse the repository at this point in the history
# Description
Finally, zenoh released a stable v1.0.0. We are upgrading to that
  • Loading branch information
filippobrizzi authored Oct 24, 2024
1 parent b1e2f25 commit c77e94a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$CLANG_VE

RUN ln -s /usr/bin/clangd-${CLANG_VERSION} /usr/bin/clangd

RUN export ZENOH_VERSION="1.0.0~beta.4-1" && \
RUN export ZENOH_VERSION="1.0.0" && \
echo "deb [trusted=yes] https://download.eclipse.org/zenoh/debian-repo/ /" | tee /etc/apt/sources.list.d/zenoh.list >/dev/null && \
(apt-get update && apt-get install --no-install-recommends -y --allow-downgrades zenohd=${ZENOH_VERSION} zenoh-plugin-rest=${ZENOH_VERSION} || true) && \
sed -i 's/systemctl /# remove if fixed by zenoh: systemctl /' /var/lib/dpkg/info/zenohd.postinst && \
Expand Down
2 changes: 1 addition & 1 deletion docker/version.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
HOST=ghcr.io/olympus-robotics
VERSION=1.0.15
VERSION=1.0.16
IMAGE=hephaestus-dev
13 changes: 9 additions & 4 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,23 @@ set(ZENOHC_CMAKE_ARGS -DZENOHC_CARGO_CHANNEL=+stable -DZENOHC_BUILD_WITH_SHARED_
-DZENOHC_BUILD_WITH_UNSTABLE_API=TRUE
)
if(NOT BUILD_SHARED_LIBS)
list(APPEND ZENOHC_CMAKE_ARGS "-DZENOHC_LIB_STATIC=TRUE" "-DZENOHC_INSTALL_STATIC_LIBRARY=TRUE")
list(APPEND ZENOHC_CMAKE_ARGS "-DZENOHC_INSTALL_STATIC_LIBRARY=TRUE")
endif()
set(ZENOH_VERSION "1.0.0.10")
set(ZENOH_VERSION "release/1.0.0")
add_cmake_dependency(
NAME zenohc URL https://github.com/eclipse-zenoh/zenoh-c/archive/${ZENOH_VERSION}.zip CMAKE_ARGS ${ZENOHC_CMAKE_ARGS}
NAME zenohc
GIT_REPOSITORY https://github.com/eclipse-zenoh/zenoh-c
GIT_TAG ${ZENOH_VERSION}
CMAKE_ARGS ${ZENOHC_CMAKE_ARGS}
)

set(ZENOHCXX_VERSION ${ZENOH_VERSION})
set(ZENOHCXX_CMAKE_ARGS -DZ_FEATURE_UNSTABLE_API=1 -DZENOHCXX_EXAMPLES_PROTOBUF=OFF)
add_cmake_dependency(
NAME zenohcxx
DEPENDS ${ZENOHCXX_DEPENDS} URL https://github.com/eclipse-zenoh/zenoh-cpp/archive/${ZENOHCXX_VERSION}.zip
DEPENDS ${ZENOHCXX_DEPENDS}
GIT_REPOSITORY https://github.com/eclipse-zenoh/zenoh-cpp
GIT_TAG ${ZENOHCXX_VERSION}
CMAKE_ARGS ${ZENOHCXX_CMAKE_ARGS}
)

Expand Down
10 changes: 4 additions & 6 deletions modules/ipc/src/zenoh/raw_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,8 @@ void RawPublisher::enableCache() {
z_view_keyexpr_t keyexpr;
z_view_keyexpr_from_str(&keyexpr, topic_config_.name.data());

const auto result = ze_declare_publication_cache(&cache_publisher_,
::zenoh::interop::as_loaned_c_ptr(session_->zenoh_session),
z_loan(keyexpr), &cache_publisher_opts);
const auto result = ze_declare_publication_cache(::zenoh::interop::as_loaned_c_ptr(session_->zenoh_session),
&cache_publisher_, z_loan(keyexpr), &cache_publisher_opts);
throwExceptionIf<FailedZenohOperation>(
result != Z_OK,
fmt::format("[Publisher {}] failed to enable cache, result {}", topic_config_.name, result));
Expand All @@ -140,9 +139,8 @@ void RawPublisher::enableMatchingListener() {
this->match_cb_(status);
},
[]() {});

zc_publisher_matching_listener_declare(&subscriers_listener_,
::zenoh::interop::as_loaned_c_ptr(*publisher_), z_move(closure));
zc_publisher_declare_matching_listener(::zenoh::interop::as_loaned_c_ptr(*publisher_),
&subscriers_listener_, z_move(closure));
}

void RawPublisher::createTypeInfoService() {
Expand Down
6 changes: 3 additions & 3 deletions modules/ipc/src/zenoh/raw_subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ RawSubscriber::RawSubscriber(SessionPtr session, TopicConfig topic_config, DataC

auto c_closure = createZenohcClosure(cb, ::zenoh::closures::none);

const auto result = ze_declare_querying_subscriber(
&cache_subscriber_, ::zenoh::interop::as_loaned_c_ptr(session_->zenoh_session), z_loan(keyexpr),
z_move(c_closure), &sub_opts);
const auto result =
ze_declare_querying_subscriber(::zenoh::interop::as_loaned_c_ptr(session_->zenoh_session),
&cache_subscriber_, z_loan(keyexpr), z_move(c_closure), &sub_opts);

heph::throwExceptionIf<heph::FailedZenohOperation>(
result != Z_OK,
Expand Down

0 comments on commit c77e94a

Please sign in to comment.