mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-21 11:54:15 +01:00
LP-56 - Allows a single txpid instance to handle Roll&Pitch
Also populate combos with current txpid values
This commit is contained in:
parent
383a4731c7
commit
7b3aed3de9
@ -389,7 +389,10 @@ static void updatePIDs(UAVObjEvent *ev)
|
|||||||
case TXPIDSETTINGS_PIDS_ACROPLUSFACTORPITCH:
|
case TXPIDSETTINGS_PIDS_ACROPLUSFACTORPITCH:
|
||||||
needsUpdateBank |= update(&bank.AcroInsanityFactor.Pitch, value);
|
needsUpdateBank |= update(&bank.AcroInsanityFactor.Pitch, value);
|
||||||
break;
|
break;
|
||||||
|
case TXPIDSETTINGS_PIDS_ACROPLUSFACTORROLLPITCH:
|
||||||
|
needsUpdateBank |= update(&bank.AcroInsanityFactor.Roll, value);
|
||||||
|
needsUpdateBank |= update(&bank.AcroInsanityFactor.Pitch, value);
|
||||||
|
break;
|
||||||
case TXPIDSETTINGS_PIDS_ACCELTAU:
|
case TXPIDSETTINGS_PIDS_ACCELTAU:
|
||||||
needsUpdateAtt |= update(&att.AccelTau, value);
|
needsUpdateAtt |= update(&att.AccelTau, value);
|
||||||
break;
|
break;
|
||||||
|
@ -163,8 +163,15 @@ static bool isExpoOption(int pidOption)
|
|||||||
|
|
||||||
static bool isAcroPlusFactorOption(int pidOption)
|
static bool isAcroPlusFactorOption(int pidOption)
|
||||||
{
|
{
|
||||||
return pidOption == TxPIDSettings::PIDS_ACROPLUSFACTORPITCH
|
switch (pidOption) {
|
||||||
|| pidOption == TxPIDSettings::PIDS_ACROPLUSFACTORROLL;
|
case TxPIDSettings::PIDS_ACROPLUSFACTORPITCH:
|
||||||
|
case TxPIDSettings::PIDS_ACROPLUSFACTORROLL:
|
||||||
|
case TxPIDSettings::PIDS_ACROPLUSFACTORROLLPITCH:
|
||||||
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class StabilizationSettingsBankX>
|
template <class StabilizationSettingsBankX>
|
||||||
@ -293,7 +300,11 @@ static float defaultValueForPidOption(const StabilizationSettingsBankX *bank, in
|
|||||||
|
|
||||||
case TxPIDSettings::PIDS_YAWEXPO:
|
case TxPIDSettings::PIDS_YAWEXPO:
|
||||||
return bank->getStickExpo_Yaw();
|
return bank->getStickExpo_Yaw();
|
||||||
|
case TxPIDSettings::PIDS_ACROPLUSFACTORROLL:
|
||||||
|
case TxPIDSettings::PIDS_ACROPLUSFACTORROLLPITCH:
|
||||||
|
return bank->getAcroInsanityFactor_Roll();
|
||||||
|
case TxPIDSettings::PIDS_ACROPLUSFACTORPITCH:
|
||||||
|
return bank->getAcroInsanityFactor_Pitch();
|
||||||
case -1: // The PID Option field was uninitialized.
|
case -1: // The PID Option field was uninitialized.
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
Roll+Pitch Attitude.Kp, Roll+Pitch Attitude.Ki, Roll+Pitch Attitude.ILimit, Roll+Pitch Attitude.Resp,
|
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,
|
Yaw Attitude.Kp, Yaw Attitude.Ki, Yaw Attitude.ILimit, Yaw Attitude.Resp,
|
||||||
Roll.Expo, Pitch.Expo, Roll+Pitch.Expo, Yaw.Expo,
|
Roll.Expo, Pitch.Expo, Roll+Pitch.Expo, Yaw.Expo,
|
||||||
GyroTau,AcroPlusFactorRoll,AcroPlusFactorPitch,Altitude Pos.Kp,Altitude Velocity.Kp,Altitude Velocity.Ki,Altitude Velocity.Kd,Altitude Velocity.Beta,
|
GyroTau,AcroPlusFactorRollPitch,AcroPlusFactorRoll,AcroPlusFactorPitch,Altitude Pos.Kp,Altitude Velocity.Kp,Altitude Velocity.Ki,Altitude Velocity.Kd,Altitude Velocity.Beta,
|
||||||
AccelTau, AccelKp, AccelKi"
|
AccelTau, AccelKp, AccelKi"
|
||||||
defaultvalue="Disabled"/>
|
defaultvalue="Disabled"/>
|
||||||
<field name="MinPID" units="" type="float" elementnames="Instance1,Instance2,Instance3" defaultvalue="0"/>
|
<field name="MinPID" units="" type="float" elementnames="Instance1,Instance2,Instance3" defaultvalue="0"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user