ros-controls / control_toolbox

This package contains several C++ classes useful in writing controllers.
https://control.ros.org
BSD 3-Clause "New" or "Revised" License
128 stars 98 forks source link

LowPassFilter accepts parameters only from node #164

Open roncapat opened 1 year ago

roncapat commented 1 year ago

I wanted to use LowPassFilter, but it seems to me that there is no way to pass parameters via API (like PID constructor or setGains() call).

Wouldn't be better to make LowPassFilter support parameter passing via API and a corresponding LowPassFilterROS querying parameters from configuration instead? Or just modifying LowPassFilter to support both scenarios...

I would contribute a PR following your feedbacks of course.

CalaW commented 8 months ago

I think it is possible to change the parameters at runtime using this->set_parameter. Similar to https://github.com/ros-controls/control_toolbox/blob/759d95422893e03fdc88bfe0430370b13902b6f7/test/control_filters/test_low_pass_filter.cpp#L27

christophfroehlich commented 8 months ago

I support the idea of a base implementation without ROS, and then being wrapped in the filters-class with the ROS node interfaces. @roncapat Even if your idea is a few months old, I'd welcome a PR.