Skip to content

Conversation

ankurbodhe
Copy link
Contributor

This PR migrates and enhances the chained_filter_controller originally implemented during the ROSCon 2024 control workshop. The controller enables chaining and filtering of state interfaces through a sequence of filters.

Changes introduced:

  1. Ported chained_filter_controller from workshop reference implementation.
  2. Developed unit tests covering:
    • Initialization and lifecycle behavior.
    • Filter configuration and chaining.
    • Correct propagation of state values through the filter stack.

@ankurbodhe
Copy link
Contributor Author

@christophfroehlich I just made another commit to fix the issues in the workflow.. requesting you to approve to workflow

@saikishor
Copy link
Member

@ankurbodhe can you fix the pre-commit jobs?

Is this ready for review?

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contribution!
In general, have a look at other packages in this repository to follow the (code) style, copyright claims etc.

Please address my comments and also fix the pre-commit failures as Sai already has mentioned.

@christophfroehlich
Copy link
Contributor

@ankurbodhe can I help you to finish this PR? We also have to apply the changes of #1697 to the new CMakeLists.

@ankurbodhe
Copy link
Contributor Author

@christophfroehlich Sorry had a hectic work schedule... my calendar just freed up and would be working on completing the PR.. will be working on this everyday now until completion.

@christophfroehlich
Copy link
Contributor

no worries. don't hesitate to ask if there are any doubts how to proceed

@ankurbodhe ankurbodhe force-pushed the abodhe-impl-filters-plugin branch from c61a23d to c3a79de Compare May 30, 2025 23:40
@christophfroehlich
Copy link
Contributor

@ankurbodhe please don't force-push to already reviewed PRs, it just makes subsequent reviews slow. There is no need for a clean history, as we squash PRs at the time of merging into the base branches.
Ping me again if it is ready for the next review round.

Copy link
Contributor

This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete.

@github-actions github-actions bot added the stale label Jul 16, 2025
@github-actions github-actions bot removed the stale label Jul 22, 2025
Copy link

codecov bot commented Jul 22, 2025

Codecov Report

❌ Patch coverage is 92.35294% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.07%. Comparing base (a01fd0b) to head (ecba738).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
chained_filter_controller/src/chained_filter.cpp 79.68% 9 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1634      +/-   ##
==========================================
+ Coverage   85.98%   86.07%   +0.08%     
==========================================
  Files         129      133       +4     
  Lines       13112    13282     +170     
  Branches     1144     1153       +9     
==========================================
+ Hits        11275    11432     +157     
- Misses       1469     1478       +9     
- Partials      368      372       +4     
Flag Coverage Δ
unittests 86.07% <92.35%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ned_filter_controller/test/test_chained_filter.cpp 100.00% <100.00%> (ø)
...oller/test/test_load_chained_filter_controller.cpp 100.00% <100.00%> (ø)
...r_controller/test/test_multiple_chained_filter.cpp 100.00% <100.00%> (ø)
chained_filter_controller/src/chained_filter.cpp 79.68% <79.68%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

saikishor
saikishor previously approved these changes Aug 11, 2025
Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two things. Rest looks spot on

const rclcpp::Time & time, const rclcpp::Duration & period) override;

protected:
std::vector<hardware_interface::StateInterface> on_export_state_interfaces() override;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this controller right now only works as a filter for state Interfaces?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so yes ;) Do you think this should be two different controllers, one for state and one for command interfaces? Or add another parameter list, and handle them in parallel?
If this does not need a change to the package or plugin name, I'd add a follow-up issue for that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can create a follow-up issue for that. I think the same controller can be utilized for this by extending it with parameters etc

@christophfroehlich christophfroehlich dismissed stale reviews from saikishor and themself via 089f3ef August 12, 2025 21:04
saikishor
saikishor previously approved these changes Aug 13, 2025
@christophfroehlich christophfroehlich dismissed stale reviews from saikishor and themself via fb51e25 August 13, 2025 06:36
saikishor
saikishor previously approved these changes Aug 13, 2025
Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@christophfroehlich christophfroehlich changed the title Implemented a generic filters plugin Add a generic chained_filter_controller Aug 13, 2025
Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spot on!

@christophfroehlich christophfroehlich merged commit 228c586 into ros-controls:master Aug 13, 2025
26 of 28 checks passed
@christophfroehlich christophfroehlich added the backport-jazzy Triggers PR backport to ROS 2 jazzy. label Aug 13, 2025
mergify bot pushed a commit that referenced this pull request Aug 13, 2025
Co-authored-by: Christoph Froehlich <[email protected]>
(cherry picked from commit 228c586)

# Conflicts:
#	doc/release_notes.rst
@christophfroehlich christophfroehlich linked an issue Aug 13, 2025 that may be closed by this pull request
4 tasks
christophfroehlich added a commit that referenced this pull request Aug 13, 2025
Co-authored-by: Ankur Bodhe <[email protected]>
Co-authored-by: Christoph Fröhlich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-jazzy Triggers PR backport to ROS 2 jazzy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a generic filters plugin
3 participants