Skip to content

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

Open
davmoli wants to merge 2 commits into
ros-controls:masterfrom
davmoli:add-lpf-initial-value
Open

Add configure() overload to set the initial LPF state#657
davmoli wants to merge 2 commits into
ros-controls:masterfrom
davmoli:add-lpf-initial-value

Conversation

@davmoli

@davmoli davmoli commented Aug 13, 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.

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.

In LPF, shouldn't there be a way to initialize the filtered state?

1 participant