Skip to content

Add configure() overload to set the initial LPF state (backport #657) - #662

Merged
christophfroehlich merged 1 commit into
kiltedfrom
mergify/bp/kilted/pr-657
Aug 20, 2026
Merged

Add configure() overload to set the initial LPF state (backport #657)#662
christophfroehlich merged 1 commit into
kiltedfrom
mergify/bp/kilted/pr-657

Conversation

@mergify

@mergify mergify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Description

LowPassFilter always initializes its state from the first update() input, so there's
no way to start it from a known value.

This PR adds a configure(const T & initial_state) overload that seeds the state: the first
update() returns initial_state and the filter converges towards the input from there.

Fixes #643

Is this user-facing behavior change?

Yes, additive only. Existing configure() calls behave exactly as before.

Did you use Generative AI?

Implementation written by hand. Claude Code (Opus 5) reviewed it and helped write the unit tests.

Additional Information

The new tests cover all three supported types (double, std::vector<double>,
WrenchStamped). These are the first direct unit tests of control_toolbox::LowPassFilter;
the existing ones only reach it through the plugin.

TODOs

To send us a pull request, please:

  • Fork the repository.
  • Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
  • Ensure local tests pass. (colcon test and pre-commit run (requires you to install pre-commit by pip3 install pre-commit)
  • Commit to your fork using clear commit messages.
  • Send a pull request, answering any default questions in the pull request interface.
  • Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

This is an automatic backport of pull request #657 done by [Mergify](https://mergify.com).

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.87500% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.16%. Comparing base (dcb8ce9) to head (c73a28c).

Files with missing lines Patch % Lines
...oolbox/include/control_toolbox/low_pass_filter.hpp 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           kilted     #662      +/-   ##
==========================================
+ Coverage   82.78%   83.16%   +0.37%     
==========================================
  Files          29       30       +1     
  Lines        2004     2043      +39     
  Branches      113      115       +2     
==========================================
+ Hits         1659     1699      +40     
+ Misses        276      274       -2     
- Partials       69       70       +1     
Flag Coverage Δ
unittests 83.16% <96.87%> (+0.37%) ⬆️

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

Files with missing lines Coverage Δ
control_toolbox/test/low_pass_filter_tests.cpp 100.00% <100.00%> (ø)
...oolbox/include/control_toolbox/low_pass_filter.hpp 88.46% <88.88%> (+0.22%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@christophfroehlich
christophfroehlich merged commit e5ad733 into kilted Aug 20, 2026
13 checks passed
@christophfroehlich
christophfroehlich deleted the mergify/bp/kilted/pr-657 branch August 20, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants