From 49727709071da8bfa3eae2f6932b0f6b44cf1ff4 Mon Sep 17 00:00:00 2001 From: dongie Date: Tue, 26 Nov 2013 11:31:23 +0900 Subject: [PATCH] correction of calculation for throttle angle correction (should really just replace with cosf() at some point --- src/imu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imu.c b/src/imu.c index d4a738006..e14fb3280 100755 --- a/src/imu.c +++ b/src/imu.c @@ -315,7 +315,7 @@ static void getEstimatedAttitude(void) acc_calc(deltaT); // rotate acc vector into earth frame if (cfg.throttle_angle_correction) { - int cosZ = EstG.V.Z / acc_1G * 100.0f; + int cosZ = EstG.V.Z / (acc_1G * 100.0f); throttleAngleCorrection = cfg.throttle_angle_correction * constrain(100 - cosZ, 0, 100) / 8; } }