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
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2013 The Paparazzi Team
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
31 #ifndef AHRS_INT_CMPL_QUAT_H
32 #define AHRS_INT_CMPL_QUAT_H
33 
34 #include "subsystems/ahrs.h"
35 #include "std.h"
36 #include "math/pprz_algebra_int.h"
37 
48  struct Int32Vect3 mag_h;
49 
53  float weight;
54  float accel_inv_kp;
55  float accel_inv_ki;
56  float mag_kp;
57  float mag_ki;
58 
59  /* parameters/options that can be changed */
62 
67 
72  float accel_omega;
73 
78  float accel_zeta;
79 
83  float mag_omega;
84 
88  float mag_zeta;
89 };
90 
91 extern struct AhrsIntCmplQuat ahrs_impl;
92 
93 
99 
106 
107 
109 extern void ahrs_set_accel_gains(void);
110 
111 static inline void ahrs_int_cmpl_quat_SetAccelOmega(float omega) {
112  ahrs_impl.accel_omega = omega;
114 }
115 
116 static inline void ahrs_int_cmpl_quat_SetAccelZeta(float zeta) {
117  ahrs_impl.accel_zeta = zeta;
119 }
120 
122 extern void ahrs_set_mag_gains(void);
123 
124 static inline void ahrs_int_cmpl_quat_SetMagOmega(float omega) {
125  ahrs_impl.mag_omega = omega;
127 }
128 
129 static inline void ahrs_int_cmpl_quat_SetMagZeta(float zeta) {
130  ahrs_impl.mag_zeta = zeta;
132 }
133 
134 
135 #ifdef AHRS_UPDATE_FW_ESTIMATOR
136 extern float ins_roll_neutral;
137 extern float ins_pitch_neutral;
138 #endif
139 
140 #endif /* AHRS_INT_CMPL_QUAT_H */
void ahrs_update_heading(int32_t heading)
Update yaw based on a heading measurement.
Attitude and Heading Reference System interface.
struct Int32Rates imu_rate
Rotation quaternion.
void ahrs_set_accel_gains(void)
update pre-computed inv_kp and inv_ki gains from acc_omega and acc_zeta
static void ahrs_int_cmpl_quat_SetAccelOmega(float omega)
struct Int64Rates high_rez_bias
void ahrs_set_mag_gains(void)
update pre-computed kp and ki gains from mag_omega and mag_zeta
void ahrs_realign_heading(int32_t heading)
Hard reset yaw to a heading.
float accel_zeta
filter damping for correcting the gyro-bias from accels.
uint8_t gravity_heuristic_factor
sets how strongly the gravity heuristic reduces accel correction.
float heading
Definition: ahrs_infrared.c:40
Ahrs implementation specifc values.
float accel_omega
filter cut-off frequency for correcting the attitude from accels.
struct Int32Rates rate_correction
angular rates
float ins_pitch_neutral
Definition: ins_arduimu.c:15
signed long int32_t
Definition: types.h:19
struct Int32Rates gyro_bias
unsigned char uint8_t
Definition: types.h:14
static void ahrs_int_cmpl_quat_SetAccelZeta(float zeta)
float mag_omega
filter cut-off frequency for correcting the attitude (heading) from magnetometer. ...
static void ahrs_int_cmpl_quat_SetMagZeta(float zeta)
bool_t correct_gravity
enable gravity vector correction by removing centrifugal acceleration
float ins_roll_neutral
Definition: ins_arduimu.c:14
struct Int32Vect3 mag_h
struct Int64Quat high_rez_quat
struct AhrsIntCmplQuat ahrs_impl
Definition: ahrs_ardrone2.c:45
struct Int32Quat ltp_to_imu_quat
float mag_zeta
filter damping for correcting the gyro bias from magnetometer.
Paparazzi fixed point algebra.
static void ahrs_int_cmpl_quat_SetMagOmega(float omega)