Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 "subsystems/gps.h"
37 
41 };
42 
43 struct AhrsFloatCmpl {
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 
74 
76  bool is_aligned;
77 };
78 
79 extern struct AhrsFloatCmpl ahrs_fc;
80 
81 extern void ahrs_fc_init(void);
83 extern void ahrs_fc_set_body_to_imu_quat(struct FloatQuat *q_b2i);
84 extern void ahrs_fc_recompute_ltp_to_body(void);
85 extern bool ahrs_fc_align(struct FloatRates *lp_gyro, struct FloatVect3 *lp_accel,
86  struct FloatVect3 *lp_mag);
87 extern void ahrs_fc_propagate(struct FloatRates *gyro, float dt);
88 extern void ahrs_fc_update_accel(struct FloatVect3 *accel, float dt);
89 extern void ahrs_fc_update_mag(struct FloatVect3 *mag, float dt);
90 extern void ahrs_fc_update_gps(struct GpsState *gps_s);
91 
97 
103 void ahrs_fc_realign_heading(float heading);
104 
105 
106 #endif /* AHRS_FLOAT_CMPL_H */
void ahrs_fc_update_heading(float heading)
Update yaw based on a heading measurement.
unsigned short uint16_t
Definition: types.h:16
uint16_t mag_cnt
number of propagations since last mag update
float accel_omega
filter cut-off frequency for correcting the attitude from accels (pseudo-gravity measurement) ...
struct AhrsFloatCmpl ahrs_fc
struct FloatRates gyro_bias
bool ahrs_fc_align(struct FloatRates *lp_gyro, struct FloatVect3 *lp_accel, struct FloatVect3 *lp_mag)
bool correct_gravity
enable gravity correction during coordinated turns
struct FloatRMat ltp_to_imu_rmat
void ahrs_fc_propagate(struct FloatRates *gyro, float dt)
void ahrs_fc_realign_heading(float heading)
Hard reset yaw to a heading.
void ahrs_fc_update_mag(struct FloatVect3 *mag, float dt)
void ahrs_fc_update_accel(struct FloatVect3 *accel, float dt)
AhrsFCStatus
struct FloatQuat ltp_to_imu_quat
Roation quaternion.
uint8_t gravity_heuristic_factor
sets how strongly the gravity heuristic reduces accel correction.
static float heading
Definition: ahrs_infrared.c:45
Paparazzi floating point algebra.
data structure for GPS information
Definition: gps.h:81
Device independent GPS code (interface)
float mag_omega
filter cut-off frequency for correcting the attitude (heading) from magnetometer
float accel_zeta
filter damping for correcting the gyro-bias from accels (pseudo-gravity measurement) ...
struct FloatVect3 mag_h
void ahrs_fc_update_gps(struct GpsState *gps_s)
unsigned char uint8_t
Definition: types.h:14
struct FloatRates imu_rate
void ahrs_fc_recompute_ltp_to_body(void)
struct OrientationReps body_to_imu
void ahrs_fc_set_body_to_imu(struct OrientationReps *body_to_imu)
rotation matrix
uint16_t accel_cnt
number of propagations since last accel update
float ltp_vel_norm
velocity norm for gravity correction during coordinated turns
static struct OrientationReps body_to_imu
Definition: ins_alt_float.c:93
void ahrs_fc_set_body_to_imu_quat(struct FloatQuat *q_b2i)
struct FloatRates rate_correction
enum AhrsFCStatus status
Generic orientation representation and conversions.
float mag_zeta
filter damping for correcting the gyro bias from magnetometer
void ahrs_fc_init(void)
angular rates
struct OrientationReps ltp_to_body