1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

Woops. Fix really nasty bug in vbar mode I introduced. Also fix small bug in

scoping of gyro gain that made it not work.
This commit is contained in:
James Cotton 2012-02-23 10:59:00 -06:00
parent 6719ee8639
commit 42ac4018b8

View File

@ -333,11 +333,11 @@ static void stabilizationTask(void* parameters)
// Command signal is composed of stick input added to the gyro and virtual flybar
float gyro_gain = 1.0f;
if (vbar_gyros_suppress) {
float gyro_gain = (1.0f - fabs(rateDesiredAxis[i]));
gyro_gain = (1.0f - fabs(rateDesiredAxis[i]));
gyro_gain = (gyro_gain < 0) ? 0 : gyro_gain;
}
float command = rateDesiredAxis[i] - gyro_gain * (
vbar_integral[i] * pids[PID_VBAR_ROLL + i].i -
vbar_integral[i] * pids[PID_VBAR_ROLL + i].i +
gyro_filtered[i] * pids[PID_VBAR_ROLL + i].p);
actuatorDesiredAxis[i] = bound(command);