|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
32 #ifndef ONE_EURO_FILTER_H
33 #define ONE_EURO_FILTER_H
115 float tau = 1.0f / (2.f * M_PI * cutoff);
116 float te = 1.0f / filter->
rate;
117 return 1.0f / (1.0f + tau / te);
134 float cutoff = filter->
mincutoff + filter->
beta * fabsf(edx);
145 filter->
rate = 1e6f / (float)(timestamp - filter->
last_time);
static float compute_1e_filter_alpha(struct OneEuroFilter *filter, float cutoff)
Compute Alpha for a given One Euro Filter and a given cutoff frequency.
bool first_time
first time flag
float rate
data update rate (in Hz)
static float compute_1e_filter_lp(struct OneEuroLPFilter *filter, float x, float alpha)
Filter a float using the given low-pass filter and the given alpha value.
float dcutoff
derivative cutoff freq (in Hz)
uint32_t last_time
last update time in ms
float mincutoff
min cutoff freq (in Hz)
static float update_1e_filter_at_time(struct OneEuroFilter *filter, float x, uint32_t timestamp)
Filter a float using the given One Euro Filter and the given timestamp.
static void reset_1e_filter(struct OneEuroFilter *filter)
Reset filter (gains and parameters unchanged)
static void init_1e_filter(struct OneEuroFilter *filter, float rate, float mincutoff, float beta, float dcutoff)
Initialize a 1 Euro Filter instance.
static float update_1e_filter(struct OneEuroFilter *filter, float x)
Filter a float using the given One Euro Filter.
struct OneEuroLPFilter xfilt
low pass filter
configuration parameters.
struct OneEuroLPFilter dxfilt
low pass filter for derivative