Monado OpenXR Runtime
m_filter_euro_vec2 Struct Reference

One Euro filter for a 2D float measurement. More...

#include <math/m_filter_one_euro.h>

Collaboration diagram for m_filter_euro_vec2:

Public Member Functions

void m_filter_euro_vec2_init (struct m_filter_euro_vec2 *f, double fc_min, double fc_min_d, double beta)
 Initialize a 2D filter. More...
 
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)
 Filter a measurement and commit changes to filter state. More...
 
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)
 Filter a measurement without committing changes to filter state. More...
 

Data Fields

struct m_filter_one_euro_base base
 Base/common data. More...
 
struct xrt_vec2 prev_y
 The most recent measurement, after filtering. More...
 
struct xrt_vec2 prev_dy
 The most recent sample derivative, after filtering. More...
 

Detailed Description

One Euro filter for a 2D float measurement.

Member Function Documentation

◆ m_filter_euro_vec2_init()

void m_filter_euro_vec2_init ( struct m_filter_euro_vec2 f,
double  fc_min,
double  fc_min_d,
double  beta 
)

Initialize a 2D filter.

Parameters
fself pointer
fc_minMinimum frequency cutoff for filter
betaBeta value for "responsiveness" of filter
fc_min_dMinimum frequency cutoff for derivative filter

◆ m_filter_euro_vec2_run()

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 
)

Filter a measurement and commit changes to filter state.

Parameters
[in,out]fself pointer
tsmeasurement timestamp
in_yraw measurement
[out]out_yfiltered measurement

References base, filter_one_euro_compute_alpha_d(), filter_one_euro_handle_first_sample(), prev_dy, prev_y, and U_ZERO.

◆ m_filter_euro_vec2_run_no_commit()

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 
)

Filter a measurement without committing changes to filter state.

Similar to m_filter_euro_vec2_run but f is not modified.

Parameters
[in]fself pointer
tsmeasurement timestamp
in_yraw measurement
[out]out_yfiltered measurement

References base, filter_one_euro_compute_alpha_d(), and filter_one_euro_handle_first_sample().

Field Documentation

◆ base

struct m_filter_one_euro_base m_filter_euro_vec2::base

Base/common data.

Referenced by m_filter_euro_vec2_run(), and m_filter_euro_vec2_run_no_commit().

◆ prev_dy

struct xrt_vec2 m_filter_euro_vec2::prev_dy

The most recent sample derivative, after filtering.

Referenced by m_filter_euro_vec2_run().

◆ prev_y

struct xrt_vec2 m_filter_euro_vec2::prev_y

The most recent measurement, after filtering.

Referenced by m_filter_euro_vec2_run().


The documentation for this struct was generated from the following file: