Skip to content

Commit

Permalink
Merge branch 'rolling' into sync_config
Browse files Browse the repository at this point in the history
  • Loading branch information
Yadunund committed Jan 12, 2025
2 parents d0cfabd + 1f2d675 commit 6560944
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
if: ${{ matrix.BUILD_TYPE == 'source' }}
- name: Install Coverage Tools
if: ${{ matrix.BUILD_TYPE == 'binary' }}
run: sudo apt update && sudo apt install -y python3-colcon-coveragepy-result python3-colcon-lcov-result lcov
run: sudo apt update && sudo apt upgrade -y && sudo apt install -y python3-colcon-coveragepy-result python3-colcon-lcov-result lcov
- name: Build and run tests
id: action-ros-ci
uses: ros-tooling/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_ROUTER_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@
connect_certificate: null,
// Whether or not to verify the matching between hostname/dns and certificate when connecting,
// if set to false zenoh will disregard the common names of the certificates when verifying servers.
// This could be dangerous because your CA can have signed a server cert for foo.com, that's later being used to host a server at baz.com. If you wan't your
// ca to verify that the server at baz.com is actually baz.com, let this be true (default).
// This could be dangerous because your CA can have signed a server cert for foo.com, that's later being used to host a server at baz.com.
// If you want your ca to verify that the server at baz.com is actually baz.com, let this be true (default).
verify_name_on_connect: true,
// Whether or not to close links when remote certificates expires.
// If set to true, links that require certificates (tls/quic) will automatically disconnect when the time of expiration of the remote certificate chain is reached
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,8 @@
connect_certificate: null,
// Whether or not to verify the matching between hostname/dns and certificate when connecting,
// if set to false zenoh will disregard the common names of the certificates when verifying servers.
// This could be dangerous because your CA can have signed a server cert for foo.com, that's later being used to host a server at baz.com. If you wan't your
// ca to verify that the server at baz.com is actually baz.com, let this be true (default).
// This could be dangerous because your CA can have signed a server cert for foo.com, that's later being used to host a server at baz.com.
// If you want your ca to verify that the server at baz.com is actually baz.com, let this be true (default).
verify_name_on_connect: true,
// Whether or not to close links when remote certificates expires.
// If set to true, links that require certificates (tls/quic) will automatically disconnect when the time of expiration of the remote certificate chain is reached
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/graph_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ void GraphCache::parse_put(
range.first, range.second,
[entity](const std::pair<std::string, GraphNodePtr> & node_it)
{
// Match nodes if their zenoh sesion and node ids match.
// Match nodes if their zenoh session and node ids match.
return entity->zid() == node_it.second->zid_ && entity->nid() == node_it.second->nid_;
});
if (node_it == range.second) {
Expand Down Expand Up @@ -573,7 +573,7 @@ void GraphCache::parse_del(
range.first, range.second,
[entity](const std::pair<std::string, GraphNodePtr> & node_it)
{
// Match nodes if their zenoh sesion and node ids match.
// Match nodes if their zenoh session and node ids match.
return entity->zid() == node_it.second->zid_ && entity->nid() == node_it.second->nid_;
});
if (node_it == range.second) {
Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/graph_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct GraphNode
TopicMap pubs_ = {};
TopicMap subs_ = {};

// Entires for service/client.
// Entries for service/client.
TopicMap clients_ = {};
TopicMap services_ = {};
};
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/liveliness_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct TopicInfo
};

///=============================================================================
/// Retuns the keyexpr for liveliness subscription.
/// Returns the keyexpr for liveliness subscription.
std::string subscription_token(size_t domain_id);

///=============================================================================
Expand Down Expand Up @@ -96,7 +96,7 @@ enum class EntityType : uint8_t
* <namespace> - The ROS namespace for this entity. If the namespace is absolute, this function will add in an _ for later parsing reasons.
* <nodename> - The ROS node name for this entity.
*
* For entities with topic infomation, the liveliness token keyexpr have additional fields:
* For entities with topic information, the liveliness token keyexpr have additional fields:
*
* <ADMIN_SPACE>/<domainid>/<zid>/<id>/<entity>/<namespace>/<nodename>/<topic_name>/<topic_type>/<topic_type_hash>/<topic_qos>
* <topic_name> - The ROS topic name for this entity.
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/ordered_hash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,7 @@ class ordered_hash : private Hash, private KeyEqual {
#endif

/*
* The insertion didn't happend at the end of the m_values container,
* The insertion didn't happened at the end of the m_values container,
* we need to shift the indexes in m_buckets_data.
*/
if (index_insert_position != m_values.size() - 1) {
Expand Down Expand Up @@ -1661,7 +1661,7 @@ class ordered_hash : private Hash, private KeyEqual {
static constexpr float REHASH_ON_HIGH_NB_PROBES__MIN_LOAD_FACTOR = 0.15f;

/**
* Protocol version currenlty used for serialization.
* Protocol version currently used for serialization.
*/
static const slz_size_type SERIALIZATION_PROTOCOL_VERSION = 1;

Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_wait_set_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct rmw_wait_set_data_t
// there isn't a race in rmw_wait(). That could happen because of the following sequence:
//
// 1. Without taking a lock, rmw_wait() checks if any of the entities in the wait_set are ready,
// and if not attachs the condition_variable to it.
// and if not attaches the condition_variable to it.
// 2. It then takes the lock, and sleeps on the condition_variable.
//
// However, doing step 1 takes time, and checks in a particular order: guard_conditions, events,
Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/zenoh_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ std::optional<zenoh::Config> get_z_config(const ConfigurableEntity & entity);
/// @details The behavior is as follows:
/// - If not set or 0, the max value is returned.
/// - If less than 0, std::nullopt is returned.
/// - Else value of environemnt variable is returned.
/// - Else value of environment variable is returned.
/// @return The number of times to try connecting to a zenoh router and
/// std::nullopt if establishing a connection to a router is not required.
std::optional<uint64_t> zenoh_router_check_attempts();
Expand Down
22 changes: 19 additions & 3 deletions rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,10 @@ rmw_create_publisher(
context_impl,
"unable to get rmw_context_impl_s",
return nullptr);
if (context_impl->is_shutdown()) {
RMW_SET_ERROR_MSG("context_impl is shutdown");
return nullptr;
}
if (!context_impl->session_is_valid()) {
RMW_SET_ERROR_MSG("zenoh session is invalid");
return nullptr;
Expand Down Expand Up @@ -936,6 +940,10 @@ rmw_create_subscription(
context_impl,
"unable to get rmw_context_impl_s",
return nullptr);
if (context_impl->is_shutdown()) {
RMW_SET_ERROR_MSG("context_impl is shutdown");
return nullptr;
}
if (!context_impl->session_is_valid()) {
RMW_SET_ERROR_MSG("zenoh session is invalid");
return nullptr;
Expand Down Expand Up @@ -1233,12 +1241,12 @@ rmw_take_sequence(
}

if (count > message_sequence->capacity) {
RMW_SET_ERROR_MSG("Insuffient capacity in message_sequence");
RMW_SET_ERROR_MSG("Insufficient capacity in message_sequence");
return RMW_RET_INVALID_ARGUMENT;
}

if (count > message_info_sequence->capacity) {
RMW_SET_ERROR_MSG("Insuffient capacity in message_info_sequence");
RMW_SET_ERROR_MSG("Insufficient capacity in message_info_sequence");
return RMW_RET_INVALID_ARGUMENT;
}

Expand Down Expand Up @@ -1439,6 +1447,10 @@ rmw_create_client(
context_impl,
"unable to get rmw_context_impl_s",
return nullptr);
if (context_impl->is_shutdown()) {
RMW_SET_ERROR_MSG("context_impl is shutdown");
return nullptr;
}
if (!context_impl->session_is_valid()) {
RMW_SET_ERROR_MSG("zenoh session is invalid");
return nullptr;
Expand Down Expand Up @@ -1701,6 +1713,10 @@ rmw_create_service(
context_impl,
"unable to get rmw_context_impl_s",
return nullptr);
if (context_impl->is_shutdown()) {
RMW_SET_ERROR_MSG("context_impl is shutdown");
return nullptr;
}
if (!context_impl->session_is_valid()) {
RMW_SET_ERROR_MSG("zenoh session is invalid");
return nullptr;
Expand Down Expand Up @@ -2581,7 +2597,7 @@ rmw_service_server_is_available(
static_cast<rmw_zenoh_cpp::ClientData *>(client->data);
if (client_data == nullptr) {
RMW_SET_ERROR_MSG_WITH_FORMAT_STRING(
"Unable to retreive client_data from client for service %s", client->service_name);
"Unable to retrieve client_data from client for service %s", client->service_name);
return RMW_RET_INVALID_ARGUMENT;
}

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

# Set VCS_VERSION to include latest changes from zenoh/zenoh-c to benefit from :
# - https://github.com/eclipse-zenoh/zenoh/pull/1685 (Fix deadlock in advanced subscription undeclaration)
# - https://github.com/eclipse-zenoh/zenoh/pull/1696 (Fix SHM Garbage Collection (GC) policy)
ament_vendor(zenoh_c_vendor
VCS_URL https://github.com/eclipse-zenoh/zenoh-c.git
VCS_VERSION 57d5e4d31d9b38fef34d7bcad3d3e54869c4ce73
VCS_VERSION 61d8fcc136ce4ed36d921a32244da4f3d81a6097
CMAKE_ARGS
"-DZENOHC_CARGO_FLAGS=${ZENOHC_CARGO_FLAGS}"
"-DZENOHC_BUILD_WITH_UNSTABLE_API=TRUE"
Expand All @@ -28,11 +31,12 @@ ament_vendor(zenoh_c_vendor

ament_export_dependencies(zenohc)

# Set VCS_VERSION to include latest changes from zenoh-c to benefit from :
# Set VCS_VERSION to include latest changes from zenoh-cpp to benefit from :
# - https://github.com/eclipse-zenoh/zenoh-cpp/pull/342 (Fix include what you use)
# - https://github.com/eclipse-zenoh/zenoh-cpp/pull/363 (Fix memory leak in string deserialization)
ament_vendor(zenoh_cpp_vendor
VCS_URL https://github.com/eclipse-zenoh/zenoh-cpp
VCS_VERSION 964b64dc8b935a43147287199e7bb12da7b141e6
VCS_VERSION 05942637c29d3346ad18bab5a178aeebf4be5d62
CMAKE_ARGS
-DZENOHCXX_ZENOHC=OFF
)
Expand Down

0 comments on commit 6560944

Please sign in to comment.