-
Notifications
You must be signed in to change notification settings - Fork 396
Add filtering capability to ft_broadcaster #1814
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
base: master
Are you sure you want to change the base?
Add filtering capability to ft_broadcaster #1814
Conversation
…ility-to-fts-broadcaster-rolling
…ility-to-fts-broadcaster-rolling
Co-authored-by: Xavier Guay <[email protected]>
Co-authored-by: Xavier Guay <[email protected]>
Also, an additional consideration about the logic: Because of ros/filters#89, there's not really a way to tell if a chain is actually configured. So now, even if the user doesn't provide a chain config, it will be configured with an empty filter list. At the end, this just means that the filtered message will always be published, with output = input. If ros/filters#90 gets merged, the broadcaster will know no filter chain was configured and omit publishing the unnecessary message. |
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.
Thanks for picking this up.
This is a continuation of #559 as it was inactive.
It was not inactive, but it was missing more reviews ;)
2. Added some relevant tests IMHO, the previous tests were testing the business logic of the filters themselves, that is, checking that the actual computations were correct, rather than the actual new logic for adding filters. I added three tests for configuring, activating/deactivating, and updating with a configured filter chain. Just one consideration: I changed a little bit the logic of SetUpFTSBroadcaster a little bit to accept a node name. This is because I added some parameters in the YAML that are needed for the broadcaster with filters. I cannot do `set_parameter` because the filter chain expects the parameters to be overrides.
But now there is no test if any filtering is performed, or not? E.g., not calling the filter-update will not be covered by the tests?
Edit:
Please install pre-commit and fix the failing tests..
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1814 +/- ##
=======================================
Coverage 85.23% 85.23%
=======================================
Files 142 143 +1
Lines 13734 13794 +60
Branches 1190 1194 +4
=======================================
+ Hits 11706 11758 +52
- Misses 1632 1636 +4
- Partials 396 400 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
91c7785
to
ad4dcfa
Compare
Hello @christophfroehlich Thanks for your comment! True, my bad! I hope it's ok opening this new MR. I had actually run it with pre-commit, but somehow pushed with some rules failing. It should be fixed now. Sorry for that!
Yeah, you are right. I didn't know how to properly add it without including unnecessary logic checks for the underlying filters. Would you prefer re-adding a test with one of the simple filters or creating a dummy filter for testing? P.D.: Sorry for the force push! |
creating a dummy filter would be ok, but using an existing one is also fine as we have control_toolbox as dependency in this repo (but not in this package, right? this would speak for the dummy or one from ros/filters directly) |
Sounds good to me. |
Good morning! Yeah, there's no dependency for I added I updated the tests accordingly and included an additional one to ensure the correct message is received. Everything seems to be working fine! Thanks a lot! |
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.
This looks quite good already. Can you please update
- https://github.com/ros-controls/ros2_controllers/blob/master/force_torque_sensor_broadcaster/doc/userdoc.rst
- https://github.com/ros-controls/ros2_controllers/blob/master/doc/release_notes.rst
then this is good to be merged.
|
||
// As the sensor_filter_chain parameter is of type 'none', we cannot directly check if it is | ||
// present. Even if the sensor_filter_chain parameter is not specified, the filter chain will be | ||
// correctly configured with an empty list of filters (https://github.com/ros/filters/issues/89). |
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.
how to proceed here?
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 would say until the new version of filters with my MR gets synced into Humble, it has to stay like it is. After that, we can check the length of the chain and act accordingly.
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.
filters 2.2.2 is released, and only the sync to jazzy is missing. So we can update this PR already, and just hold an eventual backport to jazzy until jazzy got synced.
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.
Good job guys
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.
Shouldn't we use get_length()
now?
Co-authored-by: Christoph Fröhlich <[email protected]>
Good morning @christophfroehlich! Sorry for the delay, things get slower in summer! 😄 Everything should be ready for merging. Please let me know if you think further changes may be needed. Thanks a lot for your assistance! |
Good morning!
This is a continuation of #559 as it was inactive.
The changes are minimal:
sensor_filter_chain
to the parameters, which serves as documentation.IMHO, the previous tests were testing the business logic of the filters themselves, that is, checking that the actual computations were correct, rather than the actual new logic for adding filters. I added three tests for configuring, activating/deactivating, and updating with a configured filter chain. Just one consideration: I changed a little bit the logic of SetUpFTSBroadcaster a little bit to accept a node name. This is because I added some parameters in the YAML that are needed for the broadcaster with filters. I cannot do
set_parameter
because the filter chain expects the parameters to be overrides.Thanks a lot for your time!
Óscar