[ahrs] float_cmpl: set weight to 1.0 if heuristic is disabled

This commit is contained in:
Felix Ruess
2013-09-06 19:08:28 +02:00
parent e31901900f
commit d2addc1033
@@ -270,6 +270,9 @@ void ahrs_update_accel(void) {
ahrs_impl.weight = 1.0 - ahrs_impl.gravity_heuristic_factor * fabs(1.0 - g_meas_norm) / 10.0;
Bound(ahrs_impl.weight, 0.15, 1.0);
}
else {
ahrs_impl.weight = 1.0;
}
/* Complementary filter proportional gain.
* Kp = 2 * zeta * omega * weight * AHRS_PROPAGATE_FREQUENCY / AHRS_CORRECT_FREQUENCY