Skip to content

Add content filtering support check for subscriptions#1293

Merged
fujitatomoya merged 2 commits intoros2:rollingfrom
Barry-Xu-2018:develop/topic-check-cft-is-supported
Mar 10, 2026
Merged

Add content filtering support check for subscriptions#1293
fujitatomoya merged 2 commits intoros2:rollingfrom
Barry-Xu-2018:develop/topic-check-cft-is-supported

Conversation

@Barry-Xu-2018
Copy link
Copy Markdown
Contributor

@Barry-Xu-2018 Barry-Xu-2018 commented Mar 6, 2026

Description

Currently, RMW does not provide an interface to directly determine whether a subscription supports content filtering. Implementing this interface in rcl allows other code that uses the content filter feature to be optimized, making the implementation code clearer.

Depened on ros2/rmw#415

Is this user-facing behavior change?

No.

Did you use Generative AI?

No.

Additional Information

Signed-off-by: Barry Xu <barry.xu@sony.com>
Copy link
Copy Markdown
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

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

@Barry-Xu-2018 i think we should support this feature 1st, and use it elsewhere for current existed code. what do you think?

@Barry-Xu-2018
Copy link
Copy Markdown
Contributor Author

@fujitatomoya

i think we should support this feature 1st, and use it elsewhere for current existed code. what do you think?

Yes. I think so.
I will change the status of this PR for the review.

@Barry-Xu-2018 Barry-Xu-2018 marked this pull request as ready for review March 9, 2026 05:46
Copilot AI review requested due to automatic review settings March 9, 2026 05:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an rcl API to query whether a subscription supports content filtering, aiming to let higher-level code avoid unnecessary CFT-related calls when the underlying RMW can’t support them.

Changes:

  • Add rcl_subscription_is_cft_supported() public API declaration/definition.
  • Add init-time logic in rcl_subscription_init() intended to determine CFT support.
  • Extend subscription tests to cover the new API and bad-argument behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
rcl/src/rcl/subscription.c Implements the support check and the new rcl_subscription_is_cft_supported() accessor.
rcl/include/rcl/subscription.h Declares the new public API.
rcl/test/rcl/test_subscription.cpp Adds unit tests for the new API and bad-argument cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fujitatomoya
Copy link
Copy Markdown
Collaborator

@Barry-Xu-2018 i will start CI for ros2/rmw#415 and #1293. after those are merged, we can take advantage of this new interface to check if the cft is supported in the upper layers.

@fujitatomoya
Copy link
Copy Markdown
Collaborator

Pulls: #1293, ros2/rmw#415
Gist: https://gist.githubusercontent.com/fujitatomoya/412c0e1ec108138092044abd4fdfb5f7/raw/5d9d47782cc3576b58d243380c02065c00180601/ros2.repos
BUILD args: --packages-above-and-dependencies rcl rmw
TEST args: --packages-above rcl rmw
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/18420

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@Barry-Xu-2018
Copy link
Copy Markdown
Contributor Author

Re-run CI since the failure was caused by CI internal issues

  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@fujitatomoya fujitatomoya merged commit be6ba45 into ros2:rolling Mar 10, 2026
2 of 3 checks passed
@jmachowinski
Copy link
Copy Markdown
Contributor

@Barry-Xu-2018 This PR created a lot of console spam if using cyclone.

Is there a specific reason, to why you need to perform this check during construction, and can't do it lazy ?

@Barry-Xu-2018
Copy link
Copy Markdown
Contributor Author

@jmachowinski

@Barry-Xu-2018 This PR created a lot of console spam if using cyclone.

Is there a specific reason, to why you need to perform this check during construction, and can't do it lazy ?

Sorry, I didn't notice this problem in time.
I explained the reason in this comment #1301 (comment).

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.

4 participants