-
Notifications
You must be signed in to change notification settings - Fork 16
Update subscriber filter #126
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
Merged
ahcorde
merged 13 commits into
ros-perception:rolling
from
elsayedelsheikh:advanced_subscriber_filter
Jul 21, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9a396ae
initial thoughts
elsayedelsheikh c520324
Make useful for derived classes
elsayedelsheikh 613d980
New subscriberfilter class
elsayedelsheikh b77e5e1
make copyright test happy
elsayedelsheikh da90eff
update subscriber_filter
elsayedelsheikh dc5077d
Hide methods from users
elsayedelsheikh 34431b3
Make linters happy
elsayedelsheikh e4ab912
Feedback
elsayedelsheikh 1eacb27
Refactor
elsayedelsheikh 8c4ef81
No more node_interfaces
elsayedelsheikh 0a0372f
Fix conflicts
elsayedelsheikh a847096
Added missing include
ahcorde 02b9490
final touch
elsayedelsheikh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Then remove if it shouldn't be used? 😆
Uh oh!
There was an error while loading. Please reload this page.
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.
Won't be able to create a class object if not implemented, Check this
So that I put them under private so no one uses them :D
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.
Ugh. I think that should be reverted too with the subscribe function similarly templated by NodeT that can be auto-deduced. Before I think it was a pain because the entire class was templated rather than just the method that can autodeduce the type from the arguments.
@ahcorde what do you think?
Uh oh!
There was an error while loading. Please reload this page.
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.
Exposing the
RequiredInterfacesto the application code is super nasty and can be populated internally to the message filter from the argument provided NodeT. I think merging this in March was not the best solution ros2/message_filters#113. UsingRequiredInterfacesas an input if the method is templated will still work as aNodeTas long as it provides the sameget_X_base_interface()method. That appears to be the case https://github.com/ros2/rclcpp/blob/rolling/rclcpp/include/rclcpp/node_interfaces/node_interfaces.hpp#L108-L110There 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.
This is very nice documented issue ros2/geometry2#698 why we shouldn't use templates and why we should use
rclcpp::node_interfaces::NodeInterfacesThere is a ppt too https://docs.google.com/presentation/d/1bdXOOZPhR9yAnyGNxoLhuO_bU4RW5IjnzvCtrVlpe_g/edit?slide=id.g24afec4abf4_0_0#slide=id.g24afec4abf4_0_0
Maybe we can still improve something in message filter, but I prefer
rclcpp::node_interfaces::NodeInterfacesinstead ofNodeTThere 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.
Would we need to update message filters too?
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.
I think I'm lost here... 🤔
So you guys are proposing to use
f(*NodeT)for implicit conversion tonode_interfaces, similar tohttps://github.com/ros2/message_filters/blob/4f17c17813e7b84e34cc287143ddf70471c78d6c/include/message_filters/subscriber.hpp#L168-L173
Then, Would it be ok to leave
SubscriberBasepure virtual methods underprivatewithout implementation{ }?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.
Let me create the PR with my suggestions, and we can move forward from there
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.
Here my suggestions #129 @SteveMacenski @elsayedelsheikh
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.
That looks good to me! I think after rebasing onto that, whatever changes are still required for aligning with message filters are still related but simplifies things quite a bit in the best ways.
Just to check, all this works with a
rclcpp_lifecycle::LifecycleNodeor even anav2::LifecycleNodein auto-populating that interfaces objcet, correct? All the docs make me think that's the case, but just verifying since I still see the specializedrclcpp::Nodeconstructors in your PR. Couldn't those be removed?