update the fw_estimator not only after a correction, but after propagation as well (if correction is running at a lower rate).

When using AHRS_TRIGGERED_ATTITUDE_LOOP, really only trigger after fw_estimator was updated and not at Periodic_Frequency
This commit is contained in:
Felix Ruess
2011-08-15 19:44:53 +02:00
parent 598fe47ad3
commit 39e21eb5a6
+10 -5
View File
@@ -691,6 +691,10 @@ static inline void on_gyro_event( void ) {
ahrs_update_accel();
ahrs_update_fw_estimator();
#ifdef AHRS_TRIGGERED_ATTITUDE_LOOP
new_ins_attitude = 1;
#endif
#else //PERIODIC_FREQUENCY
static uint8_t _reduced_propagation_rate = 0;
static uint8_t _reduced_correction_rate = 0;
@@ -723,8 +727,13 @@ static inline void on_gyro_event( void ) {
INT_VECT3_ZERO(acc_avg);
ImuScaleAccel(imu);
ahrs_update_accel();
ahrs_update_fw_estimator();
}
ahrs_update_fw_estimator();
#ifdef AHRS_TRIGGERED_ATTITUDE_LOOP
new_ins_attitude = 1;
#endif
}
#endif //PERIODIC_FREQUENCY
@@ -732,10 +741,6 @@ static inline void on_gyro_event( void ) {
LED_OFF(AHRS_CPU_LED);
#endif
#ifdef AHRS_TRIGGERED_ATTITUDE_LOOP
new_ins_attitude = 1;
#endif
}
static inline void on_mag_event(void)