More generic subscriber implementation using NodeInterfaces from rclcpp#113
More generic subscriber implementation using NodeInterfaces from rclcpp#113ahcorde merged 9 commits intoros2:rollingfrom
Conversation
|
Depending on what the maintainers prefer, we could potentially add #98 to this PR. |
clalancette
left a comment
There was a problem hiding this comment.
I haven't looked at this in much detail, but from a quick skim the big problem with this is the breakage of the API. We very much try to not break API, and if we have to, we always have a deprecation cycle to do it. So this needs to be reworked to keep the previous API, while adding in the new one.
|
Thanks for the quick feedback. Regarding the API protection: How far does that go? Just adding the overloads of the subscribe functions I dropped in the base class, or even keeping the template parameter of the subscriber class although it is now completely unused? |
I could be wrong, but I think we still need to keep the template parameter so we don't break the API of |
|
Since the template parameter is required not only by the function but also by the whole class, the API might break as soon as there is no template parameter for Adding a default template argument, which would allow to use the class and call functions without having to specify the obsolete Node Type, seems a little odd, doesn't it? |
|
Readding the NodeType Parameter with an unused default should be pretty straight forward. This should then also allow reverting the changes to the unit tests, thus, at least the tested part of the API should not be broken. However, how would you deprecate the template parameter? I am aware of Out of curiosity: How long is a deprecation cycle intended to be? A full LTS release? |
One release. For instance, if we want to get this in now, we can deprecate it for Jazzy, and then remove it for K-Turtle (which would be released in May 2025). |
|
I added another commit which aims at ensuring compatibility with the old API. This compatibility goes far enough to run all unit tests without any changes. However, there are a few things which are still open: I thought about using If none of them works, it the deprecation via a compiler warning strictly necessary?
|
8f2f66d to
d7cff5b
Compare
|
I added another commit implementing the deprecation warnings for the second template parameter (thanks @ottojo for the suggestion!). It seems like these warnings are also the reason why the CI fails (?). |
|
Any updates on when a review can be expected? |
ahcorde
left a comment
There was a problem hiding this comment.
Friendly ping @clalancette
include/message_filters/subscriber.h
Outdated
| { | ||
| public: | ||
| typedef std::shared_ptr<NodeType> NodePtr; | ||
| [[deprecated]] typedef std::shared_ptr<NodeType> NodePtr; |
ahcorde
left a comment
There was a problem hiding this comment.
Do you mind to fix the conflicts?
|
Sorry, but I currently do not have any spare time for working on this and it looks like this won't change in the near future... While I would still appreciate using the node interfaces class within message filters, I am also fine with closing this PR in order to keep the pull request overview clean (although the message filter repository has a rather small number of open PRs compared to other ROS repos). |
|
@authaldo Thanks for the response. Given that you don't have time to work on this in the near future, I'm going to go ahead and close it. If you do find you want to continue on this in the future, please feel free to reopen and we can continue. |
|
@clalancette Could you please reopen this pull request? It seems like I am not able to do this on my own. I had almost forgotten about this pull request as its initial commit has been pushed over a year ago. However, recently, @ahcorde latest comment on ros-perception/image_common#304 reminded me that I had already taken first steps along the now requested way (relying on As the problem of a missing lifecycle supports now additionally reappeared within pointcloud transport, I think it's worth tackling this again. At least the image_common package is built upon message filters, hence, this repository has to migrate first from the template parameter to |
|
awesome @authaldo happy to review your new changes |
Signed-off-by: Dominik Authaler <dominik.authaler@uni-ulm.de>
Signed-off-by: Dominik Authaler <dominik.authaler@uni-ulm.de>
…I compatibility Signed-off-by: Dominik Authaler <dominik.authaler@uni-ulm.de>
Co-authored-by: Jonas Otto <jonas@jonasotto.com> Signed-off-by: Dominik Authaler <dominik.authaler@uni-ulm.de>
Signed-off-by: Dominik Authaler <dominik.authaler@uni-ulm.de>
Signed-off-by: Dominik Authaler <dominik.authaler@uni-ulm.de>
…ess deprecation warnings Signed-off-by: Dominik Authaler <dominik.authaler@uni-ulm.de>
43e56d7 to
49dd3cb
Compare
Signed-off-by: Dominik Authaler <dominik.authaler@uni-ulm.de>
db1a0f0 to
2fc017f
Compare
|
I unfortunately forgot to sign-off the last commit and had to re-add this through a second force push. The code feels quite bloated given so many deprecation warnings. I already tried to group the constructors and methods into relevant and deprecated ones. However, one could also think about moving the deprecated constructors down below the non-deprecated methods so that anyone taking a look into the code first sees the relevant stuff. |
|
Pulls: #113 |
ahcorde
left a comment
There was a problem hiding this comment.
This might generate some new deprecation in downstream packages, I launched CI
Signed-off-by: Dominik Authaler <dominik.authaler@uni-ulm.de>
|
@ahcorde I'm guessing this can't be backported to Jazzy? Some recent refactoring in Nav2 makes this break support for Edit: I was able to get around it by casting the new node type to a rclcpp_lifecycle node, so its lower priority, but still a nice to have backport |
|
Hmm, the tick-tock deprecation apparently hasn't been done properly. Changing the signatures of the pure-virtual functions breaks descending classes. |
|
Also, with this PR (and after removing the deprecated functions), this package will lose ability to correctly resolve sub-node namespaces (because they are not reflected in any way in Create a sub-node: Compare: and
I'm not sure what's the best way to solve this.
One way would be to keep the It seems to me the more correct way would be adding sub-namespace-related functionality to What do you think? |
|
I'm sorry, I figured the latter report will be better as a standalone issue, so let's please continue in #227. |
Sorry to read that there have been issues missed in the review which now cause problems in downstream packages. However, I am not yet fully sure which downstream package you mean. Could you be more specific about that? |
Fixes #112
To be more precise, these changes allow using message_filters::Subscriber in situations, where no full rclcpp::Node / rclcpp_lifecycle::LifecycleNode is available by requiring only the relevant interfaces.