mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 22:35:23 +03:00
revert more compact initialisation code due to SITL error otherwise
This commit is contained in:
parent
db7a04972c
commit
d837b5087d
1 changed files with 8 additions and 1 deletions
|
@ -148,7 +148,14 @@ void autopilotInit(void)
|
||||||
positionPidCoeffs.Kd = cfg->position_D * POSITION_D_SCALE;
|
positionPidCoeffs.Kd = cfg->position_D * POSITION_D_SCALE;
|
||||||
positionPidCoeffs.Kf = cfg->position_A * POSITION_A_SCALE; // Kf used for acceleration
|
positionPidCoeffs.Kf = cfg->position_A * POSITION_A_SCALE; // Kf used for acceleration
|
||||||
// initialise filters with approximate filter gains; location isn't used at this point.
|
// initialise filters with approximate filter gains; location isn't used at this point.
|
||||||
resetPositionControl(&gpsSol.llh, 100);
|
ap.upsampleLpfGain = pt3FilterGain(UPSAMPLING_CUTOFF_HZ, 0.01f); // 5Hz, assuming 100Hz task rate at init
|
||||||
|
resetUpsampleFilters();
|
||||||
|
// Initialise PT1 filters for deivative and acceleration in earth frame axes
|
||||||
|
ap.vaLpfCutoff = cfg->position_cutoff * 0.01f;
|
||||||
|
const float vaGain = pt1FilterGain(ap.vaLpfCutoff, 0.1f); // assume 10Hz GPS connection at start; value is overwritten before first filter use
|
||||||
|
for (unsigned i = 0; i < ARRAYLEN(ap.efAxis); i++) {
|
||||||
|
resetEFAxisFilters(&ap.efAxis[i], vaGain);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void resetAltitudeControl (void) {
|
void resetAltitudeControl (void) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue