Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
ahrs_madgwick.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Gautier Hattenberger <gautier.hattenberger@enac.fr>
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, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
29 #ifndef AHRS_MADGWICK_H
30 #define AHRS_MADGWICK_H
31 
32 #include "modules/ahrs/ahrs.h"
35 
38 struct AhrsMadgwick {
39  struct FloatQuat quat;
40  struct FloatRates rates;
41  struct FloatRates bias;
42  struct FloatVect3 accel;
43  bool reset;
44  bool is_aligned;
45 };
46 
47 extern struct AhrsMadgwick ahrs_madgwick;
48 
49 extern void ahrs_madgwick_init(void);
50 extern void ahrs_madgwick_align(struct FloatRates *lp_gyro, struct FloatVect3 *lp_accel);
51 extern void ahrs_madgwick_propagate(struct FloatRates* gyro, float dt);
53 
54 #endif /* AHRS_MADGWICK_H */
55 
Dispatcher to register actual AHRS implementations.
struct AhrsMadgwick ahrs_madgwick
Definition: ahrs_madgwick.c:39
void ahrs_madgwick_propagate(struct FloatRates *gyro, float dt)
Definition: ahrs_madgwick.c:69
bool is_aligned
aligned flag
Definition: ahrs_madgwick.h:44
bool reset
flag to request reset/reinit the filter
Definition: ahrs_madgwick.h:43
void ahrs_madgwick_update_accel(struct FloatVect3 *accel)
struct FloatRates rates
Measured gyro rates.
Definition: ahrs_madgwick.h:40
struct FloatVect3 accel
Measured accelerometers.
Definition: ahrs_madgwick.h:42
void ahrs_madgwick_align(struct FloatRates *lp_gyro, struct FloatVect3 *lp_accel)
Definition: ahrs_madgwick.c:59
struct FloatQuat quat
Estimated attitude (quaternion)
Definition: ahrs_madgwick.h:39
void ahrs_madgwick_init(void)
Definition: ahrs_madgwick.c:50
struct FloatRates bias
Gyro bias (from alignment)
Definition: ahrs_madgwick.h:41
Madgwick filter structure.
Definition: ahrs_madgwick.h:38
Roation quaternion.
angular rates
Paparazzi floating point algebra.
Generic orientation representation and conversions.