Skip to content

Commit

Permalink
Merge branch 'rolling' into yadu/namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Yadunund committed May 16, 2024
2 parents e7aad9b + c76c962 commit 05a44fc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 69 deletions.
9 changes: 1 addition & 8 deletions rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_ROUTER_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,7 @@
},
// Number of threads dedicated to transmission
// By default, the number of threads is calculated as follows: 1 + ((#cores - 1) / 4)
// We limit the number of threads that the zenoh session can spin to 1.
// Without this limit, applications with multiple zenoh sessions can
// encounter system resource errors when trying to create new threads.
// Once zenoh migrates to relying on tokio for its async runtime,
// see https://github.com/eclipse-zenoh/zenoh/pull/566, we can consider
// removing these flags since with tokio, zenoh can better manage the threads it spins
// with the help of thread pools.
threads: 1,
// threads: 1,
},
/// Configure the zenoh RX parameters of a link
rx: {
Expand Down
9 changes: 1 addition & 8 deletions rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,7 @@
},
// Number of threads dedicated to transmission
// By default, the number of threads is calculated as follows: 1 + ((#cores - 1) / 4)
// We limit the number of threads that the zenoh session can spin to 1.
// Without this limit, applications with multiple zenoh sessions can
// encounter system resource errors when trying to create new threads.
// Once zenoh migrates to relying on tokio for its async runtime,
// see https://github.com/eclipse-zenoh/zenoh/pull/566, we can consider
// removing these flags since with tokio, zenoh can better manage the threads it spins
// with the help of thread pools.
threads: 1,
// threads: 1,
},
/// Configure the zenoh RX parameters of a link
rx: {
Expand Down
23 changes: 3 additions & 20 deletions rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,26 +81,9 @@ namespace
// careful about who owns the string.
z_owned_keyexpr_t ros_topic_name_to_zenoh_key(const char * const topic_name, size_t domain_id)
{
std::string d = std::to_string(domain_id);

size_t start_offset = 0;
size_t topic_name_len = strlen(topic_name);
size_t end_offset = topic_name_len;

if (topic_name_len > 0) {
if (topic_name[0] == '/') {
// Strip the leading '/'
start_offset = 1;
}
if (topic_name[end_offset - 1] == '/') {
// Strip the trailing '/'
end_offset -= 1;
}
}

return z_keyexpr_join(
z_keyexpr(d.c_str()),
zc_keyexpr_from_slice(&topic_name[start_offset], end_offset - start_offset));
const std::string keyexpr_str = std::to_string(domain_id) + "/" + liveliness::mangle_name(
topic_name);
return z_keyexpr_new(keyexpr_str.c_str());
}

//==============================================================================
Expand Down
9 changes: 2 additions & 7 deletions zenoh_c_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,12 @@ find_package(ament_cmake_vendor_package REQUIRED)
# when expanded.
set(ZENOHC_CARGO_FLAGS "--no-default-features$<SEMICOLON>--features=zenoh/transport_tcp zenoh/shared-memory")

# Set VCS_VERSION to include changes from https://github.com/eclipse-zenoh/zenoh/pull/802
# which was synced to zenoh-c in https://github.com/eclipse-zenoh/zenoh-c/pull/272.
# Apply patches:
# - https://github.com/eclipse-zenoh/zenoh-c/pull/301
# Set VCS_VERSION to include latest changes from zenoh-c https://github.com/eclipse-zenoh/zenoh-c/pull/340.
ament_vendor(zenoh_c_vendor
VCS_URL https://github.com/eclipse-zenoh/zenoh-c.git
VCS_VERSION 10176b911096cb92b8ee46bc491b78079ee26c20
VCS_VERSION 68ab0c1faa2c3521680352778e618d95f15e2e95
CMAKE_ARGS
"-DZENOHC_CARGO_FLAGS=${ZENOHC_CARGO_FLAGS}"
PATCHES patches
)

# set(INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-prefix/install")
Expand All @@ -42,5 +38,4 @@ ament_vendor(zenoh_c_vendor
# DESTINATION "lib/${PROJECT_NAME}"
# USE_SOURCE_PERMISSIONS
# )

ament_package()
3 changes: 1 addition & 2 deletions zenoh_c_vendor/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
<maintainer email="[email protected]">Yadunund</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_vendor_package</buildtool_depend>

<build_depend>cargo</build_depend>
<build_depend>clang</build_depend>
<build_depend>git</build_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
24 changes: 0 additions & 24 deletions zenoh_c_vendor/patches/pr_301.patch

This file was deleted.

0 comments on commit 05a44fc

Please sign in to comment.