mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-19 04:52:12 +01:00
LP-76 minor cleanup
This commit is contained in:
parent
4240c8ea5c
commit
f05b733434
@ -203,6 +203,8 @@ static void AutoTuneTask(__attribute__((unused)) void *parameters)
|
||||
uint32_t lastUpdateTime = 0; // initialization is only for compiler warning
|
||||
float noise[3] = { 0 };
|
||||
uint32_t lastTime = 0.0f;
|
||||
uint32_t measureTime = 0;
|
||||
uint32_t updateCounter = 0;
|
||||
bool saveSiNeeded = false;
|
||||
bool savePidNeeded = false;
|
||||
|
||||
@ -218,9 +220,7 @@ static void AutoTuneTask(__attribute__((unused)) void *parameters)
|
||||
InitSystemIdent(false);
|
||||
|
||||
while (1) {
|
||||
static uint32_t updateCounter = 0;
|
||||
uint32_t diffTime;
|
||||
uint32_t measureTime = 60000;
|
||||
bool doingIdent = false;
|
||||
bool canSleep = true;
|
||||
FlightStatusData flightStatus;
|
||||
|
@ -347,9 +347,9 @@ static void stabilizationInnerloopTask()
|
||||
|
||||
if (PIOS_DELAY_DiffuS(systemIdentTimeVal) / 1000.0f > SYSTEM_IDENT_PERIOD) {
|
||||
const float SCALE_BIAS = 7.1f;
|
||||
SystemIdentStateData systemIdentState;
|
||||
SystemIdentStateBetaData systemIdentBeta;
|
||||
|
||||
SystemIdentStateGet(&systemIdentState);
|
||||
SystemIdentStateBetaGet(&systemIdentBeta);
|
||||
systemIdentTimeVal = PIOS_DELAY_GetRaw();
|
||||
identOffsets[0] = 0.0f;
|
||||
identOffsets[1] = 0.0f;
|
||||
@ -358,7 +358,7 @@ static void stabilizationInnerloopTask()
|
||||
// why does yaw change twice a cycle and roll/pitch change only once?
|
||||
uint8_t index = ((uint8_t[]) { '\2', '\0', '\2', '\0', '\2', '\1', '\2', '\1' }
|
||||
)[identIteration];
|
||||
float scale = expapprox(SCALE_BIAS - SystemIdentStateBetaToArray(systemIdentState.Beta)[index]);
|
||||
float scale = expapprox(SCALE_BIAS - SystemIdentStateBetaToArray(systemIdentBeta)[index]);
|
||||
if (scale > 0.25f) {
|
||||
scale = 0.25f;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user