Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules 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 
24 #ifndef AHRS_FLOAT_DCM_H
25 #define AHRS_FLOAT_DCM_H
26 
27 #include <inttypes.h>
30 #include "subsystems/gps.h"
31 
35 };
36 
37 struct AhrsFloatDCM {
40 
43 
44  float gps_speed;
46  float gps_course;
49 
51 
53  bool_t is_aligned;
54 };
55 extern struct AhrsFloatDCM ahrs_dcm;
56 
57 // DCM Parameters
58 
59 //#define Kp_ROLLPITCH 0.2
60 #define Kp_ROLLPITCH 0.015
61 #define Ki_ROLLPITCH 0.000010
62 #define Kp_YAW 0.9 //High yaw drift correction gain - use with caution!
63 #define Ki_YAW 0.00005
64 
65 #define GRAVITY 9.81
66 
67 
68 #ifndef OUTPUTMODE
69 #define OUTPUTMODE 1
70 #endif
71 // Mode 0 = DCM integration without Ki gyro bias
72 // Mode 1 = DCM integration with Kp and Ki
73 // Mode 2 = direct accelerometer -> euler
74 
75 
76 #define PERFORMANCE_REPORTING 1
77 #if PERFORMANCE_REPORTING == 1
78 extern int renorm_sqrt_count;
79 extern int renorm_blowup_count;
80 extern float imu_health;
81 #endif
82 
83 extern void ahrs_dcm_init(void);
85 extern void ahrs_dcm_set_body_to_imu_quat(struct FloatQuat *q_b2i);
86 extern bool_t ahrs_dcm_align(struct Int32Rates *lp_gyro, struct Int32Vect3 *lp_accel,
87  struct Int32Vect3 *lp_mag);
88 extern void ahrs_dcm_propagate(struct Int32Rates *gyro, float dt);
89 extern void ahrs_dcm_update_accel(struct Int32Vect3 *accel);
90 extern void ahrs_dcm_update_mag(struct Int32Vect3 *mag);
91 extern void ahrs_dcm_update_gps(struct GpsState *gps_s);
92 
93 #endif // AHRS_FLOAT_DCM_H
angular rates
void ahrs_dcm_init(void)
struct FloatRates rate_correction
bool_t ahrs_dcm_align(struct Int32Rates *lp_gyro, struct Int32Vect3 *lp_accel, struct Int32Vect3 *lp_mag)
AhrsDCMStatus
euler angles
Roation quaternion.
float imu_health
void ahrs_dcm_update_mag(struct Int32Vect3 *mag)
int renorm_sqrt_count
struct FloatEulers ltp_to_imu_euler
struct AhrsFloatDCM ahrs_dcm
Paparazzi floating point algebra.
data structure for GPS information
Definition: gps.h:67
Device independent GPS code (interface)
int renorm_blowup_count
struct FloatRates gyro_bias
void ahrs_dcm_propagate(struct Int32Rates *gyro, float dt)
enum AhrsDCMStatus status
void ahrs_dcm_set_body_to_imu(struct OrientationReps *body_to_imu)
void ahrs_dcm_update_accel(struct Int32Vect3 *accel)
bool_t is_aligned
struct OrientationReps body_to_imu
unsigned char uint8_t
Definition: types.h:14
uint8_t gps_age
bool_t gps_course_valid
static struct OrientationReps body_to_imu
Definition: ins_alt_float.c:77
Generic orientation representation and conversions.
void ahrs_dcm_set_body_to_imu_quat(struct FloatQuat *q_b2i)
float gps_acceleration
angular rates
struct FloatRates imu_rate
void ahrs_dcm_update_gps(struct GpsState *gps_s)