mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
AHRS: Some more tweaking of the timings.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1603 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
10cfeeb35f
commit
76971a807c
@ -69,7 +69,7 @@ void DMA1_Channel1_IRQHandler() __attribute__ ((alias ("AHRS_ADC_DMA_Handler")))
|
||||
* @{
|
||||
*/
|
||||
// Currently analog acquistion hard coded at 480 Hz
|
||||
#define ADC_OVERSAMPLE 40
|
||||
#define ADC_OVERSAMPLE 48
|
||||
#define EKF_RATE ((float) 4*480 / ADC_OVERSAMPLE)
|
||||
#define ADC_CONTINUOUS_CHANNELS PIOS_ADC_NUM_PINS
|
||||
#define CORRECTION_COUNT 4
|
||||
@ -388,6 +388,7 @@ int main()
|
||||
vel[1] = 0;
|
||||
vel[2] = 0;
|
||||
VelBaroCorrection(vel,altitude_data.altitude);
|
||||
// MagVelBaroCorrection(mag,vel,altitude_data.altitude); // only trust mags if outdoors
|
||||
}
|
||||
|
||||
attitude_data.quaternion.q1 = Nav.q[0];
|
||||
|
@ -59,6 +59,7 @@ void INSSetMagNorth(float B[3]);
|
||||
void INSSetMagVar(float scaled_mag_var[3]);
|
||||
|
||||
void MagCorrection(float mag_data[3]);
|
||||
void MagVelBaroCorrection(float mag_data[3], float Vel[3], float BaroAlt);
|
||||
void FullCorrection(float mag_data[3], float Pos[3], float Vel[3], float BaroAlt);
|
||||
void GpsMagCorrection(float mag_data[3], float Pos[3], float Vel[2]);
|
||||
void VelBaroCorrection(float Vel[3], float BaroAlt);
|
||||
|
@ -173,6 +173,11 @@ void MagCorrection(float mag_data[3])
|
||||
INSCorrection(mag_data, zeros, zeros, zeros[0], MAG_SENSORS);
|
||||
}
|
||||
|
||||
void MagVelBaroCorrection(float mag_data[3], float Vel[3], float BaroAlt)
|
||||
{
|
||||
INSCorrection(mag_data, zeros, Vel, BaroAlt, MAG_SENSORS | HORIZ_SENSORS | VERT_SENSORS | BARO_SENSOR);
|
||||
}
|
||||
|
||||
void FullCorrection(float mag_data[3], float Pos[3], float Vel[3], float BaroAlt)
|
||||
{
|
||||
INSCorrection(mag_data, Pos, Vel, BaroAlt, FULL_SENSORS);
|
||||
|
Loading…
x
Reference in New Issue
Block a user