Paparazzi UAS  v5.18.0_stable
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 "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 */
OrientationReps
Definition: pprz_orientation_conversion.h:79
AhrsFloatCmpl::ltp_to_imu_rmat
struct FloatRMat ltp_to_imu_rmat
Definition: ahrs_float_cmpl.h:48
AhrsFloatCmpl::gravity_heuristic_factor
uint8_t gravity_heuristic_factor
sets how strongly the gravity heuristic reduces accel correction.
Definition: ahrs_float_cmpl.h:62
uint16_t
unsigned short uint16_t
Definition: types.h:16
AhrsFloatCmpl::heading_aligned
bool heading_aligned
Definition: ahrs_float_cmpl.h:65
ahrs_fc_update_gps
void ahrs_fc_update_gps(struct GpsState *gps_s)
Definition: ahrs_float_cmpl.c:398
ahrs_fc_propagate
void ahrs_fc_propagate(struct FloatRates *gyro, float dt)
Definition: ahrs_float_cmpl.c:145
ahrs_fc_update_mag
void ahrs_fc_update_mag(struct FloatVect3 *mag, float dt)
Definition: ahrs_float_cmpl.c:279
GpsState
data structure for GPS information
Definition: gps.h:87
AhrsFloatCmpl::status
enum AhrsFCStatus status
Definition: ahrs_float_cmpl.h:75
AhrsFloatCmpl::ltp_to_imu_quat
struct FloatQuat ltp_to_imu_quat
Definition: ahrs_float_cmpl.h:47
AhrsFloatCmpl::is_aligned
bool is_aligned
Definition: ahrs_float_cmpl.h:76
AhrsFloatCmpl
Definition: ahrs_float_cmpl.h:43
pprz_algebra_float.h
Paparazzi floating point algebra.
AhrsFloatCmpl::ltp_vel_norm_valid
bool ltp_vel_norm_valid
Definition: ahrs_float_cmpl.h:52
FloatVect3
Definition: pprz_algebra_float.h:54
AhrsFloatCmpl::mag_zeta
float mag_zeta
filter damping for correcting the gyro bias from magnetometer
Definition: ahrs_float_cmpl.h:57
FloatQuat
Roation quaternion.
Definition: pprz_algebra_float.h:63
AhrsFloatCmpl::ltp_vel_norm
float ltp_vel_norm
velocity norm for gravity correction during coordinated turns
Definition: ahrs_float_cmpl.h:51
std.h
AhrsFloatCmpl::weight
float weight
Definition: ahrs_float_cmpl.h:63
gps.h
Device independent GPS code (interface)
AHRS_FC_UNINIT
@ AHRS_FC_UNINIT
Definition: ahrs_float_cmpl.h:39
AhrsFloatCmpl::accel_cnt
uint16_t accel_cnt
number of propagations since last accel update
Definition: ahrs_float_cmpl.h:69
AhrsFloatCmpl::mag_h
struct FloatVect3 mag_h
Definition: ahrs_float_cmpl.h:66
AhrsFloatCmpl::ltp_to_body
struct OrientationReps ltp_to_body
Definition: ahrs_float_cmpl.h:73
uint8_t
unsigned char uint8_t
Definition: types.h:14
ahrs_fc_align
bool ahrs_fc_align(struct FloatRates *lp_gyro, struct FloatVect3 *lp_accel, struct FloatVect3 *lp_mag)
Definition: ahrs_float_cmpl.c:118
ahrs_fc_set_body_to_imu_quat
void ahrs_fc_set_body_to_imu_quat(struct FloatQuat *q_b2i)
Definition: ahrs_float_cmpl.c:514
AHRS_FC_RUNNING
@ AHRS_FC_RUNNING
Definition: ahrs_float_cmpl.h:40
ahrs_fc_update_heading
void ahrs_fc_update_heading(float heading)
Update yaw based on a heading measurement.
Definition: ahrs_float_cmpl.c:429
AhrsFCStatus
AhrsFCStatus
Definition: ahrs_float_cmpl.h:38
AhrsFloatCmpl::correct_gravity
bool correct_gravity
enable gravity correction during coordinated turns
Definition: ahrs_float_cmpl.h:50
ahrs_fc
struct AhrsFloatCmpl ahrs_fc
Definition: ahrs_float_cmpl.c:80
AhrsFloatCmpl::imu_rate
struct FloatRates imu_rate
Definition: ahrs_float_cmpl.h:46
ahrs_fc_set_body_to_imu
void ahrs_fc_set_body_to_imu(struct OrientationReps *body_to_imu)
Definition: ahrs_float_cmpl.c:509
AhrsFloatCmpl::mag_omega
float mag_omega
filter cut-off frequency for correcting the attitude (heading) from magnetometer
Definition: ahrs_float_cmpl.h:56
ahrs_fc_realign_heading
void ahrs_fc_realign_heading(float heading)
Hard reset yaw to a heading.
Definition: ahrs_float_cmpl.c:473
AhrsFloatCmpl::rate_correction
struct FloatRates rate_correction
Definition: ahrs_float_cmpl.h:45
pprz_orientation_conversion.h
body_to_imu
static struct OrientationReps body_to_imu
Definition: ins_alt_float.c:93
ahrs_fc_init
void ahrs_fc_init(void)
Definition: ahrs_float_cmpl.c:82
FloatRMat
rotation matrix
Definition: pprz_algebra_float.h:77
ahrs_fc_recompute_ltp_to_body
void ahrs_fc_recompute_ltp_to_body(void)
Definition: ahrs_float_cmpl.c:525
ahrs_fc_update_accel
void ahrs_fc_update_accel(struct FloatVect3 *accel, float dt)
Definition: ahrs_float_cmpl.c:181
AhrsFloatCmpl::body_to_imu
struct OrientationReps body_to_imu
Definition: ahrs_float_cmpl.h:72
AhrsFloatCmpl::mag_cnt
uint16_t mag_cnt
number of propagations since last mag update
Definition: ahrs_float_cmpl.h:70
AhrsFloatCmpl::gyro_bias
struct FloatRates gyro_bias
Definition: ahrs_float_cmpl.h:44
FloatRates
angular rates
Definition: pprz_algebra_float.h:93
AhrsFloatCmpl::accel_zeta
float accel_zeta
filter damping for correcting the gyro-bias from accels (pseudo-gravity measurement)
Definition: ahrs_float_cmpl.h:55
heading
float heading
Definition: wedgebug.c:258
AhrsFloatCmpl::accel_omega
float accel_omega
filter cut-off frequency for correcting the attitude from accels (pseudo-gravity measurement)
Definition: ahrs_float_cmpl.h:54