Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for content filtered topics #302

Merged
merged 14 commits into from
Mar 21, 2022

Conversation

iuhilnehc-ynos
Copy link
Contributor

Related to ros2/design#282 to add content-filtered-topic interfaces.

@iuhilnehc-ynos
Copy link
Contributor Author

rebase and ready to implement CFT for rmw_fastrtps

@fujitatomoya
Copy link
Collaborator

@ivanpauno @wjwwood @clalancette could you review this?
CC: @MiguelCompany @asorbini

Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

The rmw API looks good to me.

What is going to be the behavior for DDS vendors that don't support content filtering?

rmw/include/rmw/subscription_content_filter_options.h Outdated Show resolved Hide resolved
@fujitatomoya
Copy link
Collaborator

@ivanpauno

What is going to be the behavior for DDS vendors that don't support content filtering?

NOT SUPPORT will be returned to application for now.

https://github.com/ros2/design/pull/282/files#diff-0cb9ecc495b4e57ddcb33bd070916b8cc1a2c5a812c4ec2020f93b5bb858d197R221-R225

we have been discussing internally, but not implementing the rcl filtering function yet. this is something we could do as follow-up, but we are not positive on this approach.

@iuhilnehc-ynos
Copy link
Contributor Author

@ivanpauno @fujitatomoya

What is going to be the behavior for DDS vendors that don't support content filtering?

There are two cases(1. create a subscriber with the content filter at the beginning; 2. set content filter after creating a subscriber that can be non-content filter) to set content filtering.

In the first case, it just returns the subscriber as normal with an is_cft_enabled flag that is false.
In the second, it returns NOT SUPPORT as @fujitatomoya mentioned.

@ivanpauno
Copy link
Member

ivanpauno commented Mar 1, 2022

we have been discussing internally, but not implementing the rcl filtering function yet. this is something we could do as follow-up, but we are not positive on this approach.

I'm not sure if it's a good idea to add a feature only supported by one DDS vendor.
In that case, we're not going to be able to take much advantage of the feature.

@clalancette @wjwwood any opinion?

@MiguelCompany
Copy link

I'm not sure if it's a good idea to add a feature only supported by one DDS vendor.

@ivanpauno We've been working hard to have this feature on Fast DDS. It has just been released with v2.5.1

We are changing the Fast DDS branch for rolling in ros2/ros2#1241

@iuhilnehc-ynos Has been working on the rmw_fastrtps integration but we didn't want ros2/ros2#1241 to block the review of the RMW interfaces, so that's why we decided to start with the empty stub, and the content filter implementation on rmw_fastrtps will be done on a follow-up PR.

@ivanpauno
Copy link
Member

@iuhilnehc-ynos Has been working on the rmw_fastrtps integration but we didn't want ros2/ros2#1241 to block the review of the RMW interfaces, so that's why we decided to start with the empty stub, and the content filter implementation on rmw_fastrtps will be done on a follow-up PR.

Well that sounds way better!
It's still a bit strange to me to add a major feature not supported by all rmw implementations.
Ideally, we should have a way to still use content filtering in the implementations that don't support the feature, even if in that case there's no performance benefit.

@fujitatomoya
Copy link
Collaborator

@MiguelCompany thanks for the follow-up

@ivanpauno sorry i did not mention that rmw_fastrtps status. that will be supported as well. (So rmw_fastrtps and rmw_connextdds will be supported with this PR for Humble.)

Ideally, we should have a way to still use content filtering in the implementations that don't support the feature, even if in that case there's no performance benefit.

okay we just wanted to discuss with community how we wanna go for sure. if that is the way to go, we are expecting that we could integrate this filtering in rcl. (expecting that no interfaces need to be changed.) that is something we can do, and we will do that after this.

@fujitatomoya
Copy link
Collaborator

Or if rmw_cyclonedds has a plan to support content filtering, we are also willing to work on rmw_cyclonedds to enable that. in this case, we do not really need filtering in rcl?

@ivanpauno
Copy link
Member

Or if rmw_cyclonedds has a plan to support content filtering, we are also willing to work on rmw_cyclonedds to enable that. in this case, we do not really need filtering in rcl?

Maybe not in that case, but it will make implementing a fully featured rmw implementation much harder.

@fujitatomoya
Copy link
Collaborator

okay, sounds good to us. but can we do that as follow-up, we do not think that is required to have this PR in the mainline.
Since we have been waiting for a long time to have feedback, we would like to have some time to address rcl filtering if it is required after consensus. (but we will do that!)

@ivanpauno
Copy link
Member

That sounds good to me.
@clalancette @wjwwood opinions?

@fujitatomoya
Copy link
Collaborator

@iuhilnehc-ynos could you also share your thought?

@fujitatomoya
Copy link
Collaborator

@wjwwood can you review this?

@fujitatomoya
Copy link
Collaborator

fujitatomoya commented Mar 9, 2022

@iuhilnehc-ynos

There are two cases(1. create a subscriber with the content filter at the beginning;
2. set content filter after creating a subscriber that can be non-content filter) to set content filtering.
In the first case, it just returns the subscriber as normal with an is_cft_enabled flag that is false.

precisely this is more like, user can create a subscriber with content filtering option that include expression and parameters.
i thought that this was okay to create subscriber implicitly, and application can ask if CFT is enabled.
but it would be nice to fail the subscriber creation with error code? this is more direct message that user cannot use CFT with current RMW implementation?
what would you think? @ivanpauno @wjwwood (sorry in today's call, i mentioned this incorrectly.)

In the second, it returns NOT SUPPORT as @fujitatomoya mentioned.

this seems to be no problem.

Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

I have done a more detailed review now, I still have to take a look at the tests

rmw/include/rmw/subscription_content_filter_options.h Outdated Show resolved Hide resolved
rmw/include/rmw/subscription_content_filter_options.h Outdated Show resolved Hide resolved
rmw/include/rmw/subscription_content_filter_options.h Outdated Show resolved Hide resolved
rmw/include/rmw/rmw.h Show resolved Hide resolved
@ivanpauno ivanpauno changed the title add content-filtered-topic interfaces Add support for content filtered topics Mar 10, 2022
Chen Lihui added 11 commits March 18, 2022 11:04
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
remove constness for rmw_subscription because is_cft_supported might be updated

Signed-off-by: Chen Lihui <lihui.chen@sony.com>
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
nit
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
@iuhilnehc-ynos
Copy link
Contributor Author

iuhilnehc-ynos commented Mar 18, 2022

Rebased the 5 repositories, then re-run CI based on #302 (comment)

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

Updated (linked error on windows, fixed in rmw_fastrtps):

  • Windows Build Status

@fujitatomoya
Copy link
Collaborator

windows CI unstable, https://ci.ros2.org/job/ci_windows/16730/, this is not related to CFT RMW fix.

@ivanpauno @wjwwood
CC: @iuhilnehc-ynos

could you help us to merge the following PRs for RMW CFT? we do not have access permission for cyclone and connextdds.

rmw_connextdds is currently stub to push the interfaces, but the following can be pushed afterwards. (CC: @asorbini )
we tried to fix the problem, but for now we ended up having stub to get the interfaces at 1st.

Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

LGTM!

rmw/src/subscription_content_filter_options.c Outdated Show resolved Hide resolved
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
@fujitatomoya
Copy link
Collaborator

CI with ros2/rmw_connextdds#68

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

@fujitatomoya
Copy link
Collaborator

CI again with ros2/rmw_connextdds#68 (see ros2/rmw_connextdds#68 (comment))

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

@asorbini
Copy link

I started another Windows build since I should have now resolved the build issues: Build Status

@fujitatomoya
Copy link
Collaborator

CI is green, i will merge this into mainline.

@ivanpauno
Copy link
Member

@fujitatomoya are the other PRs ready as well?

e.g. ros2/rmw_connextdds#68 has some conflicts

@ivanpauno
Copy link
Member

@fujitatomoya are the other PRs ready as well?

e.g. ros2/rmw_connextdds#68 has some conflicts

Sorry, I see you merged ros2/rmw_connextdds#77 instead.

@fujitatomoya
Copy link
Collaborator

@ivanpauno we still have some unstable problems for ros2/rmw_connextdds#68, so we pushed stub version ros2/rmw_connextdds#77 to push the interfaces in the master.

@fujitatomoya
Copy link
Collaborator

yeah, i will check the unstable reasons but i am not sure if we can fix it in today. (CC: @asorbini )

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.

5 participants