-
Notifications
You must be signed in to change notification settings - Fork 34
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 #12
Add support for content-filtered topics #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall it seems to be okay. test would be ideal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things look pretty good.
My main concern is with functions RMW_Connext_Subscriber::set_cft_expression_parameters
/get_cft_expression_parameters
which, besides the comments I added inline, have a few other issues that will need to be resolved:
- Function
RMW_Connext_Subscriber::set_cft_expression_parameters
seems to duplicate some logic fromRMW_Connext_Subscriber::finalize
andRMW_Connext_Subscriber::create
, in order to delete and recreate the underlyingDDS_DataReader
. Instead of duplicating this logic, I would refactor the other two functions and rely on them here.RMW_Connext_Subscriber::finalize
could be made to take an argumentconst bool reset_cft
, which, iftrue
, would force the function to perform only a subset of the operations it would usually perform (ie. only: invalidate the status condition wrapper, return loaned samples, delete content filter, delete data reader, and -- not currently done byfinalize()
-- delete the status condition wrapper).- Some of the logic in
RMW_Connext_Subscriber::create
could be refactored into a separateRMW_Connext_Subscriber::initialize_datareader
function to encapsulate the logic required to determine DataReaderQos and create the DataReader. The function might have a parameter (e.g.const bool on_cft_reset
) to make it behave differently if needed. - These are just suggestions, and I'm open to other ways to refactor the code, but I'd like to try to extract the logic to "delete and re-initialize the DataReader" into a separate function, hopefully trying to avoid duplication with the create/finalize functions as much as possible.
- Another problem in these functions is that, as it is, they will not compile with RTI Connext DDS Micro, because this version doesn't support content-filtered topic, thus symbols like
DDS_ContentFilteredTopic
andDDS_ContentFilteredTopic_get_filter_expression
will not be available.- I suggest to introduce at least two new functions, defined in
dds_api.hpp
, and implemented indds_api_ndds.cpp
anddds_api_rtime.cpp
to abstract the logic to get and set the filter expression on a content filtered topic object using only symbols available in both implementations, e.g.: rmw_ret_t rmw_connextdds_get_cft_filter_expression(DDS_TopicDescription * const topic_desc, char ** const expr_out)
rmw_ret_t rmw_connextdds_set_cft_filter_expression(DDS_TopicDescription * const topic_desc, struct DDS_StringSeq * const cft_params)
- I suggest to introduce at least two new functions, defined in
Once these issues are resolved, I think we will be good to merge (or very very close to it :) )
I just pushed a commit (598979b) which introduced some conflicts with this PR because it refactors the code related to WaitSets and Conditions. There are now two different implementations of WaitSets and Conditions (which can be selected at compile-time), but as far as this PR is concerned, the only relevant difference I think is a small change in the signature of I apologize for the additional work, but hopefully the conflicts should be easy to fix. Let me know if you have any questions. |
Thanks for the notification. Even if I fixed all the issues, I think we should not merge this PR, because it leads to a compilation problem since something update about |
I had actually missed it, but yes, this PR can only be merged after changes to Which actually lead me to request another change to make sure that the code continues to build with older ROS2 releases. |
c7cb265
to
a0de1bc
Compare
I have rebased from the latest branch of |
Things are looking good, thank you @iuhilnehc-ynos for addressing all my many comments! (only one left) |
I created #15 to get rid of all "feature flags" in |
I'll wait to rebase from master until that PR is merged because there might exist other updates in the future. |
Latest changes look good, holding off on approval until we can rebase on top of |
#15 was merged, so you can rebase from |
Signed-off-by: Chen Lihui <[email protected]>
Signed-off-by: Chen Lihui <[email protected]>
Co-authored-by: Andrea Sorbini <[email protected]> Signed-off-by: Chen Lihui <[email protected]>
add feature macro, some comments and something consistent, etc Co-authored-by: Andrea Sorbini <[email protected]> Signed-off-by: Chen Lihui <[email protected]>
Signed-off-by: Andrea Sorbini <[email protected]>
Signed-off-by: Andrea Sorbini <[email protected]>
Signed-off-by: Andrea Sorbini <[email protected]>
Signed-off-by: Andrea Sorbini <[email protected]>
Signed-off-by: Andrea Sorbini <[email protected]>
Signed-off-by: Andrea Sorbini <[email protected]>
Signed-off-by: Andrea Sorbini <[email protected]>
Signed-off-by: Andrea Sorbini <[email protected]>
Signed-off-by: Andrea Sorbini <[email protected]>
Signed-off-by: Andrea Sorbini <[email protected]>
Signed-off-by: Andrea Sorbini <[email protected]>
Signed-off-by: Andrea Sorbini <[email protected]>
Signed-off-by: Andrea Sorbini <[email protected]>
Signed-off-by: Andrea Sorbini <[email protected]>
Signed-off-by: Andrea Sorbini <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good 🚀
I've been thinking is_cft_supported
might be better renamed to is_cft_enabled
, but I won't block the PR for that (since that is also related to the API changes in rmw
).
@iuhilnehc-ynos I have created branch asorbini/content-filtered-topics by rebasing your commits on top of This commit updates the synchronization of the set/get CFT parameters functions to make sure that they don't overlap with any concurrent WaitSet::wait() (e.g. performed by an executor to which the subscription is attached). If you want, you can rebase your Btw, you will also need to rebase ros2/rmw#302 in order to build the new branch. I have done so in branch |
To make a function I tested with my new branch iuhilnehc-ynos/topic-content_filtered_topic-updated based on the asorbini/content-filtered-topics, but rmw_connextdds/rmw_connextdds_common/include/rmw_connextdds/rmw_waitset_std.hpp Lines 94 to 107 in 92bad59
The
It leads the second rmw_connextdds/rmw_connextdds_common/include/rmw_connextdds/rmw_waitset_std.hpp Lines 95 to 98 in 92bad59
Do you have any suggestions to fix it? |
@iuhilnehc-ynos I'm looking into reproducing this issue and digging into solution, but I'm not sure if I got all required packages (and branches). It's been a while since I worked on this PR so I'm a bit rusty on the code and I can't answer your questions without some testing :) Would it be possible for you to provide a Hopefully I already got all I need and I'll be able to come to an answer soon (building various packages, at the moment). |
Yeah, I'm gonna need some help in getting the test environment back up. As soon as you provide that repos file, I'll give it another try. |
Thanks for your response. |
I have updated https://github.com/iuhilnehc-ynos/ros2/tree/topic-debug-connextdds-cft. After building, you can try running the following commands (the original demo_nodes_cpp of ros2) at first
|
@iuhilnehc-ynos thank you! I was able to get everything built and I'm about to dig into it, I should have something later today. FYI I had to comment out |
@iuhilnehc-ynos Before I could start debugging the concurrency issue, I had a talk with @GerardoPardo and we identified an interesting alternative approach which would eliminate the problem altogether. So I went ahead, implemented it, and created #68 with the resulting changes. I tested them with the If you're ok with it, let's see if this approach can simplify our lives and continue the conversation on that PR. |
Use #68 instead of this PR, close it. |
Signed-off-by: Michael Carroll <[email protected]>
related to ros2/design#282
Signed-off-by: Chen Lihui [email protected]