Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
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 "modules/gps/gps.h"
31
36
53extern struct AhrsFloatDCM ahrs_dcm;
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#ifndef AHRS_FLOAT_MIN_SPEED_GPS_COURSE
74#define AHRS_FLOAT_MIN_SPEED_GPS_COURSE 5 // m/s
75#endif
76
77#define PERFORMANCE_REPORTING 1
78#if PERFORMANCE_REPORTING == 1
79extern int renorm_sqrt_count;
80extern int renorm_blowup_count;
81extern float imu_health;
82#endif
83
84extern void ahrs_dcm_init(void);
85extern bool ahrs_dcm_align(struct FloatRates *lp_gyro, struct FloatVect3 *lp_accel,
86 struct FloatVect3 *lp_mag);
87extern void ahrs_dcm_propagate(struct FloatRates *gyro, float dt);
88extern void ahrs_dcm_update_accel(struct FloatVect3 *accel);
89extern void ahrs_dcm_update_mag(struct FloatVect3 *mag);
90extern void ahrs_dcm_update_gps(struct GpsState *gps_s);
91
92#endif // AHRS_FLOAT_DCM_H
void ahrs_dcm_propagate(struct FloatRates *gyro, float dt)
void ahrs_dcm_update_mag(struct FloatVect3 *mag)
float gps_acceleration
void ahrs_dcm_init(void)
struct FloatRates rate_correction
struct FloatRates body_rate
struct FloatEulers ltp_to_body_euler
void ahrs_dcm_update_accel(struct FloatVect3 *accel)
struct FloatRates gyro_bias
struct AhrsFloatDCM ahrs_dcm
bool ahrs_dcm_align(struct FloatRates *lp_gyro, struct FloatVect3 *lp_accel, struct FloatVect3 *lp_mag)
AhrsDCMStatus
@ AHRS_DCM_UNINIT
@ AHRS_DCM_RUNNING
enum AhrsDCMStatus status
void ahrs_dcm_update_gps(struct GpsState *gps_s)
Device independent GPS code (interface)
data structure for GPS information
Definition gps.h:87
euler angles
angular rates
uint16_t foo
Definition main_demo5.c:58
Paparazzi floating point algebra.
Generic orientation representation and conversions.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.