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

LP-56 - Better txpid option namings, fix tabs-spaces, tooltips. headers, variable namings

This commit is contained in:
Alessio Morale 2015-07-30 18:23:55 +02:00
parent 3490057f69
commit 13f02e7d9d
10 changed files with 21 additions and 20 deletions

View File

@ -302,7 +302,7 @@ static void stabilizationInnerloopTask()
-StabilizationBankMaximumRateToArray(stabSettings.stabBank.MaximumRate)[t],
StabilizationBankMaximumRateToArray(stabSettings.stabBank.MaximumRate)[t]
);
const float acro_factors[] = {
const float acroFactors[] = {
stabSettings.stabBank.AcroInsanityFactor.Roll,
stabSettings.stabBank.AcroInsanityFactor.Pitch,
stabSettings.stabBank.AcroInsanityFactor.Yaw
@ -310,7 +310,7 @@ static void stabilizationInnerloopTask()
pid_scaler ascaler = create_pid_scaler(t);
ascaler.i *= boundf(1.0f - (1.5f * fabsf(stickinput[t])), 0.0f, 1.0f); // this prevents Integral from getting too high while controlled manually
float arate = pid_apply_setpoint(&stabSettings.innerPids[t], &ascaler, rate[t], gyro_filtered[t], dT);
float factor = fabsf(stickinput[t]) * acro_factors[t];
float factor = fabsf(stickinput[t]) * acroFactors[t];
actuatorDesiredAxis[t] = factor * stickinput[t] + (1.0f - factor) * arate;
}
break;

View File

@ -383,13 +383,13 @@ static void updatePIDs(UAVObjEvent *ev)
case TXPIDSETTINGS_PIDS_GYROTAU:
needsUpdateStab |= update(&stab.GyroTau, value);
break;
case TXPIDSETTINGS_PIDS_ACROPLUSFACTORROLL:
case TXPIDSETTINGS_PIDS_ACROROLLFACTOR:
needsUpdateBank |= update(&bank.AcroInsanityFactor.Roll, value);
break;
case TXPIDSETTINGS_PIDS_ACROPLUSFACTORPITCH:
case TXPIDSETTINGS_PIDS_ACROPITCHFACTOR:
needsUpdateBank |= update(&bank.AcroInsanityFactor.Pitch, value);
break;
case TXPIDSETTINGS_PIDS_ACROPLUSFACTORROLLPITCH:
case TXPIDSETTINGS_PIDS_ACROROLLPITCHFACTOR:
needsUpdateBank |= update(&bank.AcroInsanityFactor.Roll, value);
needsUpdateBank |= update(&bank.AcroInsanityFactor.Pitch, value);
break;

View File

@ -2,6 +2,7 @@
******************************************************************************
*
* @file configstabilizationwidget.cpp
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
* @author E. Lafargue & The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{

View File

@ -164,9 +164,9 @@ static bool isExpoOption(int pidOption)
static bool isAcroPlusFactorOption(int pidOption)
{
switch (pidOption) {
case TxPIDSettings::PIDS_ACROPLUSFACTORPITCH:
case TxPIDSettings::PIDS_ACROPLUSFACTORROLL:
case TxPIDSettings::PIDS_ACROPLUSFACTORROLLPITCH:
case TxPIDSettings::PIDS_ACROPITCHFACTOR:
case TxPIDSettings::PIDS_ACROROLLFACTOR:
case TxPIDSettings::PIDS_ACROROLLPITCHFACTOR:
return true;
default:
@ -300,10 +300,10 @@ static float defaultValueForPidOption(const StabilizationSettingsBankX *bank, in
case TxPIDSettings::PIDS_YAWEXPO:
return bank->getStickExpo_Yaw();
case TxPIDSettings::PIDS_ACROPLUSFACTORROLL:
case TxPIDSettings::PIDS_ACROPLUSFACTORROLLPITCH:
case TxPIDSettings::PIDS_ACROROLLFACTOR:
case TxPIDSettings::PIDS_ACROROLLPITCHFACTOR:
return bank->getAcroInsanityFactor_Roll();
case TxPIDSettings::PIDS_ACROPLUSFACTORPITCH:
case TxPIDSettings::PIDS_ACROPITCHFACTOR:
return bank->getAcroInsanityFactor_Pitch();
case -1: // The PID Option field was uninitialized.
return 0.0f;

View File

@ -208,7 +208,7 @@ margin-top: -1px;
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Link roll &amp;amp; pitch sliders to move together, thus giving same value for both roll &amp;amp; pitch when setting up a symetrical vehicle that requires both to be the same&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Link roll &amp;amp; pitch sliders to move together&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="styleSheet">
<string notr="true"/>

View File

@ -20,7 +20,7 @@
Roll+Pitch Attitude.Kp, Roll+Pitch Attitude.Ki, Roll+Pitch Attitude.ILimit, Roll+Pitch Attitude.Resp,
Yaw Attitude.Kp, Yaw Attitude.Ki, Yaw Attitude.ILimit, Yaw Attitude.Resp,
Roll.Expo, Pitch.Expo, Roll+Pitch.Expo, Yaw.Expo,
GyroTau,AcroPlusFactorRollPitch,AcroPlusFactorRoll,AcroPlusFactorPitch,Altitude Pos.Kp,Altitude Velocity.Kp,Altitude Velocity.Ki,Altitude Velocity.Kd,Altitude Velocity.Beta,
GyroTau,Acro+ Roll Factor,Acro+ Pitch Factor,Acro+ Roll+Pitch Factor,Altitude Pos.Kp,Altitude Velocity.Kp,Altitude Velocity.Ki,Altitude Velocity.Kd,Altitude Velocity.Beta,
AccelTau, AccelKp, AccelKi"
defaultvalue="Disabled"/>
<field name="MinPID" units="" type="float" elementnames="Instance1,Instance2,Instance3" defaultvalue="0"/>