Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
quaternion_filter.h File Reference

Quaternion second order filter. More...

#include "std.h"
#include "math/pprz_algebra_float.h"
+ Include dependency graph for quaternion_filter.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  QuatSecondOrderLowPass
 Quaternion second order filter model (float) More...
 

Typedefs

typedef struct QuatSecondOrderLowPass QuatButterworthLowPass
 Second order Butterworth low pass filter.
 

Functions

static void init_quat_second_order_low_pass (struct QuatSecondOrderLowPass *filter, const float omega, const float damp, const float sample_time, const struct FloatQuat q0)
 Init second order quaternion low pass filter.
 
static void reset_quat_second_order_low_pass (struct QuatSecondOrderLowPass *filter, const struct FloatQuat q0)
 Reset the second order quaternion low-pass filter to a specific value.
 
static struct FloatQuat update_quat_second_order_low_pass (struct QuatSecondOrderLowPass *filter, const struct FloatQuat q)
 Update second order quaterion low pass filter state with a new value.
 
static struct FloatQuat get_quat_second_order_low_pass (const struct QuatSecondOrderLowPass *filter)
 Get current value of the second order quaterion low pass filter.
 
static void init_quat_butterworth_low_pass (QuatButterworthLowPass *filter, const float omega, const float sample_time, const struct FloatQuat q0)
 Init a second order quaternion Butterworth filter.
 
static struct FloatQuat update_quat_butterworth_low_pass (QuatButterworthLowPass *filter, const struct FloatQuat quat)
 Update second order quaternion Butterworth low pass filter state with a new value.
 
static void reset_quat_butterworth_low_pass (QuatButterworthLowPass *filter, const struct FloatQuat quat)
 Reset a quaternion Butterworth low-pass filter to a specific value.
 
static struct FloatQuat get_quat_butterworth_low_pass (const QuatButterworthLowPass *filter)
 Get current value of the second order quaternion Butterworth low pass filter.
 

Detailed Description

Quaternion second order filter.

Definition in file quaternion_filter.h.


Data Structure Documentation

◆ QuatSecondOrderLowPass

struct QuatSecondOrderLowPass

Quaternion second order filter model (float)

Definition at line 34 of file quaternion_filter.h.

+ Collaboration diagram for QuatSecondOrderLowPass:
Data Fields
struct FloatRates accel
float dt
struct FloatQuat quat
struct FloatRates rate
float two_omega2
float two_zeta_omega

Typedef Documentation

◆ QuatButterworthLowPass

Second order Butterworth low pass filter.

Definition at line 132 of file quaternion_filter.h.

Function Documentation

◆ get_quat_butterworth_low_pass()

static struct FloatQuat get_quat_butterworth_low_pass ( const QuatButterworthLowPass filter)
inlinestatic

Get current value of the second order quaternion Butterworth low pass filter.

Parameters
filtersecond order quaternion Butterworth low pass filter structure
Returns
current orientation of the filter

Definition at line 184 of file quaternion_filter.h.

References get_quat_second_order_low_pass().

+ Here is the call graph for this function:

◆ get_quat_second_order_low_pass()

static struct FloatQuat get_quat_second_order_low_pass ( const struct QuatSecondOrderLowPass filter)
inlinestatic

Get current value of the second order quaterion low pass filter.

Parameters
filterfilter structure
Returns
current orientation of the filter

Definition at line 123 of file quaternion_filter.h.

Referenced by get_quat_butterworth_low_pass().

+ Here is the caller graph for this function:

◆ init_quat_butterworth_low_pass()

static void init_quat_butterworth_low_pass ( QuatButterworthLowPass filter,
const float  omega,
const float  sample_time,
const struct FloatQuat  q0 
)
inlinestatic

Init a second order quaternion Butterworth filter.

based on the generic second order filter with zeta = 0.7071 = 1/sqrt(2)

Parameters
filtersecond order quaternion Butterworth low pass filter structure
omegacutoff frequency of the second order low pass filter
sample_timesampling period of the signal
q0initial orientation of the filter

Definition at line 144 of file quaternion_filter.h.

References foo, and init_quat_second_order_low_pass().

Referenced by guidance_indi_enter(), and guidance_indi_init().

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

◆ init_quat_second_order_low_pass()

static void init_quat_second_order_low_pass ( struct QuatSecondOrderLowPass filter,
const float  omega,
const float  damp,
const float  sample_time,
const struct FloatQuat  q0 
)
inlinestatic

Init second order quaternion low pass filter.

Parameters
filtersecond order low pass filter structure
omegacutoff frequency of the second order low pass filter
dampdamping coefficient of the second order low pass filter
sample_timesampling period of the signal
q0initial orientation of the filter

Definition at line 52 of file quaternion_filter.h.

References QuatSecondOrderLowPass::accel, QuatSecondOrderLowPass::dt, FLOAT_RATES_ZERO, foo, QuatSecondOrderLowPass::quat, QuatSecondOrderLowPass::rate, QuatSecondOrderLowPass::two_omega2, and QuatSecondOrderLowPass::two_zeta_omega.

Referenced by init_quat_butterworth_low_pass().

+ Here is the caller graph for this function:

◆ reset_quat_butterworth_low_pass()

static void reset_quat_butterworth_low_pass ( QuatButterworthLowPass filter,
const struct FloatQuat  quat 
)
inlinestatic

Reset a quaternion Butterworth low-pass filter to a specific value.

Parameters
[out]filterQuatButterworth2LowPass filter instance to reset.
[in]quatValue to reset the filter to.

Definition at line 172 of file quaternion_filter.h.

References reset_quat_second_order_low_pass().

+ Here is the call graph for this function:

◆ reset_quat_second_order_low_pass()

static void reset_quat_second_order_low_pass ( struct QuatSecondOrderLowPass filter,
const struct FloatQuat  q0 
)
inlinestatic

Reset the second order quaternion low-pass filter to a specific value.

Parameters
filterfilter structure
q0quaternion to reset the filter to

Definition at line 72 of file quaternion_filter.h.

References QuatSecondOrderLowPass::accel, FLOAT_RATES_ZERO, foo, QuatSecondOrderLowPass::quat, and QuatSecondOrderLowPass::rate.

Referenced by reset_quat_butterworth_low_pass().

+ Here is the caller graph for this function:

◆ update_quat_butterworth_low_pass()

static struct FloatQuat update_quat_butterworth_low_pass ( QuatButterworthLowPass filter,
const struct FloatQuat  quat 
)
inlinestatic

Update second order quaternion Butterworth low pass filter state with a new value.

Parameters
filtersecond order quaternion Butterworth low pass filter structure
qnew input orientation of the filter
Returns
new filtered quaternion

Definition at line 159 of file quaternion_filter.h.

References update_quat_second_order_low_pass().

Referenced by guidance_indi_propagate_filters(), and guidance_indi_propagate_filters().

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

◆ update_quat_second_order_low_pass()

static struct FloatQuat update_quat_second_order_low_pass ( struct QuatSecondOrderLowPass filter,
const struct FloatQuat  q 
)
inlinestatic

Update second order quaterion low pass filter state with a new value.

Parameters
filterfilter structure
qquaternion input value of the filter
Returns
new filtered quaternion

Definition at line 87 of file quaternion_filter.h.

References float_quat_derivative(), float_quat_inv_comp(), float_quat_normalize(), float_quat_wrap_shortest(), foo, QUAT_ADD, QUAT_SMUL, FloatQuat::qx, FloatQuat::qy, FloatQuat::qz, RATES_ADD, and RATES_SMUL.

Referenced by update_quat_butterworth_low_pass().

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