Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
median_filter.h File Reference
#include "std.h"
#include "math/pprz_algebra_int.h"
+ Include dependency graph for median_filter.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  MedianFilterInt
 
struct  MedianFilter3Int
 
struct  MedianFilterFloat
 
struct  MedianFilter3Float
 

Macros

#define MAX_MEDIAN_DATASIZE   13
 
#define MEDIAN_DEFAULT_SIZE   5
 
#define InitMedianFilterVect3Int(_f, _n)
 
#define InitMedianFilterEulerInt(_f, _n)   InitMedianFilterVect3Int(_f, _n)
 
#define InitMedianFilterRatesInt(_f, _n)   InitMedianFilterVect3Int(_f, _n)
 
#define UpdateMedianFilterVect3Int(_f, _v)
 
#define UpdateMedianFilterEulerInt(_f, _v)
 
#define UpdateMedianFilterRatesInt(_f, _v)
 
#define GetMedianFilterVect3Int(_f, _v)
 
#define GetMedianFilterEulerInt(_f, _v)
 
#define GetMedianFilterRatesInt(_f, _v)
 
#define InitMedianFilterVect3Float(_f, _n)
 
#define InitMedianFilterEulerFloat(_f, _n)   InitMedianFilterVect3Float(_f, _n)
 
#define InitMedianFilterRatesFloat(_f, _n)   InitMedianFilterVect3Float(_f, _n)
 
#define UpdateMedianFilterVect3Float(_f, _v)
 
#define UpdateMedianFilterEulerFloat(_f, _v)
 
#define UpdateMedianFilterRatesFloat(_f, _v)
 
#define GetMedianFilterVect3Float(_f, _v)
 
#define GetMedianFilterEulerFloat(_f, _v)
 
#define GetMedianFilterRatesFloat(_f, _v)
 

Functions

static void init_median_filter_i (struct MedianFilterInt *filter, uint8_t size)
 
static int32_t get_median_filter_i (struct MedianFilterInt *filter)
 
static int32_t update_median_filter_i (struct MedianFilterInt *filter, int32_t new_data)
 
static void init_median_filter_f (struct MedianFilterFloat *filter, uint8_t size)
 
static float get_median_filter_f (struct MedianFilterFloat *filter)
 
static float update_median_filter_f (struct MedianFilterFloat *filter, float new_data)
 

Data Structure Documentation

◆ MedianFilterInt

struct MedianFilterInt

Definition at line 33 of file median_filter.h.

Data Fields
int32_t data[MAX_MEDIAN_DATASIZE]
uint8_t dataIndex
uint8_t size
int32_t sortData[MAX_MEDIAN_DATASIZE]

◆ MedianFilter3Int

struct MedianFilter3Int

Definition at line 93 of file median_filter.h.

+ Collaboration diagram for MedianFilter3Int:
Data Fields
struct MedianFilterInt mf[3]

◆ MedianFilterFloat

struct MedianFilterFloat

Definition at line 142 of file median_filter.h.

Data Fields
float data[MAX_MEDIAN_DATASIZE]
uint8_t dataIndex
uint8_t size
float sortData[MAX_MEDIAN_DATASIZE]

◆ MedianFilter3Float

struct MedianFilter3Float

Definition at line 201 of file median_filter.h.

+ Collaboration diagram for MedianFilter3Float:
Data Fields
struct MedianFilterFloat mf[3]

Macro Definition Documentation

◆ GetMedianFilterEulerFloat

#define GetMedianFilterEulerFloat (   _f,
  _v 
)
Value:
{ \
(_v).phi = get_median_filter_f(&(_f.mf[0])); \
(_v).theta = get_median_filter_f(&(_f.mf[1])); \
(_v).psi = get_median_filter_f(&(_f.mf[2])); \
}

Definition at line 238 of file median_filter.h.

◆ GetMedianFilterEulerInt

#define GetMedianFilterEulerInt (   _f,
  _v 
)
Value:
{ \
(_v).phi = get_median_filter_i(&(_f.mf[0])); \
(_v).theta = get_median_filter_i(&(_f.mf[1])); \
(_v).psi = get_median_filter_i(&(_f.mf[2])); \
}

Definition at line 130 of file median_filter.h.

◆ GetMedianFilterRatesFloat

#define GetMedianFilterRatesFloat (   _f,
  _v 
)
Value:
{ \
(_v).p = get_median_filter_f(&(_f.mf[0])); \
(_v).q = get_median_filter_f(&(_f.mf[1])); \
(_v).r = get_median_filter_f(&(_f.mf[2])); \
}

Definition at line 244 of file median_filter.h.

◆ GetMedianFilterRatesInt

#define GetMedianFilterRatesInt (   _f,
  _v 
)
Value:
{ \
(_v).p = get_median_filter_i(&(_f.mf[0])); \
(_v).q = get_median_filter_i(&(_f.mf[1])); \
(_v).r = get_median_filter_i(&(_f.mf[2])); \
}

Definition at line 136 of file median_filter.h.

◆ GetMedianFilterVect3Float

#define GetMedianFilterVect3Float (   _f,
  _v 
)
Value:
{ \
(_v).x = get_median_filter_f(&(_f.mf[0])); \
(_v).y = get_median_filter_f(&(_f.mf[1])); \
(_v).z = get_median_filter_f(&(_f.mf[2])); \
}

Definition at line 232 of file median_filter.h.

◆ GetMedianFilterVect3Int

#define GetMedianFilterVect3Int (   _f,
  _v 
)
Value:
{ \
(_v).x = get_median_filter_i(&(_f.mf[0])); \
(_v).y = get_median_filter_i(&(_f.mf[1])); \
(_v).z = get_median_filter_i(&(_f.mf[2])); \
}

Definition at line 124 of file median_filter.h.

◆ InitMedianFilterEulerFloat

#define InitMedianFilterEulerFloat (   _f,
  _n 
)    InitMedianFilterVect3Float(_f, _n)

Definition at line 211 of file median_filter.h.

◆ InitMedianFilterEulerInt

#define InitMedianFilterEulerInt (   _f,
  _n 
)    InitMedianFilterVect3Int(_f, _n)

Definition at line 103 of file median_filter.h.

◆ InitMedianFilterRatesFloat

#define InitMedianFilterRatesFloat (   _f,
  _n 
)    InitMedianFilterVect3Float(_f, _n)

Definition at line 212 of file median_filter.h.

◆ InitMedianFilterRatesInt

#define InitMedianFilterRatesInt (   _f,
  _n 
)    InitMedianFilterVect3Int(_f, _n)

Definition at line 104 of file median_filter.h.

◆ InitMedianFilterVect3Float

#define InitMedianFilterVect3Float (   _f,
  _n 
)
Value:
{ \
for (int i = 0; i < 3; i++) { \
init_median_filter_f(&(_f.mf[i]), _n); \
} \
}

Definition at line 205 of file median_filter.h.

◆ InitMedianFilterVect3Int

#define InitMedianFilterVect3Int (   _f,
  _n 
)
Value:
{ \
for (int i = 0; i < 3; i++) { \
init_median_filter_i(&(_f.mf[i]), _n); \
} \
}

Definition at line 97 of file median_filter.h.

◆ MAX_MEDIAN_DATASIZE

#define MAX_MEDIAN_DATASIZE   13

Definition at line 27 of file median_filter.h.

◆ MEDIAN_DEFAULT_SIZE

#define MEDIAN_DEFAULT_SIZE   5

Definition at line 28 of file median_filter.h.

◆ UpdateMedianFilterEulerFloat

#define UpdateMedianFilterEulerFloat (   _f,
  _v 
)
Value:
{ \
(_v).phi = update_median_filter_f(&(_f.mf[0]), (_v).phi); \
(_v).theta = update_median_filter_f(&(_f.mf[1]), (_v).theta); \
(_v).psi = update_median_filter_f(&(_f.mf[2]), (_v).psi); \
}

Definition at line 220 of file median_filter.h.

◆ UpdateMedianFilterEulerInt

#define UpdateMedianFilterEulerInt (   _f,
  _v 
)
Value:
{ \
(_v).phi = update_median_filter_i(&(_f.mf[0]), (_v).phi); \
(_v).theta = update_median_filter_i(&(_f.mf[1]), (_v).theta); \
(_v).psi = update_median_filter_i(&(_f.mf[2]), (_v).psi); \
}

Definition at line 112 of file median_filter.h.

◆ UpdateMedianFilterRatesFloat

#define UpdateMedianFilterRatesFloat (   _f,
  _v 
)
Value:
{ \
(_v).p = update_median_filter_f(&(_f.mf[0]), (_v).p); \
(_v).q = update_median_filter_f(&(_f.mf[1]), (_v).q); \
(_v).r = update_median_filter_f(&(_f.mf[2]), (_v).r); \
}

Definition at line 226 of file median_filter.h.

◆ UpdateMedianFilterRatesInt

#define UpdateMedianFilterRatesInt (   _f,
  _v 
)
Value:
{ \
(_v).p = update_median_filter_i(&(_f.mf[0]), (_v).p); \
(_v).q = update_median_filter_i(&(_f.mf[1]), (_v).q); \
(_v).r = update_median_filter_i(&(_f.mf[2]), (_v).r); \
}

Definition at line 118 of file median_filter.h.

◆ UpdateMedianFilterVect3Float

#define UpdateMedianFilterVect3Float (   _f,
  _v 
)
Value:
{ \
(_v).x = update_median_filter_f(&(_f.mf[0]), (_v).x); \
(_v).y = update_median_filter_f(&(_f.mf[1]), (_v).y); \
(_v).z = update_median_filter_f(&(_f.mf[2]), (_v).z); \
}

Definition at line 214 of file median_filter.h.

◆ UpdateMedianFilterVect3Int

#define UpdateMedianFilterVect3Int (   _f,
  _v 
)
Value:
{ \
(_v).x = update_median_filter_i(&(_f.mf[0]), (_v).x); \
(_v).y = update_median_filter_i(&(_f.mf[1]), (_v).y); \
(_v).z = update_median_filter_i(&(_f.mf[2]), (_v).z); \
}

Definition at line 106 of file median_filter.h.

Function Documentation

◆ get_median_filter_f()

static float get_median_filter_f ( struct MedianFilterFloat filter)
inlinestatic

Definition at line 165 of file median_filter.h.

References MedianFilterFloat::size, and MedianFilterFloat::sortData.

Referenced by update_median_filter_f().

+ Here is the caller graph for this function:

◆ get_median_filter_i()

static int32_t get_median_filter_i ( struct MedianFilterInt filter)
inlinestatic

Definition at line 58 of file median_filter.h.

References MedianFilterInt::size, and MedianFilterInt::sortData.

Referenced by update_median_filter_i().

+ Here is the caller graph for this function:

◆ init_median_filter_f()

static void init_median_filter_f ( struct MedianFilterFloat filter,
uint8_t  size 
)
inlinestatic

◆ init_median_filter_i()

static void init_median_filter_i ( struct MedianFilterInt filter,
uint8_t  size 
)
inlinestatic

◆ update_median_filter_f()

static float update_median_filter_f ( struct MedianFilterFloat filter,
float  new_data 
)
inlinestatic

Definition at line 175 of file median_filter.h.

References MedianFilterFloat::data, MedianFilterFloat::dataIndex, get_median_filter_f(), MedianFilterFloat::size, and MedianFilterFloat::sortData.

Referenced by baro_event(), fill_anchor(), sonar_bebop_read(), and sonar_pwm_read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_median_filter_i()

static int32_t update_median_filter_i ( struct MedianFilterInt filter,
int32_t  new_data 
)
inlinestatic

Definition at line 68 of file median_filter.h.

References MedianFilterInt::data, MedianFilterInt::dataIndex, get_median_filter_i(), MedianFilterInt::size, and MedianFilterInt::sortData.

Referenced by ardrone_baro_event(), lidar_lite_periodic(), lidar_sf11_periodic(), and px4flow_i2c_frame_cb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
get_median_filter_f
static float get_median_filter_f(struct MedianFilterFloat *filter)
Definition: median_filter.h:165
update_median_filter_f
static float update_median_filter_f(struct MedianFilterFloat *filter, float new_data)
Definition: median_filter.h:175
update_median_filter_i
static int32_t update_median_filter_i(struct MedianFilterInt *filter, int32_t new_data)
Definition: median_filter.h:68
get_median_filter_i
static int32_t get_median_filter_i(struct MedianFilterInt *filter)
Definition: median_filter.h:58
p
static float p[2][2]
Definition: ins_alt_float.c:268