Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ahrs_int_cmpl_quat.c File Reference
+ Include dependency graph for ahrs_int_cmpl_quat.c:

Go to the source code of this file.

Macros

#define AHRS_PROPAGATE_FREQUENCY   PERIODIC_FREQUENCY
 

Functions

static void ahrs_update_mag_full (void)
 
static void ahrs_update_mag_2d (void)
 
static void compute_imu_euler_and_rmat_from_quat (void)
 
static void compute_body_euler_and_rmat_from_quat (void)
 
static void compute_imu_orientation (void)
 
static void compute_body_orientation (void)
 
void ahrs_init (void)
 AHRS initialization. More...
 
void ahrs_align (void)
 Aligns the AHRS. More...
 
void ahrs_propagate (void)
 Propagation. More...
 
void ahrs_update_accel (void)
 Update AHRS state with accerleration measurements. More...
 
void ahrs_update_mag (void)
 Update AHRS state with magnetometer measurements. More...
 
void ahrs_update_gps (void)
 
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...
 
 __attribute__ ((always_inline))
 

Variables

struct AhrsIntCmpl ahrs_impl
 

Macro Definition Documentation

#define AHRS_PROPAGATE_FREQUENCY   PERIODIC_FREQUENCY

Definition at line 50 of file ahrs_int_cmpl_quat.c.

Referenced by ahrs_propagate().

Function Documentation

__attribute__ ( (always_inline)  )
void ahrs_align ( void  )

Aligns the AHRS.

Called after ahrs_aligner has run to set initial attitude and biases. Must set the ahrs status to AHRS_RUNNING. Needs to be implemented by each AHRS algorithm.

Definition at line 96 of file ahrs_int_cmpl_quat.c.

References ahrs, ahrs_aligner, ahrs_impl, ahrs_int_get_quat_from_accel(), ahrs_int_get_quat_from_accel_mag(), AHRS_RUNNING, compute_body_orientation(), compute_imu_euler_and_rmat_from_quat(), FALSE, AhrsIntCmpl::gyro_bias, AhrsIntCmpl::heading_aligned, AhrsIntCmpl::high_rez_bias, INT_RATES_LSHIFT, AhrsAligner::lp_accel, AhrsAligner::lp_gyro, AhrsAligner::lp_mag, Ahrs::ltp_to_imu_quat, RATES_COPY, Ahrs::status, and TRUE.

+ Here is the call graph for this function:

void ahrs_propagate ( void  )

Propagation.

Usually integrates the gyro rates to angles. Reads the global imu data struct. Needs to be implemented by each AHRS algorithm.

Definition at line 128 of file ahrs_int_cmpl_quat.c.

References ahrs, ahrs_impl, AHRS_PROPAGATE_FREQUENCY, compute_body_orientation(), compute_imu_euler_and_rmat_from_quat(), AhrsIntCmpl::gyro_bias, Imu::gyro_prev, AhrsIntCmpl::high_rez_quat, imu, Ahrs::imu_rate, INT32_QUAT_INTEGRATE_FI, INT32_QUAT_NORMALIZE, INT_RATES_ZERO, Ahrs::ltp_to_imu_quat, AhrsIntCmpl::rate_correction, RATES_ADD, RATES_COPY, RATES_DIFF, RATES_SDIV, and RATES_SMUL.

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

References ahrs, ahrs_impl, compute_body_euler_and_rmat_from_quat(), compute_imu_orientation(), AhrsIntCmpl::heading_aligned, INT32_QUAT_COMP_NORM_SHORTEST, INT32_QUAT_INV_COMP_NORM_SHORTEST, INT32_QUAT_NORMALIZE, Ahrs::ltp_to_body_quat, PPRZ_ITRIG_COS, PPRZ_ITRIG_SIN, Int32Quat::qi, QUAT_COPY, Int32Quat::qx, Int32Quat::qy, Int32Quat::qz, 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)
void ahrs_update_mag ( void  )

Update AHRS state with magnetometer measurements.

Reads the global imu data struct. Needs to be implemented by each AHRS algorithm.

Definition at line 236 of file ahrs_int_cmpl_quat.c.

References ahrs_update_mag_2d(), and ahrs_update_mag_full().

+ Here is the call graph for this function:

static void compute_body_euler_and_rmat_from_quat ( void  )
inlinestatic

Referenced by ahrs_realign_heading().

+ Here is the caller graph for this function:

static void compute_body_orientation ( void  )
inlinestatic

Referenced by ahrs_align(), and ahrs_propagate().

+ Here is the caller graph for this function:

static void compute_imu_euler_and_rmat_from_quat ( void  )
inlinestatic

Referenced by ahrs_align(), and ahrs_propagate().

+ Here is the caller graph for this function:

static void compute_imu_orientation ( void  )
inlinestatic

Referenced by ahrs_realign_heading().

+ Here is the caller graph for this function:

Variable Documentation