Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Implementation of the 1 euro filter. More...
#include "std.h"
#include <math.h>
Go to the source code of this file.
Data Structures | |
struct | OneEuroLPFilter |
simple low pass filter. More... | |
struct | OneEuroFilter |
configuration parameters. More... | |
Functions | |
static void | init_1e_filter (struct OneEuroFilter *filter, float rate, float mincutoff, float beta, float dcutoff) |
Initialize a 1 Euro Filter instance. More... | |
static void | reset_1e_filter (struct OneEuroFilter *filter) |
Reset filter (gains and parameters unchanged) More... | |
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. More... | |
static float | compute_1e_filter_alpha (struct OneEuroFilter *filter, float cutoff) |
Compute Alpha for a given One Euro Filter and a given cutoff frequency. More... | |
static float | update_1e_filter (struct OneEuroFilter *filter, float x) |
Filter a float using the given One Euro Filter. More... | |
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. More... | |
Implementation of the 1 euro filter.
See: http://cristal.univ-lille.fr/~casiez/1euro/
Ref: Casiez, G., Roussel, N. and Vogel, D. (2012). 1€ Filter: A Simple Speed-based Low-pass Filter for Noisy Input in Interactive Systems. Proceedings of the ACM Conference on Human Factors in Computing Systems (CHI '12). Austin, Texas (May 5-12, 2012). New York: ACM Press, pp. 2527-2530.
Definition in file 1e_filter.h.
struct OneEuroLPFilter |
simple low pass filter.
TODO use existing implementation ?
Definition at line 42 of file 1e_filter.h.
Data Fields | ||
---|---|---|
bool | first_time | |
float | hatx | |
float | hatxprev |
struct OneEuroFilter |
configuration parameters.
Definition at line 51 of file 1e_filter.h.
Data Fields | ||
---|---|---|
float | beta | cutoff slope |
float | dcutoff | derivative cutoff freq (in Hz) |
struct OneEuroLPFilter | dxfilt | low pass filter for derivative |
bool | first_time | first time flag |
uint32_t | last_time | last update time in ms |
float | mincutoff | min cutoff freq (in Hz) |
float | rate | data update rate (in Hz) |
struct OneEuroLPFilter | xfilt | low pass filter |
|
inlinestatic |
Compute Alpha for a given One Euro Filter and a given cutoff frequency.
Definition at line 113 of file 1e_filter.h.
References OneEuroFilter::rate.
Referenced by update_1e_filter().
|
inlinestatic |
Filter a float using the given low-pass filter and the given alpha value.
Definition at line 99 of file 1e_filter.h.
References alpha, OneEuroLPFilter::first_time, OneEuroLPFilter::hatx, and OneEuroLPFilter::hatxprev.
Referenced by update_1e_filter().
|
inlinestatic |
Initialize a 1 Euro Filter instance.
Definition at line 65 of file 1e_filter.h.
References OneEuroFilter::beta, OneEuroFilter::dcutoff, OneEuroFilter::dxfilt, OneEuroLPFilter::first_time, OneEuroFilter::first_time, OneEuroLPFilter::hatx, OneEuroLPFilter::hatxprev, OneEuroFilter::last_time, OneEuroFilter::mincutoff, OneEuroFilter::rate, and OneEuroFilter::xfilt.
Referenced by filter_1euro_imu_init().
|
inlinestatic |
Reset filter (gains and parameters unchanged)
Definition at line 84 of file 1e_filter.h.
References OneEuroFilter::dxfilt, OneEuroLPFilter::first_time, OneEuroFilter::first_time, OneEuroLPFilter::hatx, OneEuroLPFilter::hatxprev, OneEuroFilter::last_time, and OneEuroFilter::xfilt.
Referenced by filter_1euro_imu_reset().
|
inlinestatic |
Filter a float using the given One Euro Filter.
Definition at line 124 of file 1e_filter.h.
References OneEuroFilter::beta, compute_1e_filter_alpha(), compute_1e_filter_lp(), OneEuroFilter::dcutoff, OneEuroFilter::dxfilt, OneEuroFilter::first_time, OneEuroLPFilter::hatxprev, OneEuroFilter::mincutoff, OneEuroFilter::rate, and OneEuroFilter::xfilt.
Referenced by accel_cb(), gyro_cb(), and update_1e_filter_at_time().
|
inlinestatic |
Filter a float using the given One Euro Filter and the given timestamp.
Frequency will be automatically recomputed.
Definition at line 142 of file 1e_filter.h.
References OneEuroFilter::last_time, OneEuroFilter::rate, and update_1e_filter().
Referenced by accel_cb(), and gyro_cb().