Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ahrs_float_dcm.h
Go to the documentation of this file.
1 /*
2  * Released under Creative Commons License
3  *
4  * 2010 The Paparazzi Team
5  *
6  *
7  * Based on Code by Jordi Munoz and William Premerlani, Supported by Chris Anderson (Wired) and Nathan Sindle (SparkFun).
8  * Version 1.0 for flat board updated by Doug Weibel and Jose Julio
9  *
10  * Modified at Hochschule Bremen, Germany
11  * 2010 Heinrich Warmers, Christoph Niemann, Oliver Riesener
12  *
13  */
14 
21 #ifndef AHRS_FLOAT_DCM_H
22 #define AHRS_FLOAT_DCM_H
23 
24 #include <inttypes.h>
26 
27 struct AhrsFloatDCM {
30  /*
31  Holds float version of IMU alignement
32  in order to be able to run against the fixed point
33  version of the IMU
34  */
37 
38  float gps_speed;
40  float gps_course;
43 };
44 extern struct AhrsFloatDCM ahrs_impl;
45 
46 
47 #ifdef AHRS_UPDATE_FW_ESTIMATOR
48 extern float ins_roll_neutral;
49 extern float ins_pitch_neutral;
50 
51 void ahrs_update_fw_estimator(void);
52 #endif
53 
54 
55 // DCM Parameters
56 
57 //#define Kp_ROLLPITCH 0.2
58 #define Kp_ROLLPITCH 0.015
59 #define Ki_ROLLPITCH 0.000010
60 #define Kp_YAW 0.9 //High yaw drift correction gain - use with caution!
61 #define Ki_YAW 0.00005
62 
63 #define GRAVITY 9.81
64 
65 
66 #ifndef OUTPUTMODE
67 #define OUTPUTMODE 1
68 #endif
69 // Mode 0 = DCM integration without Ki gyro bias
70 // Mode 1 = DCM integration with Kp and Ki
71 // Mode 2 = direct accelerometer -> euler
72 
73 
74 #define PERFORMANCE_REPORTING 1
75 #if PERFORMANCE_REPORTING == 1
76 extern int renorm_sqrt_count;
77 extern int renorm_blowup_count;
78 extern float imu_health;
79 #endif
80 
81 #endif // AHRS_FLOAT_DCM_H
rotation matrix
angular rates
struct FloatQuat body_to_imu_quat
float gps_acceleration
float imu_health
int renorm_sqrt_count
Roation quaternion.
Paparazzi floating point algebra.
struct FloatRates rate_correction
struct FloatRMat body_to_imu_rmat
int renorm_blowup_count
float ins_pitch_neutral
Definition: ins_arduimu.c:15
uint8_t gps_age
struct FloatRates gyro_bias
void ahrs_update_fw_estimator(void)
unsigned char uint8_t
Definition: types.h:14
float ins_roll_neutral
Definition: ins_arduimu.c:14
bool_t gps_course_valid
struct AhrsFloatDCM ahrs_impl