Monado OpenXR Runtime
|
The "One Euro Filter" for filtering interaction data. More...
#include "math/m_mathinclude.h"
#include "math/m_vec2.h"
#include "math/m_vec3.h"
#include "util/u_time.h"
#include "util/u_misc.h"
#include "m_filter_one_euro.h"
Functions | |
static double | calc_smoothing_alpha (double Fc, double dt) |
static double | exp_smooth (double alpha, float y, float prev_y) |
static struct xrt_vec2 | exp_smooth_vec2 (double alpha, struct xrt_vec2 y, struct xrt_vec2 prev_y) |
static struct xrt_vec3 | exp_smooth_vec3 (double alpha, struct xrt_vec3 y, struct xrt_vec3 prev_y) |
static struct xrt_quat | exp_smooth_quat (double alpha, struct xrt_quat y, struct xrt_quat prev_y) |
static void | filter_one_euro_init (struct m_filter_one_euro_base *f, double fc_min, double fc_min_d, double beta) |
static bool | filter_one_euro_handle_first_sample (struct m_filter_one_euro_base *f, uint64_t ts, bool commit) |
Is this the first sample? If so, please set up the common things. More... | |
static double | filter_one_euro_compute_alpha_d (struct m_filter_one_euro_base *f, double *outDt, uint64_t ts, bool commit) |
Computes and outputs dt, updates the timestamp in the main structure if commit is true, and computes and returns alpha_d. More... | |
static double | filter_one_euro_compute_alpha (const struct m_filter_one_euro_base *f, double dt, double smoothed_derivative_magnitude) |
Computes and returns alpha. More... | |
void | m_filter_euro_f32_init (struct m_filter_euro_f32 *f, double fc_min, double fc_min_d, double beta) |
void | m_filter_euro_f32_run (struct m_filter_euro_f32 *f, uint64_t ts, const float *in_y, float *out_y) |
void | m_filter_euro_vec2_init (struct m_filter_euro_vec2 *f, double fc_min, double fc_min_d, double beta) |
void | m_filter_euro_vec2_run (struct m_filter_euro_vec2 *f, uint64_t ts, const struct xrt_vec2 *in_y, struct xrt_vec2 *out_y) |
void | m_filter_euro_vec2_run_no_commit (struct m_filter_euro_vec2 *f, uint64_t ts, const struct xrt_vec2 *in_y, struct xrt_vec2 *out_y) |
void | m_filter_euro_vec3_init (struct m_filter_euro_vec3 *f, double fc_min, double fc_min_d, double beta) |
void | m_filter_euro_vec3_run (struct m_filter_euro_vec3 *f, uint64_t ts, const struct xrt_vec3 *in_y, struct xrt_vec3 *out_y) |
void | m_filter_euro_quat_init (struct m_filter_euro_quat *f, double fc_min, double fc_min_d, double beta) |
void | m_filter_euro_quat_run (struct m_filter_euro_quat *f, uint64_t ts, const struct xrt_quat *in_y, struct xrt_quat *out_y) |
The "One Euro Filter" for filtering interaction data.
Based in part on https://github.com/thaytan/OpenHMD/blob/rift-kalman-filter/src/exponential-filter.c
|
static |
Computes and returns alpha.
[in] | f | filter base structure |
dt | Time change in seconds | |
smoothed_derivative_magnitude | the magnitude of the smoothed derivative |
References m_filter_one_euro_base::beta, and m_filter_one_euro_base::fc_min.
|
static |
Computes and outputs dt, updates the timestamp in the main structure if commit
is true, and computes and returns alpha_d.
[in,out] | f | filter base structure |
[out] | outDt | pointer where we should put dt (time since last sample) after computing it. |
ts | data timestamp | |
commit | true to commit changes to the filter state |
References m_filter_one_euro_base::prev_ts, and U_TIME_1S_IN_NS.
Referenced by m_filter_euro_f32::m_filter_euro_f32_run(), m_filter_euro_quat::m_filter_euro_quat_run(), m_filter_euro_vec2::m_filter_euro_vec2_run(), m_filter_euro_vec2::m_filter_euro_vec2_run_no_commit(), and m_filter_euro_vec3::m_filter_euro_vec3_run().
|
static |
Is this the first sample? If so, please set up the common things.
References m_filter_one_euro_base::have_prev_y, and m_filter_one_euro_base::prev_ts.
Referenced by m_filter_euro_f32::m_filter_euro_f32_run(), m_filter_euro_quat::m_filter_euro_quat_run(), m_filter_euro_vec2::m_filter_euro_vec2_run(), m_filter_euro_vec2::m_filter_euro_vec2_run_no_commit(), and m_filter_euro_vec3::m_filter_euro_vec3_run().
void m_filter_euro_quat_init | ( | struct m_filter_euro_quat * | f, |
double | fc_min, | ||
double | fc_min_d, | ||
double | beta | ||
) |