Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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

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]
struct MedianFilter3Int

Definition at line 93 of file median_filter.h.

+ Collaboration diagram for MedianFilter3Int:
Data Fields
struct MedianFilterInt mf[3]
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]
struct MedianFilter3Float

Definition at line 201 of file median_filter.h.

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

Macro Definition Documentation

#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])); \
}
static float get_median_filter_f(struct MedianFilterFloat *filter)

Definition at line 238 of file median_filter.h.

#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])); \
}
static int32_t get_median_filter_i(struct MedianFilterInt *filter)
Definition: median_filter.h:58

Definition at line 130 of file median_filter.h.

#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])); \
}
static float get_median_filter_f(struct MedianFilterFloat *filter)
static float p[2][2]

Definition at line 244 of file median_filter.h.

#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])); \
}
static int32_t get_median_filter_i(struct MedianFilterInt *filter)
Definition: median_filter.h:58
static float p[2][2]

Definition at line 136 of file median_filter.h.

#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])); \
}
static float get_median_filter_f(struct MedianFilterFloat *filter)

Definition at line 232 of file median_filter.h.

#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])); \
}
static int32_t get_median_filter_i(struct MedianFilterInt *filter)
Definition: median_filter.h:58

Definition at line 124 of file median_filter.h.

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

Definition at line 211 of file median_filter.h.

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

Definition at line 103 of file median_filter.h.

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

Definition at line 212 of file median_filter.h.

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

Definition at line 104 of file median_filter.h.

Referenced by imu_navgo_init().

#define InitMedianFilterVect3Float (   _f,
  _n 
)
Value:
{ \
for (int i = 0; i < 3; i++) { \
init_median_filter_f(&(_f.mf[i]), _n); \
} \
}
static void init_median_filter_f(struct MedianFilterFloat *filter, uint8_t size)

Definition at line 205 of file median_filter.h.

Referenced by calc_fast9_lukas_kanade(), and stereocam_init().

#define InitMedianFilterVect3Int (   _f,
  _n 
)
Value:
{ \
for (int i = 0; i < 3; i++) { \
init_median_filter_i(&(_f.mf[i]), _n); \
} \
}
static void init_median_filter_i(struct MedianFilterInt *filter, uint8_t size)
Definition: median_filter.h:39

Definition at line 97 of file median_filter.h.

Referenced by imu_krooz_init(), and imu_navgo_init().

#define MAX_MEDIAN_DATASIZE   13

Definition at line 27 of file median_filter.h.

Referenced by init_median_filter_f(), and init_median_filter_i().

#define MEDIAN_DEFAULT_SIZE   5
#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); \
}
static float update_median_filter_f(struct MedianFilterFloat *filter, float new_data)

Definition at line 220 of file median_filter.h.

#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); \
}
static int32_t update_median_filter_i(struct MedianFilterInt *filter, int32_t new_data)
Definition: median_filter.h:68

Definition at line 112 of file median_filter.h.

#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); \
}
static float update_median_filter_f(struct MedianFilterFloat *filter, float new_data)
static float p[2][2]

Definition at line 226 of file median_filter.h.

#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); \
}
static int32_t update_median_filter_i(struct MedianFilterInt *filter, int32_t new_data)
Definition: median_filter.h:68
static float p[2][2]

Definition at line 118 of file median_filter.h.

Referenced by imu_navgo_event().

#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); \
}
static float update_median_filter_f(struct MedianFilterFloat *filter, float new_data)

Definition at line 214 of file median_filter.h.

Referenced by calc_edgeflow_tot(), calc_fast9_lukas_kanade(), and stereocam_parse_msg().

#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); \
}
static int32_t update_median_filter_i(struct MedianFilterInt *filter, int32_t new_data)
Definition: median_filter.h:68

Definition at line 106 of file median_filter.h.

Referenced by imu_krooz_event(), imu_krooz_periodic(), and imu_navgo_event().

Function Documentation

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:

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:

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

Definition at line 148 of file median_filter.h.

References MedianFilterFloat::data, MedianFilterFloat::dataIndex, MAX_MEDIAN_DATASIZE, MedianFilterFloat::size, and MedianFilterFloat::sortData.

Referenced by baro_init(), and sonar_bebop_init().

+ Here is the caller graph for this function:

static void init_median_filter_i ( struct MedianFilterInt filter,
uint8_t  size 
)
inlinestatic
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(), and sonar_bebop_read().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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: