add rcl_publisher/subscription_event_type_is_supported().#1317
Conversation
Signed-off-by: Tomoya Fujita <tomoya.fujita825@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds runtime introspection APIs in rcl to check whether specific publisher/subscription event types are supported by the active RMW implementation, and updates/extends tests accordingly (follow-up to ros2/rmw#394).
Changes:
- Introduce
rcl_publisher_event_type_is_supported()andrcl_subscription_event_type_is_supported()inrcl. - Update an existing event test to use the new
rcl_subscription_*_is_supported()API. - Add new unit tests verifying the new
rclAPIs matchrmw_event_type_is_supported()results.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
rcl/src/rcl/event.c |
Implements the two new *_event_type_is_supported() helper APIs by mapping to rmw_event_type_is_supported(). |
rcl/include/rcl/event.h |
Declares the new public APIs and documents their intent and behavior. |
rcl/test/rcl/test_events.cpp |
Updates one skip-condition to use the new API and adds coverage to compare rcl vs rmw support results. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fujitatomoya
left a comment
There was a problem hiding this comment.
@ahcorde can you review this? (probably after lyrical luth release.)
|
@ahcorde can you see my comment #1317 (comment) and approve this? i just rebased ros2/rclpy#1647 and ros2/rclcpp#3132 too. |
|
Pulls: #1317, ros2/rclcpp#3132, ros2/rclpy#1647 |
|
Pulls: #1317, ros2/rclcpp#3132, ros2/rclpy#1647 |
|
@ahcorde requesting review on this. |
|
Pulls: #1317, ros2/rclcpp#3132, ros2/rclpy#1647 |
|
@ahcorde CI looks good to me, can you approve this? |
|
@fujitatomoya should be backport this ? |
|
personally we do not need to backport this, if someone else raises the request. |
Port rclpy PR ros2/rclpy#1647 (commit cfac914) to expose `rcl_publisher_event_type_is_supported()` and `rcl_subscription_event_type_is_supported()`, so user code can query the active RMW implementation about which QoS events it delivers before wiring up a handler. The underlying rcl APIs (ros2/rcl#1317) ship in ROS 2 Rolling only. * Native binding (`src/rcl_event_handle_bindings.cpp`): N-API wrappers exported as `isPublisherEventTypeSupported` / `isSubscriptionEventTypeSupported`, both gated by `#if ROS_VERSION >= 5000`. * JS wrapper (`lib/event_handler.js`): public `isPublisherEventTypeSupported(eventType)` / `isSubscriptionEventTypeSupported(eventType)`. Availability guard keys off `typeof rclnodejs.<fn> !== 'function'` (mirrors the C++ build gate, matches the existing pattern in `lib/action/client.js`) and throws `OperationError` on pre-rolling. Argument validation uses `TypeValidationError` / `RangeValidationError` for consistency with `lib/time.js`, `lib/logging.js`, `lib/message_serialization.js`. * Tests (`test/test-event-handle.js`): two suites gated on native-symbol presence — asserts the unavailable-throw path, boolean returns for every enum value, `MATCHED` reported supported, and the right validation-error class/message for invalid inputs. Fix: #1519
…b drift rclcpp HEAD calls rcl_publisher/subscription_event_type_is_supported (ros2/rcl#1317), which the apt-installed ros-rolling-rcl on the noble base image doesn't yet ship. Importing rcl from source via vcs lets colcon build the symbols rclcpp expects without bumping the Ubuntu base. Future symbol drift: add another entry to overlay.repos.
…b drift rclcpp HEAD calls rcl_publisher/subscription_event_type_is_supported (ros2/rcl#1317), which the apt-installed ros-rolling-rcl on the noble base image doesn't yet ship. Importing rcl from source via vcs lets colcon build the symbols rclcpp expects without bumping the Ubuntu base. Future symbol drift: add another entry to overlay.repos.
…b drift rclcpp HEAD calls rcl_publisher/subscription_event_type_is_supported (ros2/rcl#1317), which the apt-installed ros-rolling-rcl on the noble base image doesn't yet ship. Importing rcl from source via vcs lets colcon build the symbols rclcpp expects without bumping the Ubuntu base. Future symbol drift: add another entry to overlay.repos.
Description
follow up of ros2/rmw#394
Fixes # (issue)
Is this user-facing behavior change?
No
Did you use Generative AI?
Yes Claude Code Opus4.6
Additional Information