Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ahrs_int_cmpl_quat.h File Reference

Quaternion complementary filter (fixed-point). More...

#include "subsystems/ahrs.h"
#include "std.h"
#include "math/pprz_algebra_int.h"
+ Include dependency graph for ahrs_int_cmpl_quat.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  AhrsIntCmplQuat
 Ahrs implementation specifc values. More...
 

Functions

void ahrs_update_heading (int32_t heading)
 Update yaw based on a heading measurement. More...
 
void ahrs_realign_heading (int32_t heading)
 Hard reset yaw to a heading. More...
 
void ahrs_set_accel_gains (void)
 update pre-computed inv_kp and inv_ki gains from acc_omega and acc_zeta More...
 
static void ahrs_int_cmpl_quat_SetAccelOmega (float omega)
 
static void ahrs_int_cmpl_quat_SetAccelZeta (float zeta)
 
void ahrs_set_mag_gains (void)
 update pre-computed kp and ki gains from mag_omega and mag_zeta More...
 
static void ahrs_int_cmpl_quat_SetMagOmega (float omega)
 
static void ahrs_int_cmpl_quat_SetMagZeta (float zeta)
 

Variables

struct AhrsIntCmplQuat ahrs_impl
 

Detailed Description

Quaternion complementary filter (fixed-point).

Estimate the attitude, heading and gyro bias.

Definition in file ahrs_int_cmpl_quat.h.

Function Documentation

static void ahrs_int_cmpl_quat_SetAccelOmega ( float  omega)
inlinestatic

Definition at line 111 of file ahrs_int_cmpl_quat.h.

References AhrsIntCmplQuat::accel_omega, ahrs_impl, and ahrs_set_accel_gains().

+ Here is the call graph for this function:

static void ahrs_int_cmpl_quat_SetAccelZeta ( float  zeta)
inlinestatic

Definition at line 116 of file ahrs_int_cmpl_quat.h.

References AhrsIntCmplQuat::accel_zeta, ahrs_impl, and ahrs_set_accel_gains().

+ Here is the call graph for this function:

static void ahrs_int_cmpl_quat_SetMagOmega ( float  omega)
inlinestatic

Definition at line 124 of file ahrs_int_cmpl_quat.h.

References ahrs_impl, ahrs_set_mag_gains(), and AhrsIntCmplQuat::mag_omega.

+ Here is the call graph for this function:

static void ahrs_int_cmpl_quat_SetMagZeta ( float  zeta)
inlinestatic

Definition at line 129 of file ahrs_int_cmpl_quat.h.

References ahrs_impl, ahrs_set_mag_gains(), and AhrsIntCmplQuat::mag_zeta.

+ Here is the call graph for this function:

void ahrs_realign_heading ( int32_t  heading)

Hard reset yaw to a heading.

Doesn't affect the bias. Sets ahrs_impl.heading_aligned to TRUE.

Parameters
headingHeading in body frame, radians (CW/north) with INT32_ANGLE_FRAC

Definition at line 656 of file ahrs_int_cmpl_quat.c.

References ahrs_impl, Imu::body_to_imu, AhrsIntCmplQuat::heading_aligned, imu, INT32_QUAT_COMP, INT32_QUAT_COMP_NORM_SHORTEST, INT32_QUAT_INV_COMP_NORM_SHORTEST, INT32_QUAT_NORMALIZE, AhrsIntCmplQuat::ltp_to_imu_quat, orientationGetQuat_i(), PPRZ_ITRIG_COS, PPRZ_ITRIG_SIN, Int32Quat::qi, QUAT_COPY, Int32Quat::qx, Int32Quat::qy, Int32Quat::qz, stateGetNedToBodyQuat_i(), stateSetNedToBodyQuat_i(), and TRUE.

Referenced by ahrs_update_gps().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ahrs_set_accel_gains ( void  )

update pre-computed inv_kp and inv_ki gains from acc_omega and acc_zeta

Definition at line 292 of file ahrs_int_cmpl_quat.c.

References AhrsIntCmplQuat::accel_inv_ki, AhrsIntCmplQuat::accel_inv_kp, AhrsIntCmplQuat::accel_omega, AhrsIntCmplQuat::accel_zeta, AHRS_CORRECT_FREQUENCY, ahrs_impl, and AHRS_PROPAGATE_FREQUENCY.

Referenced by ahrs_init(), ahrs_int_cmpl_quat_SetAccelOmega(), and ahrs_int_cmpl_quat_SetAccelZeta().

+ Here is the caller graph for this function:

void ahrs_set_mag_gains ( void  )

update pre-computed kp and ki gains from mag_omega and mag_zeta

Definition at line 444 of file ahrs_int_cmpl_quat.c.

References ahrs_impl, AHRS_MAG_CORRECT_FREQUENCY, AHRS_PROPAGATE_FREQUENCY, AhrsIntCmplQuat::mag_ki, AhrsIntCmplQuat::mag_kp, AhrsIntCmplQuat::mag_omega, and AhrsIntCmplQuat::mag_zeta.

Referenced by ahrs_init(), ahrs_int_cmpl_quat_SetMagOmega(), and ahrs_int_cmpl_quat_SetMagZeta().

+ Here is the caller graph for this function:

void ahrs_update_heading ( int32_t  heading)

Variable Documentation