Merged in f5soh/librepilot/LP-514_Dshot_Wizard (pull request #490)
LP-514 Dshot Wizard support and other Esc types Approved-by: Lalanne Laurent <f5soh@free.fr> Approved-by: Philippe Renon <philippe_renon@yahoo.fr>
@ -179,7 +179,9 @@ void ConnectionDiagram::setupGraphicsScene()
|
|||||||
case VehicleConfigurationSource::CONTROLLER_CC:
|
case VehicleConfigurationSource::CONTROLLER_CC:
|
||||||
case VehicleConfigurationSource::CONTROLLER_CC3D:
|
case VehicleConfigurationSource::CONTROLLER_CC3D:
|
||||||
prefix = "cc-";
|
prefix = "cc-";
|
||||||
if (m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT ||
|
if (m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT125 ||
|
||||||
|
m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT42 ||
|
||||||
|
m_configSource->getEscType() == VehicleConfigurationSource::ESC_MULTISHOT ||
|
||||||
m_configSource->getEscType() == VehicleConfigurationSource::ESC_SYNCHED) {
|
m_configSource->getEscType() == VehicleConfigurationSource::ESC_SYNCHED) {
|
||||||
suffix = "-oneshot";
|
suffix = "-oneshot";
|
||||||
}
|
}
|
||||||
|
@ -93,8 +93,10 @@ void EscCalibrationPage::resetAllSecurityCheckboxes()
|
|||||||
|
|
||||||
int EscCalibrationPage::getHighOutputRate()
|
int EscCalibrationPage::getHighOutputRate()
|
||||||
{
|
{
|
||||||
if (getWizard()->getEscType() == SetupWizard::ESC_ONESHOT) {
|
if (getWizard()->getEscType() == SetupWizard::ESC_ONESHOT125 ||
|
||||||
return HIGH_ONESHOT125_OUTPUT_PULSE_LENGTH_MICROSECONDS;
|
getWizard()->getEscType() == SetupWizard::ESC_ONESHOT42 ||
|
||||||
|
getWizard()->getEscType() == SetupWizard::ESC_MULTISHOT) {
|
||||||
|
return HIGH_ONESHOT_MULTISHOT_OUTPUT_PULSE_LENGTH_MICROSECONDS;
|
||||||
} else {
|
} else {
|
||||||
return HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS;
|
return HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ private:
|
|||||||
// Min value should match min value defined in vehicleconfigurationsource.h
|
// Min value should match min value defined in vehicleconfigurationsource.h
|
||||||
static const int LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 1000;
|
static const int LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 1000;
|
||||||
static const int HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 1900;
|
static const int HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 1900;
|
||||||
static const int HIGH_ONESHOT125_OUTPUT_PULSE_LENGTH_MICROSECONDS = 2000;
|
static const int HIGH_ONESHOT_MULTISHOT_OUTPUT_PULSE_LENGTH_MICROSECONDS = 2000;
|
||||||
Ui::EscCalibrationPage *ui;
|
Ui::EscCalibrationPage *ui;
|
||||||
bool m_isCalibrating;
|
bool m_isCalibrating;
|
||||||
OutputCalibrationUtil m_outputUtil;
|
OutputCalibrationUtil m_outputUtil;
|
||||||
|
@ -47,17 +47,41 @@ void EscPage::initializePage()
|
|||||||
{
|
{
|
||||||
bool enabled = isSynchOrOneShotAvailable();
|
bool enabled = isSynchOrOneShotAvailable();
|
||||||
|
|
||||||
ui->oneshotESCButton->setEnabled(enabled);
|
ui->oneshot125ESCButton->setEnabled(enabled);
|
||||||
if (ui->oneshotESCButton->isChecked() && !enabled) {
|
ui->oneshot42ESCButton->setEnabled(enabled);
|
||||||
ui->oneshotESCButton->setChecked(false);
|
ui->multishotESCButton->setEnabled(enabled);
|
||||||
|
|
||||||
|
if ((ui->oneshot125ESCButton->isChecked() ||
|
||||||
|
ui->oneshot42ESCButton->isChecked() ||
|
||||||
|
ui->multishotESCButton->isChecked()) && !enabled) {
|
||||||
|
ui->oneshot125ESCButton->setChecked(false);
|
||||||
|
ui->oneshot42ESCButton->setChecked(false);
|
||||||
|
ui->multishotESCButton->setChecked(false);
|
||||||
ui->rapidESCButton->setChecked(true);
|
ui->rapidESCButton->setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enabled = isFastDShotAvailable();
|
||||||
|
ui->dshot1200ESCButton->setEnabled(enabled);
|
||||||
|
if (ui->dshot1200ESCButton->isChecked() && !enabled) {
|
||||||
|
ui->dshot1200ESCButton->setChecked(false);
|
||||||
|
ui->dshot600ESCButton->setChecked(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EscPage::validatePage()
|
bool EscPage::validatePage()
|
||||||
{
|
{
|
||||||
if (ui->oneshotESCButton->isChecked()) {
|
if (ui->dshot1200ESCButton->isChecked()) {
|
||||||
getWizard()->setEscType(SetupWizard::ESC_ONESHOT);
|
getWizard()->setEscType(SetupWizard::ESC_DSHOT1200);
|
||||||
|
} else if (ui->dshot600ESCButton->isChecked()) {
|
||||||
|
getWizard()->setEscType(SetupWizard::ESC_DSHOT600);
|
||||||
|
} else if (ui->dshot150ESCButton->isChecked()) {
|
||||||
|
getWizard()->setEscType(SetupWizard::ESC_DSHOT150);
|
||||||
|
} else if (ui->multishotESCButton->isChecked()) {
|
||||||
|
getWizard()->setEscType(SetupWizard::ESC_MULTISHOT);
|
||||||
|
} else if (ui->oneshot42ESCButton->isChecked()) {
|
||||||
|
getWizard()->setEscType(SetupWizard::ESC_ONESHOT42);
|
||||||
|
} else if (ui->oneshot125ESCButton->isChecked()) {
|
||||||
|
getWizard()->setEscType(SetupWizard::ESC_ONESHOT125);
|
||||||
} else if (ui->rapidESCButton->isChecked()) {
|
} else if (ui->rapidESCButton->isChecked()) {
|
||||||
if (isSynchOrOneShotAvailable()) {
|
if (isSynchOrOneShotAvailable()) {
|
||||||
getWizard()->setEscType(SetupWizard::ESC_SYNCHED);
|
getWizard()->setEscType(SetupWizard::ESC_SYNCHED);
|
||||||
@ -65,7 +89,7 @@ bool EscPage::validatePage()
|
|||||||
getWizard()->setEscType(SetupWizard::ESC_RAPID);
|
getWizard()->setEscType(SetupWizard::ESC_RAPID);
|
||||||
}
|
}
|
||||||
} else if (ui->defaultESCButton->isChecked()) {
|
} else if (ui->defaultESCButton->isChecked()) {
|
||||||
getWizard()->setEscType(SetupWizard::ESC_STANDARD);
|
getWizard()->setEscType(SetupWizard::ESC_STANDARD300);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -107,3 +131,22 @@ bool EscPage::isSynchOrOneShotAvailable()
|
|||||||
|
|
||||||
return available;
|
return available;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EscPage::isFastDShotAvailable()
|
||||||
|
{
|
||||||
|
bool available = true;
|
||||||
|
|
||||||
|
switch (getWizard()->getControllerType()) {
|
||||||
|
case SetupWizard::CONTROLLER_CC3D:
|
||||||
|
case SetupWizard::CONTROLLER_SPRACINGF3:
|
||||||
|
case SetupWizard::CONTROLLER_SPRACINGF3EVO:
|
||||||
|
case SetupWizard::CONTROLLER_PIKOBLX:
|
||||||
|
case SetupWizard::CONTROLLER_TINYFISH:
|
||||||
|
available = false;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return available;
|
||||||
|
}
|
||||||
|
@ -46,6 +46,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
Ui::EscPage *ui;
|
Ui::EscPage *ui;
|
||||||
bool isSynchOrOneShotAvailable();
|
bool isSynchOrOneShotAvailable();
|
||||||
|
bool isFastDShotAvailable();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ESCPAGE_H
|
#endif // ESCPAGE_H
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>641</width>
|
<width>699</width>
|
||||||
<height>400</height>
|
<height>549</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -59,7 +59,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Standard ESC: Slow refresh rate (50Hz), not recommended for Multirotors.</string>
|
<string>Standard ESC: Minimal refresh rate (300Hz), for Multirotors.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QToolButton { border: none }</string>
|
<string notr="true">QToolButton { border: none }</string>
|
||||||
@ -69,8 +69,8 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../wizardResources.qrc">
|
<iconset resource="../wizardResources.qrc">
|
||||||
<normaloff>:/setupwizard/resources/bttn-ESC-up.png</normaloff>
|
<normaloff>:/setupwizard/resources/bttn-esc300-up.png</normaloff>
|
||||||
<normalon>:/setupwizard/resources/bttn-ESC-down.png</normalon>:/setupwizard/resources/bttn-ESC-up.png</iconset>
|
<normalon>:/setupwizard/resources/bttn-esc300-dwn.png</normalon>:/setupwizard/resources/bttn-esc300-up.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
@ -139,10 +139,17 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="oneshotESCButton">
|
<widget class="QToolButton" name="oneshot125ESCButton">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
@ -150,18 +157,260 @@ p, li { white-space: pre-wrap; }
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>OneShot ESC: BLHeli, Kiss...</string>
|
<string>OneShot125 ESC: BLHeli, Kiss...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QToolButton { border: none }</string>
|
<string notr="true">QToolButton { border: none }</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>OneShot ESC</string>
|
<string>OneShot125 ESC</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../wizardResources.qrc">
|
<iconset resource="../wizardResources.qrc">
|
||||||
<normaloff>:/setupwizard/resources/bttn-oneshot-up.png</normaloff>
|
<normaloff>:/setupwizard/resources/bttn-oneshot125-up.png</normaloff>
|
||||||
<normalon>:/setupwizard/resources/bttn-oneshot-dwn.png</normalon>:/setupwizard/resources/bttn-oneshot-up.png</iconset>
|
<normalon>:/setupwizard/resources/bttn-oneshot125-dwn.png</normalon>:/setupwizard/resources/bttn-oneshot125-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>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="oneshot42ESCButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>OneShot42 ESC: BLHeli, Kiss...</string>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QToolButton { border: none }</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>OneShot42 ESC</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../wizardResources.qrc">
|
||||||
|
<normaloff>:/setupwizard/resources/bttn-oneshot42-up.png</normaloff>
|
||||||
|
<normalon>:/setupwizard/resources/bttn-oneshot42-dwn.png</normalon>:/setupwizard/resources/bttn-oneshot42-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>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="multishotESCButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>MultiShot ESC: BLHeli, Kiss...</string>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QToolButton { border: none }</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>MultiShot ESC</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../wizardResources.qrc">
|
||||||
|
<normaloff>:/setupwizard/resources/bttn-multishot-up.png</normaloff>
|
||||||
|
<normalon>:/setupwizard/resources/bttn-multishot-dwn.png</normalon>:/setupwizard/resources/bttn-multishot-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>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="dshot150ESCButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>DShot150 ESC: BLHeli_S...</string>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QToolButton { border: none }</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>DShot150 ESC</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../wizardResources.qrc">
|
||||||
|
<normaloff>:/setupwizard/resources/bttn-dshot150-up.png</normaloff>
|
||||||
|
<normalon>:/setupwizard/resources/bttn-dshot150-dwn.png</normalon>:/setupwizard/resources/bttn-dshot150-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>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="dshot600ESCButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>DShot600 ESC: BLHeli_S...</string>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QToolButton { border: none }</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>DShot600 ESC</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../wizardResources.qrc">
|
||||||
|
<normaloff>:/setupwizard/resources/bttn-dshot600-up.png</normaloff>
|
||||||
|
<normalon>:/setupwizard/resources/bttn-dshot600-dwn.png</normalon>:/setupwizard/resources/bttn-dshot600-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>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="dshot1200ESCButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>DShot1200 ESC: BLHeli_S...</string>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QToolButton { border: none }</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>DShot1200 ESC</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../wizardResources.qrc">
|
||||||
|
<normaloff>:/setupwizard/resources/bttn-dshot1200-up.png</normaloff>
|
||||||
|
<normalon>:/setupwizard/resources/bttn-dshot1200-dwn.png</normalon>:/setupwizard/resources/bttn-dshot1200-up.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
|
@ -82,8 +82,8 @@ void OutputCalibrationPage::setupActuatorMinMaxAndNeutral(int motorChannelStart,
|
|||||||
for (int servoid = 0; servoid < 12; servoid++) {
|
for (int servoid = 0; servoid < 12; servoid++) {
|
||||||
if (servoid >= motorChannelStart && servoid <= motorChannelEnd) {
|
if (servoid >= motorChannelStart && servoid <= motorChannelEnd) {
|
||||||
// Set to motor safe values
|
// Set to motor safe values
|
||||||
m_actuatorSettings[servoid].channelMin = LOW_OUTPUT_RATE_MILLISECONDS;
|
m_actuatorSettings[servoid].channelMin = getLowOutputRate();
|
||||||
m_actuatorSettings[servoid].channelNeutral = LOW_OUTPUT_RATE_MILLISECONDS;
|
m_actuatorSettings[servoid].channelNeutral = getLowOutputRate();
|
||||||
m_actuatorSettings[servoid].channelMax = getHighOutputRate();
|
m_actuatorSettings[servoid].channelMax = getHighOutputRate();
|
||||||
m_actuatorSettings[servoid].isReversableMotor = false;
|
m_actuatorSettings[servoid].isReversableMotor = false;
|
||||||
// Car, Tank, Boat and Boat differential should use reversable Esc/motors
|
// Car, Tank, Boat and Boat differential should use reversable Esc/motors
|
||||||
@ -91,25 +91,25 @@ void OutputCalibrationPage::setupActuatorMinMaxAndNeutral(int motorChannelStart,
|
|||||||
|| (getWizard()->getVehicleSubType() == SetupWizard::GROUNDVEHICLE_DIFFERENTIAL)
|
|| (getWizard()->getVehicleSubType() == SetupWizard::GROUNDVEHICLE_DIFFERENTIAL)
|
||||||
|| (getWizard()->getVehicleSubType() == SetupWizard::GROUNDVEHICLE_BOAT)
|
|| (getWizard()->getVehicleSubType() == SetupWizard::GROUNDVEHICLE_BOAT)
|
||||||
|| (getWizard()->getVehicleSubType() == SetupWizard::GROUNDVEHICLE_DIFFERENTIAL_BOAT)) {
|
|| (getWizard()->getVehicleSubType() == SetupWizard::GROUNDVEHICLE_DIFFERENTIAL_BOAT)) {
|
||||||
m_actuatorSettings[servoid].channelNeutral = NEUTRAL_OUTPUT_RATE_MILLISECONDS;
|
m_actuatorSettings[servoid].channelNeutral = NEUTRAL_OUTPUT_RATE_MS;
|
||||||
m_actuatorSettings[servoid].isReversableMotor = true;
|
m_actuatorSettings[servoid].isReversableMotor = true;
|
||||||
// Set initial output value
|
|
||||||
m_calibrationUtil->startChannelOutput(servoid, NEUTRAL_OUTPUT_RATE_MILLISECONDS);
|
|
||||||
m_calibrationUtil->stopChannelOutput();
|
|
||||||
}
|
}
|
||||||
|
// Set initial output value
|
||||||
|
m_calibrationUtil->startChannelOutput(servoid, m_actuatorSettings[servoid].channelNeutral);
|
||||||
|
m_calibrationUtil->stopChannelOutput();
|
||||||
} else if (servoid < totalUsedChannels) {
|
} else if (servoid < totalUsedChannels) {
|
||||||
// Set to servo safe values
|
// Set to servo safe values
|
||||||
m_actuatorSettings[servoid].channelMin = NEUTRAL_OUTPUT_RATE_MILLISECONDS;
|
m_actuatorSettings[servoid].channelMin = NEUTRAL_OUTPUT_RATE_MS;
|
||||||
m_actuatorSettings[servoid].channelNeutral = NEUTRAL_OUTPUT_RATE_MILLISECONDS;
|
m_actuatorSettings[servoid].channelNeutral = NEUTRAL_OUTPUT_RATE_MS;
|
||||||
m_actuatorSettings[servoid].channelMax = NEUTRAL_OUTPUT_RATE_MILLISECONDS;
|
m_actuatorSettings[servoid].channelMax = NEUTRAL_OUTPUT_RATE_MS;
|
||||||
// Set initial servo output value
|
// Set initial servo output value
|
||||||
m_calibrationUtil->startChannelOutput(servoid, NEUTRAL_OUTPUT_RATE_MILLISECONDS);
|
m_calibrationUtil->startChannelOutput(servoid, NEUTRAL_OUTPUT_RATE_MS);
|
||||||
m_calibrationUtil->stopChannelOutput();
|
m_calibrationUtil->stopChannelOutput();
|
||||||
} else {
|
} else {
|
||||||
// "Disable" these channels
|
// "Disable" these channels
|
||||||
m_actuatorSettings[servoid].channelMin = LOW_OUTPUT_RATE_MILLISECONDS;
|
m_actuatorSettings[servoid].channelMin = LOW_OUTPUT_RATE_MS;
|
||||||
m_actuatorSettings[servoid].channelNeutral = LOW_OUTPUT_RATE_MILLISECONDS;
|
m_actuatorSettings[servoid].channelNeutral = LOW_OUTPUT_RATE_MS;
|
||||||
m_actuatorSettings[servoid].channelMax = LOW_OUTPUT_RATE_MILLISECONDS;
|
m_actuatorSettings[servoid].channelMax = LOW_OUTPUT_RATE_MS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -466,11 +466,18 @@ void OutputCalibrationPage::setWizardPage()
|
|||||||
qDebug() << "Current channel: " << currentChannel + 1;
|
qDebug() << "Current channel: " << currentChannel + 1;
|
||||||
if (currentChannel >= 0) {
|
if (currentChannel >= 0) {
|
||||||
if (currentPageIndex == 1) {
|
if (currentPageIndex == 1) {
|
||||||
|
// Set Min, Neutral and Max for slider in all cases, needed for DShot.
|
||||||
|
ui->motorNeutralSlider->setMinimum(m_actuatorSettings[currentChannel].channelMin);
|
||||||
ui->motorNeutralSlider->setValue(m_actuatorSettings[currentChannel].channelNeutral);
|
ui->motorNeutralSlider->setValue(m_actuatorSettings[currentChannel].channelNeutral);
|
||||||
ui->motorPWMValue->setText(QString(tr("Output value : <b>%1</b> µs")).arg(m_actuatorSettings[currentChannel].channelNeutral));
|
ui->motorNeutralSlider->setMaximum(m_actuatorSettings[currentChannel].channelMin + NEUTRAL_OUTPUT_RATE_RANGE);
|
||||||
|
if (ui->motorNeutralSlider->minimum() == LOW_OUTPUT_RATE_DSHOT) {
|
||||||
|
// DShot output
|
||||||
|
ui->motorPWMValue->setText(tr("Digital output value : <b>%1</b>").arg(m_actuatorSettings[currentChannel].channelNeutral));
|
||||||
|
} else {
|
||||||
|
ui->motorPWMValue->setText(tr("Output value : <b>%1</b> µs").arg(m_actuatorSettings[currentChannel].channelNeutral));
|
||||||
|
}
|
||||||
// Reversable motor found
|
// Reversable motor found
|
||||||
if (m_actuatorSettings[currentChannel].isReversableMotor) {
|
if (m_actuatorSettings[currentChannel].isReversableMotor) {
|
||||||
ui->motorNeutralSlider->setMinimum(m_actuatorSettings[currentChannel].channelMin);
|
|
||||||
ui->motorNeutralSlider->setMaximum(m_actuatorSettings[currentChannel].channelMax);
|
ui->motorNeutralSlider->setMaximum(m_actuatorSettings[currentChannel].channelMax);
|
||||||
ui->motorInfo->setText(tr("<html><head/><body><p><span style=\" font-size:10pt;\">To find </span><span style=\" font-size:10pt; font-weight:600;\">the neutral rate for this reversable motor</span><span style=\" font-size:10pt;\">, press the Start button below and slide the slider to the right or left until you find the value where the motor doesn't start. <br/><br/>When done press button again to stop.</span></p></body></html>"));
|
ui->motorInfo->setText(tr("<html><head/><body><p><span style=\" font-size:10pt;\">To find </span><span style=\" font-size:10pt; font-weight:600;\">the neutral rate for this reversable motor</span><span style=\" font-size:10pt;\">, press the Start button below and slide the slider to the right or left until you find the value where the motor doesn't start. <br/><br/>When done press button again to stop.</span></p></body></html>"));
|
||||||
}
|
}
|
||||||
@ -781,10 +788,10 @@ bool OutputCalibrationPage::checkAlarms()
|
|||||||
|
|
||||||
if (data.Alarm[SystemAlarms::ALARM_ACTUATOR] != SystemAlarms::ALARM_OK) {
|
if (data.Alarm[SystemAlarms::ALARM_ACTUATOR] != SystemAlarms::ALARM_OK) {
|
||||||
QMessageBox mbox(this);
|
QMessageBox mbox(this);
|
||||||
mbox.setText(QString(tr("The actuator module is in an error state.\n\n"
|
mbox.setText(tr("The actuator module is in an error state.\n\n"
|
||||||
"Please make sure the correct firmware version is used then "
|
"Please make sure the correct firmware version is used then "
|
||||||
"restart the wizard and try again. If the problem persists please "
|
"restart the wizard and try again. If the problem persists please "
|
||||||
"consult the librepilot.org support forum.")));
|
"consult the librepilot.org support forum."));
|
||||||
mbox.setStandardButtons(QMessageBox::Ok);
|
mbox.setStandardButtons(QMessageBox::Ok);
|
||||||
mbox.setIcon(QMessageBox::Critical);
|
mbox.setIcon(QMessageBox::Critical);
|
||||||
|
|
||||||
@ -816,20 +823,40 @@ void OutputCalibrationPage::debugLogChannelValues(bool showFirst)
|
|||||||
qDebug() << "ChannelMax : " << m_actuatorSettings[currentChannel].channelMax;
|
qDebug() << "ChannelMax : " << m_actuatorSettings[currentChannel].channelMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int OutputCalibrationPage::getLowOutputRate()
|
||||||
|
{
|
||||||
|
if (getWizard()->getEscType() == VehicleConfigurationSource::ESC_DSHOT150 ||
|
||||||
|
getWizard()->getEscType() == VehicleConfigurationSource::ESC_DSHOT600 ||
|
||||||
|
getWizard()->getEscType() == VehicleConfigurationSource::ESC_DSHOT1200) {
|
||||||
|
return LOW_OUTPUT_RATE_DSHOT;
|
||||||
|
}
|
||||||
|
return LOW_OUTPUT_RATE_PWM_MS;
|
||||||
|
}
|
||||||
|
|
||||||
int OutputCalibrationPage::getHighOutputRate()
|
int OutputCalibrationPage::getHighOutputRate()
|
||||||
{
|
{
|
||||||
if (getWizard()->getEscType() == SetupWizard::ESC_ONESHOT) {
|
if (getWizard()->getEscType() == VehicleConfigurationSource::ESC_ONESHOT125 ||
|
||||||
return HIGH_OUTPUT_RATE_MILLISECONDS_ONESHOT125;
|
getWizard()->getEscType() == VehicleConfigurationSource::ESC_ONESHOT42 ||
|
||||||
} else {
|
getWizard()->getEscType() == VehicleConfigurationSource::ESC_MULTISHOT) {
|
||||||
return HIGH_OUTPUT_RATE_MILLISECONDS_PWM;
|
return HIGH_OUTPUT_RATE_ONESHOT_MULTISHOT_MS;
|
||||||
|
} else if (getWizard()->getEscType() == VehicleConfigurationSource::ESC_DSHOT150 ||
|
||||||
|
getWizard()->getEscType() == VehicleConfigurationSource::ESC_DSHOT600 ||
|
||||||
|
getWizard()->getEscType() == VehicleConfigurationSource::ESC_DSHOT1200) {
|
||||||
|
return HIGH_OUTPUT_RATE_DSHOT;
|
||||||
}
|
}
|
||||||
|
return HIGH_OUTPUT_RATE_PWM_MS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutputCalibrationPage::on_motorNeutralSlider_valueChanged(int value)
|
void OutputCalibrationPage::on_motorNeutralSlider_valueChanged(int value)
|
||||||
{
|
{
|
||||||
Q_UNUSED(value);
|
Q_UNUSED(value);
|
||||||
ui->motorPWMValue->setText(tr("Output value : <b>%1</b> µs").arg(value));
|
|
||||||
|
|
||||||
|
if (ui->motorNeutralSlider->minimum() == LOW_OUTPUT_RATE_DSHOT) {
|
||||||
|
// DShot output
|
||||||
|
ui->motorPWMValue->setText(tr("Digital output value : <b>%1</b>").arg(value));
|
||||||
|
} else {
|
||||||
|
ui->motorPWMValue->setText(tr("Output value : <b>%1</b> µs").arg(value));
|
||||||
|
}
|
||||||
if (ui->motorNeutralButton->isChecked()) {
|
if (ui->motorNeutralButton->isChecked()) {
|
||||||
quint16 value = ui->motorNeutralSlider->value();
|
quint16 value = ui->motorNeutralSlider->value();
|
||||||
m_calibrationUtil->setChannelOutputValue(value);
|
m_calibrationUtil->setChannelOutputValue(value);
|
||||||
|
@ -87,10 +87,14 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
enum ElementType { FULL, FRAME, MOTOR, SERVO };
|
enum ElementType { FULL, FRAME, MOTOR, SERVO };
|
||||||
static const int LOW_OUTPUT_RATE_MILLISECONDS = 1000;
|
static const int LOW_OUTPUT_RATE_DSHOT = 0;
|
||||||
static const int NEUTRAL_OUTPUT_RATE_MILLISECONDS = 1500;
|
static const int HIGH_OUTPUT_RATE_DSHOT = 2000;
|
||||||
static const int HIGH_OUTPUT_RATE_MILLISECONDS_PWM = 1900;
|
static const int LOW_OUTPUT_RATE_MS = 1000;
|
||||||
static const int HIGH_OUTPUT_RATE_MILLISECONDS_ONESHOT125 = 2000;
|
static const int LOW_OUTPUT_RATE_PWM_MS = 1000;
|
||||||
|
static const int HIGH_OUTPUT_RATE_PWM_MS = 1900;
|
||||||
|
static const int NEUTRAL_OUTPUT_RATE_RANGE = 500;
|
||||||
|
static const int NEUTRAL_OUTPUT_RATE_MS = 1500;
|
||||||
|
static const int HIGH_OUTPUT_RATE_ONESHOT_MULTISHOT_MS = 2000;
|
||||||
|
|
||||||
void setupVehicle();
|
void setupVehicle();
|
||||||
void startWizard();
|
void startWizard();
|
||||||
@ -112,6 +116,7 @@ private:
|
|||||||
|
|
||||||
void getCurrentChannels(QList<quint16> &channels);
|
void getCurrentChannels(QList<quint16> &channels);
|
||||||
void enableAllMotorsCheckBox(bool enable);
|
void enableAllMotorsCheckBox(bool enable);
|
||||||
|
int getLowOutputRate();
|
||||||
int getHighOutputRate();
|
int getHighOutputRate();
|
||||||
quint16 getCurrentChannel();
|
quint16 getCurrentChannel();
|
||||||
|
|
||||||
|
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
BIN
ground/gcs/src/plugins/setupwizard/resources/bttn-esc300-dwn.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
ground/gcs/src/plugins/setupwizard/resources/bttn-esc300-up.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 5.6 KiB |
@ -181,7 +181,10 @@ int SetupWizard::nextId() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
case PAGE_BIAS_CALIBRATION:
|
case PAGE_BIAS_CALIBRATION:
|
||||||
if (getVehicleType() == VEHICLE_MULTI) {
|
if ((getVehicleType() == VEHICLE_MULTI) &&
|
||||||
|
(getEscType() != ESC_DSHOT150) &&
|
||||||
|
(getEscType() != ESC_DSHOT600) &&
|
||||||
|
(getEscType() != ESC_DSHOT1200)) {
|
||||||
return PAGE_ESC_CALIBRATION;
|
return PAGE_ESC_CALIBRATION;
|
||||||
} else {
|
} else {
|
||||||
return PAGE_OUTPUT_CALIBRATION;
|
return PAGE_OUTPUT_CALIBRATION;
|
||||||
@ -414,14 +417,32 @@ QString SetupWizard::getSummaryText()
|
|||||||
case ESC_STANDARD:
|
case ESC_STANDARD:
|
||||||
summary.append(tr("Standard ESC (%1 Hz)").arg(VehicleConfigurationHelper::LEGACY_ESC_FREQUENCY));
|
summary.append(tr("Standard ESC (%1 Hz)").arg(VehicleConfigurationHelper::LEGACY_ESC_FREQUENCY));
|
||||||
break;
|
break;
|
||||||
|
case ESC_STANDARD300:
|
||||||
|
summary.append(tr("Standard ESC (%1 Hz)").arg(VehicleConfigurationHelper::LEGACY_MULTI_ESC_FREQUENCY));
|
||||||
|
break;
|
||||||
case ESC_RAPID:
|
case ESC_RAPID:
|
||||||
summary.append(tr("Rapid ESC (%1 Hz)").arg(VehicleConfigurationHelper::RAPID_ESC_FREQUENCY));
|
summary.append(tr("Rapid ESC (%1 Hz)").arg(VehicleConfigurationHelper::RAPID_ESC_FREQUENCY));
|
||||||
break;
|
break;
|
||||||
case ESC_SYNCHED:
|
case ESC_SYNCHED:
|
||||||
summary.append(tr("Synched ESC"));
|
summary.append(tr("Synched ESC"));
|
||||||
break;
|
break;
|
||||||
case ESC_ONESHOT:
|
case ESC_ONESHOT125:
|
||||||
summary.append(tr("Oneshot ESC"));
|
summary.append(tr("Oneshot125 ESC"));
|
||||||
|
break;
|
||||||
|
case ESC_ONESHOT42:
|
||||||
|
summary.append(tr("Oneshot42 ESC"));
|
||||||
|
break;
|
||||||
|
case ESC_MULTISHOT:
|
||||||
|
summary.append(tr("Multishot ESC"));
|
||||||
|
break;
|
||||||
|
case ESC_DSHOT150:
|
||||||
|
summary.append(tr("Dshot150 ESC"));
|
||||||
|
break;
|
||||||
|
case ESC_DSHOT600:
|
||||||
|
summary.append(tr("Dshot600 ESC"));
|
||||||
|
break;
|
||||||
|
case ESC_DSHOT1200:
|
||||||
|
summary.append(tr("Dshot1200 ESC"));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
summary.append(tr("Unknown"));
|
summary.append(tr("Unknown"));
|
||||||
|
@ -157,7 +157,9 @@ void VehicleConfigurationHelper::applyHardwareConfiguration()
|
|||||||
data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PWMNOONESHOT;
|
data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PWMNOONESHOT;
|
||||||
break;
|
break;
|
||||||
case VehicleConfigurationSource::INPUT_PPM:
|
case VehicleConfigurationSource::INPUT_PPM:
|
||||||
if (m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT ||
|
if (m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT125 ||
|
||||||
|
m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT42 ||
|
||||||
|
m_configSource->getEscType() == VehicleConfigurationSource::ESC_MULTISHOT ||
|
||||||
m_configSource->getEscType() == VehicleConfigurationSource::ESC_SYNCHED) {
|
m_configSource->getEscType() == VehicleConfigurationSource::ESC_SYNCHED) {
|
||||||
data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PPM_PIN8ONESHOT;
|
data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PPM_PIN8ONESHOT;
|
||||||
} else {
|
} else {
|
||||||
@ -515,6 +517,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
|||||||
ActuatorSettings *actSettings = ActuatorSettings::GetInstance(m_uavoManager);
|
ActuatorSettings *actSettings = ActuatorSettings::GetInstance(m_uavoManager);
|
||||||
|
|
||||||
qint16 escFrequence = LEGACY_ESC_FREQUENCY;
|
qint16 escFrequence = LEGACY_ESC_FREQUENCY;
|
||||||
|
qint16 escDShotMode = LEGACY_DSHOT_MODE;
|
||||||
ActuatorSettings::BankModeOptions bankMode = ActuatorSettings::BANKMODE_PWM;
|
ActuatorSettings::BankModeOptions bankMode = ActuatorSettings::BANKMODE_PWM;
|
||||||
|
|
||||||
switch (m_configSource->getEscType()) {
|
switch (m_configSource->getEscType()) {
|
||||||
@ -522,6 +525,10 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
|||||||
escFrequence = LEGACY_ESC_FREQUENCY;
|
escFrequence = LEGACY_ESC_FREQUENCY;
|
||||||
bankMode = ActuatorSettings::BANKMODE_PWM;
|
bankMode = ActuatorSettings::BANKMODE_PWM;
|
||||||
break;
|
break;
|
||||||
|
case VehicleConfigurationSource::ESC_STANDARD300:
|
||||||
|
escFrequence = LEGACY_MULTI_ESC_FREQUENCY;
|
||||||
|
bankMode = ActuatorSettings::BANKMODE_PWM;
|
||||||
|
break;
|
||||||
case VehicleConfigurationSource::ESC_RAPID:
|
case VehicleConfigurationSource::ESC_RAPID:
|
||||||
bankMode = ActuatorSettings::BANKMODE_PWM;
|
bankMode = ActuatorSettings::BANKMODE_PWM;
|
||||||
escFrequence = RAPID_ESC_FREQUENCY;
|
escFrequence = RAPID_ESC_FREQUENCY;
|
||||||
@ -530,9 +537,32 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
|||||||
bankMode = ActuatorSettings::BANKMODE_PWMSYNC;
|
bankMode = ActuatorSettings::BANKMODE_PWMSYNC;
|
||||||
escFrequence = PWMSYNC_ESC_FREQUENCY;
|
escFrequence = PWMSYNC_ESC_FREQUENCY;
|
||||||
break;
|
break;
|
||||||
case VehicleConfigurationSource::ESC_ONESHOT:
|
case VehicleConfigurationSource::ESC_ONESHOT125:
|
||||||
bankMode = ActuatorSettings::BANKMODE_ONESHOT125;
|
bankMode = ActuatorSettings::BANKMODE_ONESHOT125;
|
||||||
escFrequence = ONESHOT_ESC_FREQUENCY;
|
escFrequence = ESC_FREQUENCY_ZERO;
|
||||||
|
break;
|
||||||
|
case VehicleConfigurationSource::ESC_ONESHOT42:
|
||||||
|
bankMode = ActuatorSettings::BANKMODE_ONESHOT42;
|
||||||
|
escFrequence = ESC_FREQUENCY_ZERO;
|
||||||
|
break;
|
||||||
|
case VehicleConfigurationSource::ESC_MULTISHOT:
|
||||||
|
bankMode = ActuatorSettings::BANKMODE_MULTISHOT;
|
||||||
|
escFrequence = ESC_FREQUENCY_ZERO;
|
||||||
|
break;
|
||||||
|
case VehicleConfigurationSource::ESC_DSHOT150:
|
||||||
|
bankMode = ActuatorSettings::BANKMODE_DSHOT;
|
||||||
|
escFrequence = ESC_FREQUENCY_ZERO;
|
||||||
|
escDShotMode = DSHOT_MODE_150;
|
||||||
|
break;
|
||||||
|
case VehicleConfigurationSource::ESC_DSHOT600:
|
||||||
|
bankMode = ActuatorSettings::BANKMODE_DSHOT;
|
||||||
|
escFrequence = ESC_FREQUENCY_ZERO;
|
||||||
|
// escDShotFrequence = LEGACY_DSHOT_ESC_FREQUENCY;
|
||||||
|
break;
|
||||||
|
case VehicleConfigurationSource::ESC_DSHOT1200:
|
||||||
|
bankMode = ActuatorSettings::BANKMODE_DSHOT;
|
||||||
|
escFrequence = ESC_FREQUENCY_ZERO;
|
||||||
|
escDShotMode = DSHOT_MODE_1200;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -574,6 +604,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
|||||||
switch (m_configSource->getVehicleSubType()) {
|
switch (m_configSource->getVehicleSubType()) {
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_TRI_Y:
|
case VehicleConfigurationSource::MULTI_ROTOR_TRI_Y:
|
||||||
// Servo always on channel 4
|
// Servo always on channel 4
|
||||||
|
data.DShotMode = escDShotMode;
|
||||||
data.BankUpdateFreq[0] = escFrequence;
|
data.BankUpdateFreq[0] = escFrequence;
|
||||||
data.BankMode[0] = bankMode;
|
data.BankMode[0] = bankMode;
|
||||||
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO
|
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO
|
||||||
@ -591,6 +622,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
|||||||
break;
|
break;
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X:
|
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X:
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
|
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
|
||||||
|
data.DShotMode = escDShotMode;
|
||||||
data.BankUpdateFreq[0] = escFrequence;
|
data.BankUpdateFreq[0] = escFrequence;
|
||||||
data.BankMode[0] = bankMode;
|
data.BankMode[0] = bankMode;
|
||||||
data.BankUpdateFreq[1] = escFrequence;
|
data.BankUpdateFreq[1] = escFrequence;
|
||||||
@ -617,6 +649,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
|||||||
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X:
|
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X:
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS:
|
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS:
|
||||||
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_V:
|
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_V:
|
||||||
|
data.DShotMode = escDShotMode;
|
||||||
data.BankUpdateFreq[0] = escFrequence;
|
data.BankUpdateFreq[0] = escFrequence;
|
||||||
data.BankMode[0] = bankMode;
|
data.BankMode[0] = bankMode;
|
||||||
data.BankUpdateFreq[1] = escFrequence;
|
data.BankUpdateFreq[1] = escFrequence;
|
||||||
|
@ -61,15 +61,19 @@ public:
|
|||||||
VehicleConfigurationHelper(VehicleConfigurationSource *configSource);
|
VehicleConfigurationHelper(VehicleConfigurationSource *configSource);
|
||||||
bool setupVehicle(bool save = true);
|
bool setupVehicle(bool save = true);
|
||||||
bool setupHardwareSettings(bool save = true);
|
bool setupHardwareSettings(bool save = true);
|
||||||
static const qint16 LEGACY_ESC_FREQUENCY = 50;
|
static const qint16 LEGACY_ESC_FREQUENCY = 50;
|
||||||
static const qint16 RAPID_ESC_FREQUENCY = 490;
|
static const qint16 LEGACY_MULTI_ESC_FREQUENCY = 300;
|
||||||
static const qint16 PWMSYNC_ESC_FREQUENCY = 0;
|
static const qint16 RAPID_ESC_FREQUENCY = 490;
|
||||||
static const qint16 ONESHOT_ESC_FREQUENCY = 0;
|
static const qint16 PWMSYNC_ESC_FREQUENCY = 0;
|
||||||
static const qint16 ANALOG_SERVO_FREQUENCY = 50;
|
static const qint16 ESC_FREQUENCY_ZERO = 0;
|
||||||
static const qint16 DIGITAL_SERVO_FREQUENCY = 333;
|
static const qint16 DSHOT_MODE_150 = 150;
|
||||||
|
static const qint16 LEGACY_DSHOT_MODE = 600;
|
||||||
|
static const qint16 DSHOT_MODE_1200 = 1200;
|
||||||
|
static const qint16 ANALOG_SERVO_FREQUENCY = 50;
|
||||||
|
static const qint16 DIGITAL_SERVO_FREQUENCY = 333;
|
||||||
static const int MIXER_TYPE_NONE = 0;
|
static const int MIXER_TYPE_NONE = 0;
|
||||||
static const int MIXER_TYPE_MOTOR = 1;
|
static const int MIXER_TYPE_MOTOR = 1;
|
||||||
static const int MIXER_TYPE_REVERSABLEMOTOR = 2;
|
static const int MIXER_TYPE_REVERSABLEMOTOR = 2;
|
||||||
static const int MIXER_TYPE_SERVO = 3;
|
static const int MIXER_TYPE_SERVO = 3;
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ public:
|
|||||||
MULTI_ROTOR_OCTO_X, MULTI_ROTOR_OCTO_V, MULTI_ROTOR_OCTO_COAX_X, MULTI_ROTOR_OCTO_COAX_PLUS,
|
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,
|
FIXED_WING_DUAL_AILERON, FIXED_WING_AILERON, FIXED_WING_ELEVON, FIXED_WING_VTAIL, HELI_CCPM,
|
||||||
GROUNDVEHICLE_MOTORCYCLE, GROUNDVEHICLE_CAR, GROUNDVEHICLE_DIFFERENTIAL, GROUNDVEHICLE_BOAT, GROUNDVEHICLE_DIFFERENTIAL_BOAT };
|
GROUNDVEHICLE_MOTORCYCLE, GROUNDVEHICLE_CAR, GROUNDVEHICLE_DIFFERENTIAL, GROUNDVEHICLE_BOAT, GROUNDVEHICLE_DIFFERENTIAL_BOAT };
|
||||||
enum ESC_TYPE { ESC_ONESHOT, ESC_SYNCHED, ESC_RAPID, ESC_STANDARD, ESC_UNKNOWN };
|
enum ESC_TYPE { ESC_DSHOT1200, ESC_DSHOT600, ESC_DSHOT150, ESC_MULTISHOT, ESC_ONESHOT42, ESC_ONESHOT125, ESC_SYNCHED, ESC_RAPID, ESC_STANDARD300, ESC_STANDARD, ESC_UNKNOWN };
|
||||||
enum SERVO_TYPE { SERVO_ANALOG, SERVO_DIGITAL, SERVO_UNKNOWN };
|
enum SERVO_TYPE { SERVO_ANALOG, SERVO_DIGITAL, SERVO_UNKNOWN };
|
||||||
enum INPUT_TYPE { INPUT_PWM, INPUT_PPM, INPUT_SBUS, INPUT_DSM, INPUT_SRXL, INPUT_HOTT_SUMD, INPUT_EXBUS, INPUT_IBUS, INPUT_UNKNOWN };
|
enum INPUT_TYPE { INPUT_PWM, INPUT_PPM, INPUT_SBUS, INPUT_DSM, INPUT_SRXL, INPUT_HOTT_SUMD, INPUT_EXBUS, INPUT_IBUS, INPUT_UNKNOWN };
|
||||||
enum AIRSPEED_TYPE { AIRSPEED_ESTIMATE, AIRSPEED_EAGLETREE, AIRSPEED_MS4525, AIRSPEED_DISABLED };
|
enum AIRSPEED_TYPE { AIRSPEED_ESTIMATE, AIRSPEED_EAGLETREE, AIRSPEED_MS4525, AIRSPEED_DISABLED };
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
<file>resources/bttn-plane-down.png</file>
|
<file>resources/bttn-plane-down.png</file>
|
||||||
<file>resources/bttn-plane-over.png</file>
|
<file>resources/bttn-plane-over.png</file>
|
||||||
<file>resources/bttn-plane-up.png</file>
|
<file>resources/bttn-plane-up.png</file>
|
||||||
<file>resources/bttn-ESC-down.png</file>
|
<file>resources/bttn-esc-down.png</file>
|
||||||
<file>resources/bttn-ESC-up.png</file>
|
<file>resources/bttn-esc-up.png</file>
|
||||||
<file>resources/bttn-ppm-down.png</file>
|
<file>resources/bttn-ppm-down.png</file>
|
||||||
<file>resources/bttn-ppm-up.png</file>
|
<file>resources/bttn-ppm-up.png</file>
|
||||||
<file>resources/bttn-pwm-down.png</file>
|
<file>resources/bttn-pwm-down.png</file>
|
||||||
@ -52,8 +52,22 @@
|
|||||||
<file>resources/bttn-upgrade-up.png</file>
|
<file>resources/bttn-upgrade-up.png</file>
|
||||||
<file>resources/not-connected.png</file>
|
<file>resources/not-connected.png</file>
|
||||||
<file>resources/connected.png</file>
|
<file>resources/connected.png</file>
|
||||||
|
<file>resources/bttn-esc300-dwn.png</file>
|
||||||
|
<file>resources/bttn-esc300-up.png</file>
|
||||||
<file>resources/bttn-oneshot-dwn.png</file>
|
<file>resources/bttn-oneshot-dwn.png</file>
|
||||||
<file>resources/bttn-oneshot-up.png</file>
|
<file>resources/bttn-oneshot-up.png</file>
|
||||||
|
<file>resources/bttn-oneshot125-dwn.png</file>
|
||||||
|
<file>resources/bttn-oneshot125-up.png</file>
|
||||||
|
<file>resources/bttn-oneshot42-dwn.png</file>
|
||||||
|
<file>resources/bttn-oneshot42-up.png</file>
|
||||||
|
<file>resources/bttn-multishot-dwn.png</file>
|
||||||
|
<file>resources/bttn-multishot-up.png</file>
|
||||||
|
<file>resources/bttn-dshot150-dwn.png</file>
|
||||||
|
<file>resources/bttn-dshot150-up.png</file>
|
||||||
|
<file>resources/bttn-dshot600-dwn.png</file>
|
||||||
|
<file>resources/bttn-dshot600-up.png</file>
|
||||||
|
<file>resources/bttn-dshot1200-dwn.png</file>
|
||||||
|
<file>resources/bttn-dshot1200-up.png</file>
|
||||||
<file>resources/bttn-srxl-down.png</file>
|
<file>resources/bttn-srxl-down.png</file>
|
||||||
<file>resources/bttn-srxl-up.png</file>
|
<file>resources/bttn-srxl-up.png</file>
|
||||||
<file>resources/bttn-hott-down.png</file>
|
<file>resources/bttn-hott-down.png</file>
|
||||||
|