1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

Removed tricopter yaw gyro smoothing from imuUpdate

This commit is contained in:
Steveis 2015-05-10 11:02:44 +01:00
parent fe40472050
commit 318592b063
3 changed files with 7 additions and 15 deletions

View file

@ -298,11 +298,13 @@ static void imuCalculateEstimatedAttitude(void)
imuCalculateAcceleration(deltaT); // rotate acc vector into earth frame
}
void imuUpdate(rollAndPitchTrims_t *accelerometerTrims, uint8_t mixerMode)
void imuUpdate(rollAndPitchTrims_t *accelerometerTrims)
{
static int16_t gyroYawSmooth = 0;
gyroUpdate();
gyroData[FD_ROLL] = gyroADC[FD_ROLL];
gyroData[FD_PITCH] = gyroADC[FD_PITCH];
gyroData[FD_YAW] = gyroADC[FD_YAW];
if (sensors(SENSOR_ACC)) {
updateAccelerationReadings(accelerometerTrims); // TODO rename to accelerometerUpdate and rename many other 'Acceleration' references to be 'Accelerometer'
imuCalculateEstimatedAttitude();
@ -311,16 +313,6 @@ void imuUpdate(rollAndPitchTrims_t *accelerometerTrims, uint8_t mixerMode)
accADC[Y] = 0;
accADC[Z] = 0;
}
gyroData[FD_ROLL] = gyroADC[FD_ROLL];
gyroData[FD_PITCH] = gyroADC[FD_PITCH];
if (mixerMode == MIXER_TRI) {
gyroData[FD_YAW] = (gyroYawSmooth * 2 + gyroADC[FD_YAW]) / 3;
gyroYawSmooth = gyroData[FD_YAW];
} else {
gyroData[FD_YAW] = gyroADC[FD_YAW];
}
}
int16_t calculateThrottleAngleCorrection(uint8_t throttle_correction_value)