|
Formula Student Autonomous Systems
The code for the main driverless system
|
Low Pass Filter class. More...
#include <low_pass_filter.hpp>


Public Member Functions | |
| LowPassFilter (double alpha, double initial_value=0.0) | |
| Construct a new Low Pass Filter object. | |
| double | filter (double input) override |
| Apply the low pass filter to a new input. | |
| void | reset (double value=0.0) override |
| Reset the filter to a specific value. | |
Public Member Functions inherited from Filter | |
| virtual | ~Filter ()=default |
| Virtual destructor for safe polymorphic use. | |
Private Attributes | |
| double | alpha_ |
| Smoothing factor. | |
| double | prev_value_ |
| Previous filtered value. | |
Low Pass Filter class.
This class implements a simple first-order low pass filter.
Definition at line 10 of file low_pass_filter.hpp.
| LowPassFilter::LowPassFilter | ( | double | alpha, |
| double | initial_value = 0.0 |
||
| ) |
Construct a new Low Pass Filter object.
| alpha | Smoothing factor (0 < alpha < 1) |
| initial_value | Initial filtered value |
Definition at line 3 of file low_pass_filter.cpp.
|
overridevirtual |
Apply the low pass filter to a new input.
| input | New input value |
Implements Filter.
Definition at line 6 of file low_pass_filter.cpp.

|
overridevirtual |
Reset the filter to a specific value.
| value | Value to reset the filter to |
Implements Filter.
Definition at line 11 of file low_pass_filter.cpp.
|
private |
Smoothing factor.
Definition at line 12 of file low_pass_filter.hpp.
|
private |
Previous filtered value.
Definition at line 13 of file low_pass_filter.hpp.