Skip to content

Conversation

@YuanYuYuan
Copy link
Contributor

Description

This PR aims to provide an API for accessing the Zenoh session programmatically. It also includes a test to demonstrate its usage.

@YuanYuYuan YuanYuYuan force-pushed the feat/expose-zenoh-session branch from b80cc6c to 3b4c9b3 Compare November 30, 2025 18:27
/// \param[in] context The RMW context.
/// \return A shared pointer to the Zenoh session, or nullptr if invalid.
RMW_PUBLIC
const std::shared_ptr < zenoh::Session >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const std::shared_ptr < zenoh::Session >
const std::shared_ptr<zenoh::Session>

)

if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move the upper BUILD_TESTING conditional block code here

find_package(zenoh_cpp_vendor REQUIRED)

if(BUILD_TESTING)
find_package(rclcpp REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this the same BUILD_TESTING conditional

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>rclcpp</test_depend>
<test_depend>std_msgs</test_depend>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you using std_msgs somewhere ?


<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>rclcpp</test_depend>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if we can do this here. This might generate a circular depencency. rclcpp it build based on the rmw.

we can create a test_rmw_zenoh_cpp new package and include the tests there

Copy link
Member

@Yadunund Yadunund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YuanYuYuan thanks for looking into this topic! It has come up in prior discussions and the way we'd like to implement this is to add an API to upstream rmw that return a void* pointer of the underlying middleware. This would also benefit other middlewares. Do you mind working on a proposal for such an API in https://github.com/ros2/rmw/issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants