Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
low_pass_filter.hpp
Go to the documentation of this file.
1#pragma once
2#include "filter.hpp"
3
10class LowPassFilter : public Filter {
11private:
12 double alpha_;
13 double prev_value_;
14public:
21 LowPassFilter(double alpha, double initial_value = 0.0);
22
29 double filter(double input) override;
30
36 void reset(double value = 0.0) override;
37};
Abstract base class that defines the interface for single variable filters Derived classes must imple...
Definition filter.hpp:8
Low Pass Filter class.
double filter(double input) override
Apply the low pass filter to a new input.
double prev_value_
Previous filtered value.
double alpha_
Smoothing factor.
void reset(double value=0.0) override
Reset the filter to a specific value.