1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-16 08:29:15 +01:00

OP-1512 Added ESC calibration implementation.

Fixed some minor issues.
This commit is contained in:
m_thread 2014-09-30 00:39:51 +02:00
parent ee27357132
commit 9f8e0c0f05
10 changed files with 182 additions and 68 deletions

View File

@ -71,7 +71,6 @@ protected:
private slots:
virtual void setupUI(QString airframeType);
virtual bool throwConfigError(QString airframeType);
};
#endif // CONFIGFIXEDWINGWIDGET_H

View File

@ -148,7 +148,8 @@ void ConfigOutputWidget::runChannelTests(bool state)
if (state && systemAlarms.Alarm[SystemAlarms::ALARM_ACTUATOR] != SystemAlarms::ALARM_OK) {
QMessageBox mbox;
mbox.setText(QString(tr("The actuator module is in an error state. This can also occur because there are no inputs. Please fix these before testing outputs.")));
mbox.setText(QString(tr("The actuator module is in an error state. This can also occur because there are no inputs. "
"Please fix these before testing outputs.")));
mbox.setStandardButtons(QMessageBox::Ok);
mbox.exec();
@ -162,7 +163,8 @@ void ConfigOutputWidget::runChannelTests(bool state)
// Confirm this is definitely what they want
if (state) {
QMessageBox mbox;
mbox.setText(QString(tr("This option will start your motors by the amount selected on the sliders regardless of transmitter. It is recommended to remove any blades from motors. Are you sure you want to do this?")));
mbox.setText(QString(tr("This option will start your motors by the amount selected on the sliders regardless of transmitter."
"It is recommended to remove any blades from motors. Are you sure you want to do this?")));
mbox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
int retval = mbox.exec();
if (retval != QMessageBox::Yes) {

View File

@ -344,6 +344,7 @@ void ConfigStabilizationWidget::onBoardConnected()
void ConfigStabilizationWidget::pidBankChanged(int index)
{
bool dirty = isDirty();
updateObjectFromThrottleCurve();
foreach(QTabBar * tabBar, m_pidTabBars) {
disconnect(tabBar, SIGNAL(currentChanged(int)), this, SLOT(pidBankChanged(int)));

View File

@ -85,7 +85,7 @@ bool AirframeInitialTuningPage::validatePage()
if (getWizard()->getVehicleTemplate() != NULL) {
delete getWizard()->getVehicleTemplate();
}
getWizard()->setVehicleTemplate(new QJsonObject(*templ));
getWizard()->setVehicleTemplate(templ != NULL ? new QJsonObject(*templ) : NULL);
return true;
}

View File

@ -29,13 +29,17 @@
#include "esccalibrationpage.h"
#include "ui_esccalibrationpage.h"
#include "setupwizard.h"
#include "mixersettings.h"
#include "extensionsystem/pluginmanager.h"
#include "uavobjectmanager.h"
#include "vehicleconfigurationhelper.h"
EscCalibrationPage::EscCalibrationPage(SetupWizard *wizard, QWidget *parent) :
AbstractWizardPage(wizard, parent),
ui(new Ui::EscCalibrationPage)
ui(new Ui::EscCalibrationPage), m_isCalibrating(false)
{
ui->setupUi(this);
connect(ui->startStopButton, SIGNAL(clicked()), this, SLOT(startStopButtonClicked()));
}
EscCalibrationPage::~EscCalibrationPage()
@ -47,3 +51,51 @@ bool EscCalibrationPage::validatePage()
{
return true;
}
void EscCalibrationPage::enableButtons(bool enable)
{
getWizard()->button(QWizard::NextButton)->setEnabled(enable);
getWizard()->button(QWizard::CancelButton)->setEnabled(enable);
getWizard()->button(QWizard::BackButton)->setEnabled(enable);
getWizard()->button(QWizard::CustomButton1)->setEnabled(enable);
QApplication::processEvents();
}
void EscCalibrationPage::startStopButtonClicked()
{
if (!m_isCalibrating) {
m_isCalibrating = true;
ui->startStopButton->setEnabled(false);
enableButtons(false);
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectManager *uavoManager = pm->getObject<UAVObjectManager>();
Q_ASSERT(uavoManager);
MixerSettings *mSettings = MixerSettings::GetInstance(uavoManager);
Q_ASSERT(mSettings);
QString mixerTypePattern = "Mixer%1Type";
for (int i = 0; i < 12; i++) {
UAVObjectField *field = mSettings->getField(mixerTypePattern.arg(i + 1));
Q_ASSERT(field);
if (field->getValue().toString() == field->getOptions().at(VehicleConfigurationHelper::MIXER_TYPE_MOTOR)) {
OutputCalibrationUtil *output = new OutputCalibrationUtil();
output->startChannelOutput(i, LOW_OUTPUT_VALUE);
output->setChannelOutputValue(HIGH_OUTPUT_VALUE);
m_outputs << output;
}
}
ui->startStopButton->setText(tr("Stop"));
ui->startStopButton->setEnabled(true);
} else {
m_isCalibrating = false;
ui->startStopButton->setEnabled(false);
foreach(OutputCalibrationUtil * output, m_outputs) {
output->stopChannelOutput();
delete output;
}
m_outputs.clear();
m_isCalibrating = false;
ui->startStopButton->setText("Start");
ui->startStopButton->setEnabled(true);
enableButtons(true);
}
}

View File

@ -30,6 +30,7 @@
#define ESCCALIBRATIONPAGE_H
#include "abstractwizardpage.h"
#include "outputcalibrationutil.h"
namespace Ui {
class EscCalibrationPage;
@ -43,8 +44,17 @@ public:
~EscCalibrationPage();
bool validatePage();
private slots:
void startStopButtonClicked();
void enableButtons(bool enable);
private:
const int LOW_OUTPUT_VALUE = 1000;
const int HIGH_OUTPUT_VALUE = 2000;
Ui::EscCalibrationPage *ui;
bool m_isCalibrating;
QList<OutputCalibrationUtil *> m_outputs;
};
#endif // ESCCALIBRATIONPAGE_H

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>600</width>
<height>400</height>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
@ -20,21 +20,23 @@
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;OpenPilot ESC Calibration Procedure&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt; font-weight:600;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;As you have selected to use a MultiRotor and Fast / Flashed ESCs, we need to calibrate the endpoints of these ESCs so they can see the full throttle range sent from the flight controller. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;This part of the wizard will tell you to connect the battery to your aircraft, before doing so you &lt;/span&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt;&quot;&gt;absolutely must &lt;/span&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt; font-weight:600; color:#ff0000;&quot;&gt;remove the props from all motors&lt;/span&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt;&quot;&gt;.&lt;/span&gt; &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;The steps to perform this calibration are as follows:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;1. Press the start button on this page &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;2. Connect the battery to your airframe&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;3. Wait for 2 seconds after the ESC beeps stop &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;4. Press the stop button on this page&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;When ready push the start button below.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt; font-weight:600;&quot;&gt;OpenPilot ESC Calibration Procedure&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:12pt; font-weight:600;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:10pt;&quot;&gt;As you have selected to use a MultiRotor and Fast / Flashed ESCs, we need to calibrate the endpoints of these ESCs so they can see the full throttle range sent from the flight controller. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:10pt;&quot;&gt;This part of the wizard will tell you to connect the battery to your aircraft, before doing so you &lt;/span&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt;&quot;&gt;absolutely must &lt;/span&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt; font-weight:600; color:#ff0000;&quot;&gt;remove the propellers from all motors&lt;/span&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:10pt;&quot;&gt;The steps to perform this calibration are as follows:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:10pt;&quot;&gt;1. Press the Start button on this page &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:10pt;&quot;&gt;2. Connect the battery to your airframe&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:10pt;&quot;&gt;3. Wait for ESC calibration beep(s)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:10pt;&quot;&gt;4. Press the Stop button on this page&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:10pt;&quot;&gt;5. Wait for ESC confirmation beep(s)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:10pt;&quot;&gt;6. Disconnect battery&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:10pt;&quot;&gt;When ready push the start button below.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
@ -44,6 +46,68 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="topMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="startStopButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Start</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
@ -57,13 +121,6 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="progressLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>

View File

@ -168,10 +168,10 @@ int SetupWizard::nextId() const
}
case PAGE_BIAS_CALIBRATION:
if (getVehicleType() == VEHICLE_MULTI && getEscType() == ESC_RAPID){
if (getVehicleType() == VEHICLE_MULTI && getEscType() == ESC_RAPID) {
return PAGE_ESC_CALIBRATION;
} else {
PAGE_OUTPUT_CALIBRATION;
return PAGE_OUTPUT_CALIBRATION;
}
case PAGE_ESC_CALIBRATION:

View File

@ -44,11 +44,6 @@
#include <QtCore/qmath.h>
#include <QJsonObject>
const qint16 VehicleConfigurationHelper::LEGACY_ESC_FREQUENCE = 50;
const qint16 VehicleConfigurationHelper::RAPID_ESC_FREQUENCE = 400;
const qint16 VehicleConfigurationHelper::ANALOG_SERVO_FREQUENCE = 50;
const qint16 VehicleConfigurationHelper::DIGITAL_SERVO_FREQUENCE = 333;
VehicleConfigurationHelper::VehicleConfigurationHelper(VehicleConfigurationSource *configSource)
: m_configSource(configSource), m_uavoManager(0),
m_transactionOK(false), m_transactionTimeout(false), m_currentTransactionObjectID(-1),
@ -597,7 +592,7 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch
// Set Mixer types and values
QString mixerTypePattern = "Mixer%1Type";
QString mixerVectorPattern = "Mixer%1Vector";
for (int i = 0; i < 10; i++) {
for (int i = 0; i < 12; i++) {
UAVObjectField *field = mSettings->getField(mixerTypePattern.arg(i + 1));
Q_ASSERT(field);
field->setValue(field->getOptions().at(channels[i].type));
@ -627,8 +622,6 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch
}
}
MixerSettings *mixSettings = MixerSettings::GetInstance(m_uavoManager);
// Save mixer values for sliders
switch (m_configSource->getVehicleType()) {
case VehicleConfigurationSource::VEHICLE_MULTI:
@ -638,35 +631,35 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_H:
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_X:
mixSettings->setMixerValueRoll(100);
mixSettings->setMixerValuePitch(100);
mixSettings->setMixerValueYaw(100);
mSettings->setMixerValueRoll(100);
mSettings->setMixerValuePitch(100);
mSettings->setMixerValueYaw(100);
break;
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X:
mixSettings->setMixerValueRoll(50);
mixSettings->setMixerValuePitch(50);
mixSettings->setMixerValueYaw(50);
mSettings->setMixerValueRoll(50);
mSettings->setMixerValuePitch(50);
mSettings->setMixerValueYaw(50);
break;
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
mixSettings->setMixerValueRoll(100);
mixSettings->setMixerValuePitch(100);
mixSettings->setMixerValueYaw(50);
mSettings->setMixerValueRoll(100);
mSettings->setMixerValuePitch(100);
mSettings->setMixerValueYaw(50);
break;
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_H:
mixSettings->setMixerValueRoll(50);
mixSettings->setMixerValuePitch(70);
mixSettings->setMixerValueYaw(50);
mSettings->setMixerValueRoll(50);
mSettings->setMixerValuePitch(70);
mSettings->setMixerValueYaw(50);
break;
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y:
mixSettings->setMixerValueRoll(100);
mixSettings->setMixerValuePitch(50);
mixSettings->setMixerValueYaw(66);
mSettings->setMixerValueRoll(100);
mSettings->setMixerValuePitch(50);
mSettings->setMixerValueYaw(66);
break;
case VehicleConfigurationSource::MULTI_ROTOR_OCTO:
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_X:
mixSettings->setMixerValueRoll(100);
mixSettings->setMixerValuePitch(100);
mixSettings->setMixerValueYaw(100);
mSettings->setMixerValueRoll(100);
mSettings->setMixerValuePitch(100);
mSettings->setMixerValueYaw(100);
break;
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X:
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS:
@ -942,7 +935,7 @@ void VehicleConfigurationHelper::setupTriCopter()
// 2. Setup GUI data
// 3. Apply changes
mixerChannelSettings channels[10];
mixerChannelSettings channels[12];
GUIConfigDataUnion guiSettings = getGUIConfigData();
channels[0].type = MIXER_TYPE_MOTOR;
@ -995,7 +988,7 @@ GUIConfigDataUnion VehicleConfigurationHelper::getGUIConfigData()
void VehicleConfigurationHelper::setupQuadCopter()
{
mixerChannelSettings channels[10];
mixerChannelSettings channels[12];
GUIConfigDataUnion guiSettings = getGUIConfigData();
SystemSettings::AirframeTypeOptions frame = SystemSettings::AIRFRAMETYPE_QUADX;
@ -1123,7 +1116,7 @@ void VehicleConfigurationHelper::setupQuadCopter()
void VehicleConfigurationHelper::setupHexaCopter()
{
mixerChannelSettings channels[10];
mixerChannelSettings channels[12];
GUIConfigDataUnion guiSettings = getGUIConfigData();
SystemSettings::AirframeTypeOptions frame = SystemSettings::AIRFRAMETYPE_HEXA;

View File

@ -57,20 +57,20 @@ public:
VehicleConfigurationHelper(VehicleConfigurationSource *configSource);
bool setupVehicle(bool save = true);
bool setupHardwareSettings(bool save = true);
static const qint16 LEGACY_ESC_FREQUENCE;
static const qint16 RAPID_ESC_FREQUENCE;
static const qint16 ANALOG_SERVO_FREQUENCE;
static const qint16 DIGITAL_SERVO_FREQUENCE;
static const qint16 LEGACY_ESC_FREQUENCE = 50;
static const qint16 RAPID_ESC_FREQUENCE = 400;
static const qint16 ANALOG_SERVO_FREQUENCE = 50;
static const qint16 DIGITAL_SERVO_FREQUENCE = 333;
static const int MIXER_TYPE_DISABLED = 0;
static const int MIXER_TYPE_MOTOR = 1;
static const int MIXER_TYPE_REVERSABLEMOTOR = 2;
static const int MIXER_TYPE_SERVO = 3;
signals:
void saveProgress(int total, int current, QString description);
private:
static const int MIXER_TYPE_DISABLED = 0;
static const int MIXER_TYPE_MOTOR = 1;
static const int MIXER_TYPE_REVERSABLEMOTOR = 2;
static const int MIXER_TYPE_SERVO = 3;
static const float DEFAULT_ENABLED_ACCEL_TAU = 0.1;
VehicleConfigurationSource *m_configSource;