-
Notifications
You must be signed in to change notification settings - Fork 391
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1814 +/- ##
==========================================
+ Coverage 85.66% 85.67% +0.01%
==========================================
Files 123 124 +1
Lines 12408 12467 +59
Branches 1056 1059 +3
==========================================
+ Hits 10629 10681 +52
- Misses 1430 1434 +4
- Partials 349 352 +3
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?
@@ -69,7 +71,33 @@ if(BUILD_TESTING) | |||
target_include_directories(test_force_torque_sensor_broadcaster PRIVATE include) | |||
target_link_libraries(test_force_torque_sensor_broadcaster | |||
force_torque_sensor_broadcaster | |||
force_torque_sensor_broadcaster_parameters |
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.
force_torque_sensor_broadcaster_parameters |
do we have to link against the parameters here?
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