mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-07 09:36:19 +08:00
start fixing mag in dcm, MAG_Heading still not read from imu
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user