1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

CC/Stabilization - Fix attitude bias not being applied over all sampled quantities

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@3065 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
chebuzz 2011-03-24 17:12:04 +00:00 committed by chebuzz
parent b37dd770d2
commit 2e5863281c

View File

@ -214,9 +214,9 @@ static void updateSensors(AttitudeRawData * attitudeRaw)
} while ( (i < 32) && (samples_remaining > 0) );
attitudeRaw->gyrotemp[0] = samples_remaining;
attitudeRaw->gyrotemp[1] = i;
x -= accelbias[0];
y -= accelbias[1];
z -= accelbias[2];
x -= accelbias[0] * i;
y -= accelbias[1] * i;
z -= accelbias[2] * i;
attitudeRaw->accels[ATTITUDERAW_ACCELS_X] = ((float)x * 0.004f * 9.81f) / i;
attitudeRaw->accels[ATTITUDERAW_ACCELS_Y] = ((float)y * 0.004f * 9.81f) / i;
attitudeRaw->accels[ATTITUDERAW_ACCELS_Z] = ((float)z * 0.004f * 9.81f) / i;