You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support check for content filter feature in subscription (#1451)
Corresponding to rclpy [d892204](ros2/rclpy@d892204) and rcl's `rcl_subscription_is_cft_supported()` API, this adds `isContentFilterSupported()` to the `Subscription` class. This allows users to query at runtime whether the underlying RMW supports content-filtered topics for a given subscription, rather than relying on hardcoded RMW name checks. Currently gated to ROS 2 Rolling only (`ROS_VERSION > 2505`); on older distros it returns `false`.
### Feature changes
- **src/rcl_subscription_bindings.cpp** — Added `IsContentFilterSupported()` N-API function calling `rcl_subscription_is_cft_supported()`, guarded by `#if ROS_VERSION > 2505`. Added `#include <rcl/subscription.h>`. Registered as `"isContentFilterSupported"` in `InitSubscriptionBindings()`.
- **lib/subscription.js** — Added `isContentFilterSupported()` method with a distro guard (`DistroUtils.getDistroId() < ROLLING` returns `false`). Added `DistroUtils` import.
- **types/subscription.d.ts** — Added `isContentFilterSupported(): boolean` to the `Subscription` interface.
- **test/test-subscription-content-filter.js** — Added a separate top-level `describe('subscription isContentFilterSupported')` block that runs on all distros. Validates the return value accounts for both the rolling requirement and RMW capability.
- **test/types/index.test-d.ts** — Added `expectType<boolean>` assertion for `isContentFilterSupported()`.
### CI changes
- **.github/workflows/linux-x64-build-and-test.yml** — Replaced `setup-ros` with `use-ros2-testing` for rolling with a nightly binary tarball approach, following the [official ROS 2 Rolling binary installation guide](https://docs.ros.org/en/rolling/Installation/Alternatives/Ubuntu-Install-Binary.html):
- Configures ROS apt sources via `ros2-apt-source` deb package.
- Installs apt packages (`test-msgs`, `mrpt-msgs`, `colcon`, `rosdep`) **before** extracting the nightly tarball, so the nightly's newer libs (e.g. `librcutils.so` with `rcutils_decode_base64`) overwrite apt's older versions.
- Extracts nightly tarball with `--strip-components=1` into `/opt/ros/rolling/` so everything lives under one prefix — single `source /opt/ros/rolling/setup.bash` like all other distros.
- Runs `rosdep install` for remaining runtime dependencies.
- Separated Electron test dependencies (`xvfb`, `libgtk-3-0`, etc.) into its own step that runs for all distros.
- Added `-y` to `apt install` for test-msgs.
- Removed stale `use-ros2-testing` parameter from `setup-ros`.
Fix: #1450
0 commit comments