mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
OP-1685 Adding support for synched and oneshot in Vehicle Setup Wizard.
This commit is contained in:
parent
1ad040229c
commit
a17553ce30
@ -44,9 +44,11 @@ EscPage::~EscPage()
|
||||
|
||||
bool EscPage::validatePage()
|
||||
{
|
||||
if (ui->rapidESCButton->isChecked()) {
|
||||
if (ui->synchedESCButton->isChecked()) {
|
||||
getWizard()->setEscType(SetupWizard::ESC_SYNCHED);
|
||||
}else if (ui->rapidESCButton->isChecked()) {
|
||||
getWizard()->setEscType(SetupWizard::ESC_RAPID);
|
||||
} else {
|
||||
} else if (ui->defaultESCButton->isChecked()){
|
||||
getWizard()->setEscType(SetupWizard::ESC_STANDARD);
|
||||
}
|
||||
|
||||
|
@ -139,6 +139,50 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="synchedESCButton">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Turbo PWM ESC 400Hz</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton { border: none }</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Synched ESC</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../wizardResources.qrc">
|
||||
<normaloff>:/setupwizard/resources/bttn-rapid-up.png</normaloff>
|
||||
<normalon>:/setupwizard/resources/bttn-rapid-dwn.png</normalon>:/setupwizard/resources/bttn-rapid-up.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -364,13 +364,20 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
||||
ActuatorSettings *actSettings = ActuatorSettings::GetInstance(m_uavoManager);
|
||||
|
||||
qint16 escFrequence = LEGACY_ESC_FREQUENCY;
|
||||
ActuatorSettings::BankModeOptions bankMode = ActuatorSettings::BANKMODE_PWM;
|
||||
|
||||
switch (m_configSource->getEscType()) {
|
||||
case VehicleConfigurationSource::ESC_STANDARD:
|
||||
escFrequence = LEGACY_ESC_FREQUENCY;
|
||||
bankMode = ActuatorSettings::BANKMODE_PWM;
|
||||
break;
|
||||
case VehicleConfigurationSource::ESC_RAPID:
|
||||
escFrequence = RAPID_ESC_FREQUENCY;
|
||||
bankMode = ActuatorSettings::BANKMODE_ONESHOT;
|
||||
break;
|
||||
case VehicleConfigurationSource::ESC_SYNCHED:
|
||||
escFrequence = RAPID_ESC_FREQUENCY;
|
||||
bankMode = ActuatorSettings::BANKMODE_ONESHOT125;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -406,30 +413,39 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
||||
|
||||
for (quint16 i = 0; i < ActuatorSettings::BANKUPDATEFREQ_NUMELEM; i++) {
|
||||
data.BankUpdateFreq[i] = LEGACY_ESC_FREQUENCY;
|
||||
data.BankMode[i] = ActuatorSettings::BANKMODE_PWM;
|
||||
}
|
||||
|
||||
switch (m_configSource->getVehicleSubType()) {
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_TRI_Y:
|
||||
// Servo always on channel 4
|
||||
data.BankUpdateFreq[0] = escFrequence;
|
||||
data.BankMode[0] = bankMode;
|
||||
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC ||
|
||||
m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC3D) {
|
||||
data.BankUpdateFreq[1] = servoFrequence;
|
||||
data.BankMode[1] = bankMode;
|
||||
} else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
||||
data.BankUpdateFreq[1] = escFrequence;
|
||||
data.BankMode[1] = bankMode;
|
||||
data.BankUpdateFreq[2] = servoFrequence;
|
||||
} else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_NANO) {
|
||||
data.BankUpdateFreq[1] = escFrequence;
|
||||
data.BankMode[1] = bankMode;
|
||||
data.BankUpdateFreq[2] = escFrequence;
|
||||
data.BankMode[2] = bankMode;
|
||||
data.BankUpdateFreq[3] = servoFrequence;
|
||||
}
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X:
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
|
||||
data.BankUpdateFreq[0] = escFrequence;
|
||||
data.BankMode[0] = bankMode;
|
||||
data.BankUpdateFreq[1] = escFrequence;
|
||||
data.BankMode[1] = bankMode;
|
||||
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
||||
data.BankUpdateFreq[2] = escFrequence;
|
||||
data.BankMode[2] = bankMode;
|
||||
}
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
|
||||
@ -442,9 +458,13 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS:
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_V:
|
||||
data.BankUpdateFreq[0] = escFrequence;
|
||||
data.BankMode[0] = bankMode;
|
||||
data.BankUpdateFreq[1] = escFrequence;
|
||||
data.BankMode[1] = bankMode;
|
||||
data.BankUpdateFreq[2] = escFrequence;
|
||||
data.BankMode[2] = bankMode;
|
||||
data.BankUpdateFreq[3] = escFrequence;
|
||||
data.BankMode[3] = bankMode;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -469,6 +489,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
||||
|
||||
for (quint16 i = 0; i < ActuatorSettings::BANKUPDATEFREQ_NUMELEM; i++) {
|
||||
data.BankUpdateFreq[i] = servoFrequence;
|
||||
data.BankMode[i] = ActuatorSettings::BANKMODE_PWM;
|
||||
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
||||
if (i == 1) {
|
||||
data.BankUpdateFreq[i] = escFrequence;
|
||||
@ -505,6 +526,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
||||
|
||||
for (quint16 i = 0; i < ActuatorSettings::BANKUPDATEFREQ_NUMELEM; i++) {
|
||||
data.BankUpdateFreq[i] = servoFrequence;
|
||||
data.BankMode[i] = ActuatorSettings::BANKMODE_PWM;
|
||||
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
||||
if (i == 1) {
|
||||
data.BankUpdateFreq[i] = escFrequence;
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
MULTI_ROTOR_OCTO_X, MULTI_ROTOR_OCTO_V, MULTI_ROTOR_OCTO_COAX_X, MULTI_ROTOR_OCTO_COAX_PLUS,
|
||||
FIXED_WING_DUAL_AILERON, FIXED_WING_AILERON, FIXED_WING_ELEVON, FIXED_WING_VTAIL, HELI_CCPM,
|
||||
GROUNDVEHICLE_MOTORCYCLE, GROUNDVEHICLE_CAR, GROUNDVEHICLE_DIFFERENTIAL };
|
||||
enum ESC_TYPE { ESC_RAPID, ESC_STANDARD, ESC_UNKNOWN };
|
||||
enum ESC_TYPE { ESC_SYNCHED, ESC_RAPID, ESC_STANDARD, ESC_UNKNOWN };
|
||||
enum SERVO_TYPE { SERVO_ANALOG, SERVO_DIGITAL, SERVO_UNKNOWN };
|
||||
enum INPUT_TYPE { INPUT_PWM, INPUT_PPM, INPUT_SBUS, INPUT_DSM, INPUT_UNKNOWN };
|
||||
enum AIRSPEED_TYPE { AIRSPEED_ESTIMATE, AIRSPEED_EAGLETREE, AIRSPEED_MS4525, AIRSPEED_DISABLED };
|
||||
|
Loading…
x
Reference in New Issue
Block a user