Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
ahrs_float_cmpl.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 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 
30 #ifndef AHRS_FLOAT_CMPL_H
31 #define AHRS_FLOAT_CMPL_H
32 
33 #include "std.h"
36 #include "modules/gps/gps.h"
37 
41 };
42 
43 struct AhrsFloatCmpl {
44  struct FloatRates gyro_bias;
46  struct FloatRates body_rate;
49 
51  float ltp_vel_norm;
53 
54  float accel_omega;
55  float accel_zeta;
56  float mag_omega;
57  float mag_zeta;
58 
63  float weight;
64 
66  struct FloatVect3 mag_h;
67 
68  /* internal counters for the gains */
71 
72  enum AhrsFCStatus status;
73  bool is_aligned;
74 };
75 
76 extern struct AhrsFloatCmpl ahrs_fc;
77 
78 extern void ahrs_fc_init(void);
79 extern bool ahrs_fc_align(struct FloatRates *lp_gyro, struct FloatVect3 *lp_accel,
80  struct FloatVect3 *lp_mag);
81 extern void ahrs_fc_propagate(struct FloatRates *gyro, float dt);
82 extern void ahrs_fc_update_accel(struct FloatVect3 *accel, float dt);
83 extern void ahrs_fc_update_mag(struct FloatVect3 *mag, float dt);
84 extern void ahrs_fc_update_gps(struct GpsState *gps_s);
85 
91 
98 
99 
100 #endif /* AHRS_FLOAT_CMPL_H */
struct FloatRates gyro_bias
struct FloatRates body_rate
struct AhrsFloatCmpl ahrs_fc
AhrsFCStatus
@ AHRS_FC_UNINIT
@ AHRS_FC_RUNNING
uint16_t mag_cnt
number of propagations since last mag update
enum AhrsFCStatus status
bool correct_gravity
enable gravity correction during coordinated turns
void ahrs_fc_init(void)
float mag_zeta
filter damping for correcting the gyro bias from magnetometer
void ahrs_fc_update_mag(struct FloatVect3 *mag, float dt)
bool ahrs_fc_align(struct FloatRates *lp_gyro, struct FloatVect3 *lp_accel, struct FloatVect3 *lp_mag)
struct FloatVect3 mag_h
struct FloatRMat ltp_to_body_rmat
struct FloatRates rate_correction
void ahrs_fc_propagate(struct FloatRates *gyro, float dt)
float ltp_vel_norm
velocity norm for gravity correction during coordinated turns
float mag_omega
filter cut-off frequency for correcting the attitude (heading) from magnetometer
void ahrs_fc_realign_heading(float heading)
Hard reset yaw to a heading.
float accel_zeta
filter damping for correcting the gyro-bias from accels (pseudo-gravity measurement)
uint8_t gravity_heuristic_factor
sets how strongly the gravity heuristic reduces accel correction.
void ahrs_fc_update_accel(struct FloatVect3 *accel, float dt)
float accel_omega
filter cut-off frequency for correcting the attitude from accels (pseudo-gravity measurement)
void ahrs_fc_update_gps(struct GpsState *gps_s)
uint16_t accel_cnt
number of propagations since last accel update
struct FloatQuat ltp_to_body_quat
void ahrs_fc_update_heading(float heading)
Update yaw based on a heading measurement.
Device independent GPS code (interface)
data structure for GPS information
Definition: gps.h:87
Roation quaternion.
rotation matrix
angular rates
Paparazzi floating point algebra.
Generic orientation representation and conversions.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
Definition: vl53l1_types.h:88
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98
float heading
Definition: wedgebug.c:258