Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
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  AhrsIntCmpl
 

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...
 

Variables

struct AhrsIntCmpl 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

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 427 of file ahrs_int_cmpl_quat.c.

References ahrs_impl, Imu::body_to_imu_quat, AhrsIntCmpl::heading_aligned, imu, INT32_QUAT_COMP, INT32_QUAT_COMP_NORM_SHORTEST, INT32_QUAT_INV_COMP_NORM_SHORTEST, INT32_QUAT_NORMALIZE, AhrsIntCmpl::ltp_to_imu_quat, 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_update_heading ( int32_t  heading)

Update yaw based on a heading measurement.

e.g. from GPS course

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

Definition at line 371 of file ahrs_int_cmpl_quat.c.

References ahrs_impl, AhrsIntCmpl::gyro_bias, AhrsIntCmpl::high_rez_bias, INT32_ANGLE_FRAC, INT32_ANGLE_NORMALIZE, INT32_RMAT_OF_QUAT, INT32_RMAT_VMULT, INT_RATES_RSHIFT, AhrsIntCmpl::ltp_to_imu_quat, Int32Rates::p, Int64Rates::p, PPRZ_ITRIG_COS, PPRZ_ITRIG_SIN, Int32Rates::q, Int64Rates::q, Int32Rates::r, Int64Rates::r, AhrsIntCmpl::rate_correction, RMAT_ELMT, stateGetNedToBodyRMat_i(), TRIG_BFP_OF_REAL, Int32Vect2::x, Int32Vect3::x, Int32Vect2::y, Int32Vect3::y, and Int32Vect3::z.

Referenced by ahrs_update_gps().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation