start fixing mag in dcm, MAG_Heading still not read from imu

This commit is contained in:
Felix Ruess
2010-12-10 14:38:08 +01:00
parent 5a2b13e2c6
commit c4e3e6177d
2 changed files with 3 additions and 5 deletions
+3 -3
View File
@@ -303,10 +303,10 @@ void Drift_correction(void)
//*****YAW***************
#if USE_MAGNETOMETER==1
#ifdef USE_MAGNETOMETER
// We make the gyro YAW drift correction based on compass magnetic heading
mag_heading_x = cos(MAG_Heading);
mag_heading_y = sin(MAG_Heading);
float mag_heading_x = cos(MAG_Heading);
float mag_heading_y = sin(MAG_Heading);
errorCourse=(DCM_Matrix[0][0]*mag_heading_y) - (DCM_Matrix[1][0]*mag_heading_x); //Calculating YAW error
Vector_Scale(errorYaw,&DCM_Matrix[2][0],errorCourse); //Applys the yaw correction to the XYZ rotation of the aircraft, depeding the position.
@@ -65,8 +65,6 @@ void ahrs_update_fw_estimator(void);
// Mode 1 = DCM integration with Kp and Ki
// Mode 2 = direct accelerometer -> euler
#define MAGNETOMETER 1
extern float MAG_Heading;
#define PERFORMANCE_REPORTING 0
#if PERFORMANCE_REPORTING == 1