From 9cb5c21f236d6077cc6f887ee7c75d3a31468728 Mon Sep 17 00:00:00 2001 From: Fredrik Larson Date: Sun, 28 Sep 2014 13:01:36 +1000 Subject: [PATCH 01/10] test on summary page, inform users to not coneect battery yet --- .../src/plugins/setupwizard/pages/summarypage.ui | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/summarypage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/summarypage.ui index f318aafe3..5e46b1a45 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/summarypage.ui +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/summarypage.ui @@ -20,14 +20,13 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:12pt; font-weight:600;">OpenPilot Configuration Summary</span></p> -<p style="-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;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">The first part of this wizard is now complete. All information required to create a basic OpenPilot controller configuration for a specific vehicle has been collected.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Below is a summary of the configuration and a button that links to a diagram illustrating how to connect required hardware and the OpenPilot Controller with the current configuration.</span></p> -<p style="-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;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">To continue the wizard and go through some basic configuration steps, please continue to the next step of this wizard.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">The following steps require that your OpenPilot controller is set up according to the diagram, it is </span><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:600;">connected to the computer</span><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;"> by USB, and that the vehicle is</span><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:600;"> powered by a battery</span><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">.</span></p></body></html> +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">OpenPilot Configuration Summary</span></p> +<p style="-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;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">The first part of this wizard is now complete. All information required to create a basic OpenPilot controller configuration for a specific vehicle has been collected.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Below is a summary of the configuration and a button that links to a diagram illustrating how to connect required hardware and the OpenPilot Controller with the current configuration.</span></p> +<p style="-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;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">The following steps require that your OpenPilot controller is connected according to the diagram, remians connected to the computer by USB, and that you have a battery ready but </span><span style=" font-size:10pt; font-weight:600;">do not</span><span style=" font-size:10pt;"> connect it right now, you will be told when to in later steps of this wizard.</span></p></body></html> Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop From f487ed385293720e89b3128a1e5d382c5a499ef5 Mon Sep 17 00:00:00 2001 From: Fredrik Larson Date: Sun, 28 Sep 2014 15:05:17 +1000 Subject: [PATCH 02/10] Start on ESC Calib page --- .../setupwizard/pages/esccalibrationpage.cpp | 131 ++++++++++++++++++ .../setupwizard/pages/esccalibrationpage.h | 63 +++++++++ .../setupwizard/pages/esccalibrationpage.ui | 73 ++++++++++ 3 files changed, 267 insertions(+) create mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp create mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h create mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp new file mode 100644 index 000000000..766d1aa75 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp @@ -0,0 +1,131 @@ +/** + ****************************************************************************** + * + * @file EscCalibrationPage.cpp + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2014. + * @addtogroup + * @{ + * @addtogroup EscCalibrationPage + * @{ + * @brief + *****************************************************************************/ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include "esccalibrationpage.h" +#include "ui_esccalibrationpage.h" +#include "setupwizard.h" + +EscCalibrationPage::EscCalibrationPage(SetupWizard *wizard, QWidget *parent) : + AbstractWizardPage(wizard, parent), + ui(new Ui::EscCalibrationPage), m_calibrationUtil(0) +{ + ui->setupUi(this); + connect(ui->levelButton, SIGNAL(clicked()), this, SLOT(performCalibration())); +} + +EscCalibrationPage::~EscCalibrationPage() +{ + delete ui; +} + +bool EscCalibrationPage::validatePage() +{ + return true; +} + +bool EscCalibrationPage::isComplete() const +{ + return ui->levelButton->isEnabled(); +} + +void EscCalibrationPage::enableButtons(bool enable) +{ + ui->levelButton->setEnabled(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::performCalibration() +{ + if (!getWizard()->getConnectionManager()->isConnected()) { + QMessageBox msgBox; + msgBox.setText(tr("An OpenPilot controller must be connected to your computer to perform bias " + "calculations.\nPlease connect your OpenPilot controller to your computer and try again.")); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.setDefaultButton(QMessageBox::Ok); + msgBox.exec(); + return; + } + + enableButtons(false); + ui->progressLabel->setText(QString(tr("Retrieving data..."))); + + + if (!m_calibrationUtil) { + m_calibrationUtil = new BiasCalibrationUtil(BIAS_CYCLES, BIAS_RATE); + } + + connect(m_calibrationUtil, SIGNAL(progress(long, long)), this, SLOT(calibrationProgress(long, long))); + connect(m_calibrationUtil, SIGNAL(done(accelGyroBias)), this, SLOT(calibrationDone(accelGyroBias))); + connect(m_calibrationUtil, SIGNAL(timeout(QString)), this, SLOT(calibrationTimeout(QString))); + + m_calibrationUtil->start(); +} + +void EscCalibrationPage::calibrationProgress(long current, long total) +{ + if (ui->levellinProgressBar->maximum() != (int)total) { + ui->levellinProgressBar->setMaximum((int)total); + } + if (ui->levellinProgressBar->value() != (int)current) { + ui->levellinProgressBar->setValue((int)current); + } +} + +void EscCalibrationPage::calibrationDone(accelGyroBias bias) +{ + stopCalibration(); + getWizard()->setLevellingBias(bias); + emit completeChanged(); +} + +void EscCalibrationPage::calibrationTimeout(QString message) +{ + stopCalibration(); + + QMessageBox msgBox; + msgBox.setText(message); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.setDefaultButton(QMessageBox::Ok); + msgBox.exec(); +} + +void EscCalibrationPage::stopCalibration() +{ + if (m_calibrationUtil) { + disconnect(m_calibrationUtil, SIGNAL(progress(long, long)), this, SLOT(calibrationProgress(long, long))); + disconnect(m_calibrationUtil, SIGNAL(done(accelGyroBias)), this, SLOT(calibrationDone(accelGyroBias))); + disconnect(m_calibrationUtil, SIGNAL(timeout(QString)), this, SLOT(calibrationTimeout(QString))); + ui->progressLabel->setText(QString(tr("Done!"))); + enableButtons(true); + } +} diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h new file mode 100644 index 000000000..5c1a55f11 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h @@ -0,0 +1,63 @@ +/** + ****************************************************************************** + * + * @file biascalibrationpage.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @addtogroup + * @{ + * @addtogroup BiasCalibrationPage + * @{ + * @brief + *****************************************************************************/ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef ESCCALIBRATIONPAGE_H +#define ESCCALIBRATIONPAGE_H + +#include "abstractwizardpage.h" + +namespace Ui { +class EscCalibrationPage; +} + +class EscCalibrationPage : public AbstractWizardPage { + Q_OBJECT + +public: + explicit EscCalibrationPage(SetupWizard *wizard, QWidget *parent = 0); + ~EscCalibrationPage(); + bool validatePage(); + bool isComplete() const; + +private slots: + void performCalibration(); + void calibrationProgress(long current, long total); + void calibrationDone(accelGyroBias bias); + void calibrationTimeout(QString message); + +private: + static const int BIAS_CYCLES = 200; + static const int BIAS_RATE = 50; + + Ui::EscCalibrationPage *ui; + BiasCalibrationUtil *m_calibrationUtil; + + void stopCalibration(); + void enableButtons(bool enable); +}; + +#endif // ESCCALIBRATIONPAGE_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui new file mode 100644 index 000000000..e00a9fe94 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui @@ -0,0 +1,73 @@ + + + BiasCalibrationPage + + + + 0 + 0 + 600 + 400 + + + + WizardPage + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">OpenPilot ESC Calibration Procedure</span></p> +<p style="-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;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">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 from the flight controller. </span></p> +<p style="-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;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">This part of the wizard will tell you to connect the battery to your aircraft, before doing so you </span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt;">absolutely must </span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt; font-weight:600; color:#ff0000;">remove the props from all motors</span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt;">.</span> </p> +<p style="-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;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">The steps to perform this calibration are as follows:</span></p> +<p style="-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;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">1. Press the start button on this page </span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">2. Connect the battery to your airframe</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">3. Wait for 2 seconds after the ESC beeps stop </span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">4. Press the stop button on this page</span></p> +<p style="-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;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">When ready push the start button below.</span></p></body></html> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + + From c643abf4fb8da929e2b3ad42d0fd9ebb22409008 Mon Sep 17 00:00:00 2001 From: Fredrik Larson Date: Sun, 28 Sep 2014 15:11:40 +1000 Subject: [PATCH 03/10] Add files to the .pro --- .../setupwizard/pages/esccalibrationpage.cpp | 87 +------------------ .../setupwizard/pages/esccalibrationpage.h | 16 +--- .../src/plugins/setupwizard/setupwizard.pro | 3 + 3 files changed, 7 insertions(+), 99 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp index 766d1aa75..a2c6b29f0 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp @@ -25,18 +25,16 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include + #include "esccalibrationpage.h" #include "ui_esccalibrationpage.h" #include "setupwizard.h" EscCalibrationPage::EscCalibrationPage(SetupWizard *wizard, QWidget *parent) : AbstractWizardPage(wizard, parent), - ui(new Ui::EscCalibrationPage), m_calibrationUtil(0) + ui(new Ui::EscCalibrationPage) { ui->setupUi(this); - connect(ui->levelButton, SIGNAL(clicked()), this, SLOT(performCalibration())); } EscCalibrationPage::~EscCalibrationPage() @@ -48,84 +46,3 @@ bool EscCalibrationPage::validatePage() { return true; } - -bool EscCalibrationPage::isComplete() const -{ - return ui->levelButton->isEnabled(); -} - -void EscCalibrationPage::enableButtons(bool enable) -{ - ui->levelButton->setEnabled(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::performCalibration() -{ - if (!getWizard()->getConnectionManager()->isConnected()) { - QMessageBox msgBox; - msgBox.setText(tr("An OpenPilot controller must be connected to your computer to perform bias " - "calculations.\nPlease connect your OpenPilot controller to your computer and try again.")); - msgBox.setStandardButtons(QMessageBox::Ok); - msgBox.setDefaultButton(QMessageBox::Ok); - msgBox.exec(); - return; - } - - enableButtons(false); - ui->progressLabel->setText(QString(tr("Retrieving data..."))); - - - if (!m_calibrationUtil) { - m_calibrationUtil = new BiasCalibrationUtil(BIAS_CYCLES, BIAS_RATE); - } - - connect(m_calibrationUtil, SIGNAL(progress(long, long)), this, SLOT(calibrationProgress(long, long))); - connect(m_calibrationUtil, SIGNAL(done(accelGyroBias)), this, SLOT(calibrationDone(accelGyroBias))); - connect(m_calibrationUtil, SIGNAL(timeout(QString)), this, SLOT(calibrationTimeout(QString))); - - m_calibrationUtil->start(); -} - -void EscCalibrationPage::calibrationProgress(long current, long total) -{ - if (ui->levellinProgressBar->maximum() != (int)total) { - ui->levellinProgressBar->setMaximum((int)total); - } - if (ui->levellinProgressBar->value() != (int)current) { - ui->levellinProgressBar->setValue((int)current); - } -} - -void EscCalibrationPage::calibrationDone(accelGyroBias bias) -{ - stopCalibration(); - getWizard()->setLevellingBias(bias); - emit completeChanged(); -} - -void EscCalibrationPage::calibrationTimeout(QString message) -{ - stopCalibration(); - - QMessageBox msgBox; - msgBox.setText(message); - msgBox.setStandardButtons(QMessageBox::Ok); - msgBox.setDefaultButton(QMessageBox::Ok); - msgBox.exec(); -} - -void EscCalibrationPage::stopCalibration() -{ - if (m_calibrationUtil) { - disconnect(m_calibrationUtil, SIGNAL(progress(long, long)), this, SLOT(calibrationProgress(long, long))); - disconnect(m_calibrationUtil, SIGNAL(done(accelGyroBias)), this, SLOT(calibrationDone(accelGyroBias))); - disconnect(m_calibrationUtil, SIGNAL(timeout(QString)), this, SLOT(calibrationTimeout(QString))); - ui->progressLabel->setText(QString(tr("Done!"))); - enableButtons(true); - } -} diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h index 5c1a55f11..c546270ba 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h @@ -25,6 +25,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + #ifndef ESCCALIBRATIONPAGE_H #define ESCCALIBRATIONPAGE_H @@ -41,23 +43,9 @@ public: explicit EscCalibrationPage(SetupWizard *wizard, QWidget *parent = 0); ~EscCalibrationPage(); bool validatePage(); - bool isComplete() const; - -private slots: - void performCalibration(); - void calibrationProgress(long current, long total); - void calibrationDone(accelGyroBias bias); - void calibrationTimeout(QString message); private: - static const int BIAS_CYCLES = 200; - static const int BIAS_RATE = 50; - Ui::EscCalibrationPage *ui; - BiasCalibrationUtil *m_calibrationUtil; - - void stopCalibration(); - void enableButtons(bool enable); }; #endif // ESCCALIBRATIONPAGE_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro index d6990971b..6dee3e178 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro @@ -36,6 +36,7 @@ HEADERS += setupwizardplugin.h \ pages/autoupdatepage.h \ pages/revocalibrationpage.h \ biascalibrationutil.h \ + pages/esccalibrationpage.h \ pages/biascalibrationpage.h \ pages/escpage.h \ pages/servopage.h \ @@ -70,6 +71,7 @@ SOURCES += setupwizardplugin.cpp \ pages/revocalibrationpage.cpp \ biascalibrationutil.cpp \ pages/biascalibrationpage.cpp \ + pages/esccalibrationpage.cpp \ pages/escpage.cpp \ pages/servopage.cpp \ pages/selectionpage.cpp \ @@ -95,6 +97,7 @@ FORMS += \ pages/autoupdatepage.ui \ pages/revocalibrationpage.ui \ pages/biascalibrationpage.ui \ + pages/esccalibrationpage.ui \ pages/escpage.ui \ pages/servopage.ui \ pages/selectionpage.ui \ From 488a359d85ffc47293c1a81ed7d65fa4b7bdb8e1 Mon Sep 17 00:00:00 2001 From: Fredrik Larson Date: Sun, 28 Sep 2014 22:46:01 +1000 Subject: [PATCH 04/10] add the page --- .../src/plugins/setupwizard/pages/esccalibrationpage.cpp | 1 + .../src/plugins/setupwizard/pages/esccalibrationpage.h | 1 - .../src/plugins/setupwizard/pages/esccalibrationpage.ui | 8 +++----- .../openpilotgcs/src/plugins/setupwizard/setupwizard.cpp | 5 +++++ ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp index a2c6b29f0..bd66d55b9 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp @@ -32,6 +32,7 @@ EscCalibrationPage::EscCalibrationPage(SetupWizard *wizard, QWidget *parent) : AbstractWizardPage(wizard, parent), + ui(new Ui::EscCalibrationPage) { ui->setupUi(this); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h index c546270ba..f1dd57f0d 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h @@ -26,7 +26,6 @@ */ - #ifndef ESCCALIBRATIONPAGE_H #define ESCCALIBRATIONPAGE_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui index e00a9fe94..e87e9113c 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui @@ -1,7 +1,7 @@ - BiasCalibrationPage - + EscCalibrationPage + 0 @@ -66,8 +66,6 @@ p, li { white-space: pre-wrap; } - - - + diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp index f19c6fd51..dbcc9b534 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp @@ -40,6 +40,7 @@ #include "pages/escpage.h" #include "pages/servopage.h" #include "pages/biascalibrationpage.h" +#include "pages/esccalibrationpage.h" #include "pages/summarypage.h" #include "pages/savepage.h" #include "pages/notyetimplementedpage.h" @@ -167,6 +168,9 @@ int SetupWizard::nextId() const } case PAGE_BIAS_CALIBRATION: + return PAGE_ESC_CALIBRATION; + + case PAGE_ESC_CALIBRATION: return PAGE_OUTPUT_CALIBRATION; case PAGE_OUTPUT_CALIBRATION: @@ -441,6 +445,7 @@ void SetupWizard::createPages() setPage(PAGE_ESC, new EscPage(this)); setPage(PAGE_SERVO, new ServoPage(this)); setPage(PAGE_BIAS_CALIBRATION, new BiasCalibrationPage(this)); + setPage(PAGE_ESC_CALIBRATION, new EscCalibrationPage(this)); setPage(PAGE_OUTPUT_CALIBRATION, new OutputCalibrationPage(this)); setPage(PAGE_SUMMARY, new SummaryPage(this)); setPage(PAGE_SAVE, new SavePage(this)); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h index 894710ab9..3a641d54d 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h @@ -186,7 +186,7 @@ private slots: private: enum { PAGE_START, PAGE_CONTROLLER, PAGE_VEHICLES, PAGE_MULTI, PAGE_FIXEDWING, PAGE_AIRSPEED, PAGE_GPS, PAGE_HELI, PAGE_SURFACE, PAGE_INPUT, PAGE_ESC, PAGE_SERVO, - PAGE_BIAS_CALIBRATION, PAGE_REVO_CALIBRATION, PAGE_OUTPUT_CALIBRATION, + PAGE_BIAS_CALIBRATION, PAGE_ESC_CALIBRATION, PAGE_REVO_CALIBRATION, PAGE_OUTPUT_CALIBRATION, PAGE_SAVE, PAGE_SUMMARY, PAGE_NOTYETIMPLEMENTED, PAGE_AIRFRAME_INITIAL_TUNING, PAGE_REBOOT, PAGE_END, PAGE_UPDATE }; void createPages(); From ee2735713215a823e3a28a9d9f15193dd5d7402d Mon Sep 17 00:00:00 2001 From: Fredrik Larson Date: Sun, 28 Sep 2014 23:25:39 +1000 Subject: [PATCH 05/10] Only offer ESC calibration if ESC type and airframe type is correct --- .../src/plugins/setupwizard/pages/esccalibrationpage.ui | 2 +- ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui index e87e9113c..f864218a4 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui @@ -23,7 +23,7 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;"> <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">OpenPilot ESC Calibration Procedure</span></p> <p style="-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;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">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 from the flight controller. </span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">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. </span></p> <p style="-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;"><br /></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">This part of the wizard will tell you to connect the battery to your aircraft, before doing so you </span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt;">absolutely must </span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt; font-weight:600; color:#ff0000;">remove the props from all motors</span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt;">.</span> </p> <p style="-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;"><br /></p> diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp index dbcc9b534..9d18b1c91 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp @@ -168,7 +168,11 @@ int SetupWizard::nextId() const } case PAGE_BIAS_CALIBRATION: - return PAGE_ESC_CALIBRATION; + if (getVehicleType() == VEHICLE_MULTI && getEscType() == ESC_RAPID){ + return PAGE_ESC_CALIBRATION; + } else { + PAGE_OUTPUT_CALIBRATION; + } case PAGE_ESC_CALIBRATION: return PAGE_OUTPUT_CALIBRATION; From 9f8e0c0f05f4675ec2f68a7918d58d5ba52a5fd7 Mon Sep 17 00:00:00 2001 From: m_thread Date: Tue, 30 Sep 2014 00:39:51 +0200 Subject: [PATCH 06/10] OP-1512 Added ESC calibration implementation. Fixed some minor issues. --- .../cfg_vehicletypes/configfixedwingwidget.h | 1 - .../src/plugins/config/configoutputwidget.cpp | 6 +- .../config/configstabilizationwidget.cpp | 1 + .../pages/airframeinitialtuningpage.cpp | 2 +- .../setupwizard/pages/esccalibrationpage.cpp | 56 +++++++++- .../setupwizard/pages/esccalibrationpage.h | 10 ++ .../setupwizard/pages/esccalibrationpage.ui | 103 ++++++++++++++---- .../src/plugins/setupwizard/setupwizard.cpp | 4 +- .../vehicleconfigurationhelper.cpp | 51 ++++----- .../setupwizard/vehicleconfigurationhelper.h | 16 +-- 10 files changed, 182 insertions(+), 68 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configfixedwingwidget.h b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configfixedwingwidget.h index 1821190c0..5e25d99d3 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configfixedwingwidget.h +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configfixedwingwidget.h @@ -71,7 +71,6 @@ protected: private slots: virtual void setupUI(QString airframeType); virtual bool throwConfigError(QString airframeType); - }; #endif // CONFIGFIXEDWINGWIDGET_H diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index 3cd43c4a3..5c5da9c6f 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -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) { diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp index e8dbadbee..9c8af326d 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp @@ -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))); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp index a8fcb3dca..60dad2b28 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp @@ -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; } diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp index bd66d55b9..a1eeb4cac 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp @@ -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(); + 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); + } +} diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h index f1dd57f0d..8f211d2b0 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h @@ -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 m_outputs; }; #endif // ESCCALIBRATIONPAGE_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui index f864218a4..9a58a8eb5 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui @@ -7,7 +7,7 @@ 0 0 600 - 400 + 500 @@ -20,21 +20,23 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;"> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">OpenPilot ESC Calibration Procedure</span></p> -<p style="-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;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">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. </span></p> -<p style="-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;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">This part of the wizard will tell you to connect the battery to your aircraft, before doing so you </span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt;">absolutely must </span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt; font-weight:600; color:#ff0000;">remove the props from all motors</span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt;">.</span> </p> -<p style="-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;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">The steps to perform this calibration are as follows:</span></p> -<p style="-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;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">1. Press the start button on this page </span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">2. Connect the battery to your airframe</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">3. Wait for 2 seconds after the ESC beeps stop </span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">4. Press the stop button on this page</span></p> -<p style="-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;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">When ready push the start button below.</span></p></body></html> +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:12pt; font-weight:600;">OpenPilot ESC Calibration Procedure</span></p> +<p style="-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;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">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. </span></p> +<p style="-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;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">This part of the wizard will tell you to connect the battery to your aircraft, before doing so you </span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt;">absolutely must </span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt; font-weight:600; color:#ff0000;">remove the propellers from all motors</span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt;">.</span><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> </span></p> +<p style="-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;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">The steps to perform this calibration are as follows:</span></p> +<p style="-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;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">1. Press the Start button on this page </span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">2. Connect the battery to your airframe</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">3. Wait for ESC calibration beep(s)</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">4. Press the Stop button on this page</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">5. Wait for ESC confirmation beep(s)</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">6. Disconnect battery</span></p> +<p style="-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;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">When ready push the start button below.</span></p></body></html> Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop @@ -44,6 +46,68 @@ p, li { white-space: pre-wrap; } + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 20 + + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Start + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + @@ -57,13 +121,6 @@ p, li { white-space: pre-wrap; } - - - - - - - diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp index 9d18b1c91..ab6861823 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp @@ -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: diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index f8e7c29a7..33dda353b 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -44,11 +44,6 @@ #include #include -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; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h index 750697a41..34ab3ab20 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h @@ -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; From 9872a95bc37e9ed3f91ad81a07cb5c198382ed6f Mon Sep 17 00:00:00 2001 From: m_thread Date: Tue, 30 Sep 2014 20:40:54 +0200 Subject: [PATCH 07/10] OP-1512 Fixed issues found in review. --- .../setupwizard/pages/esccalibrationpage.cpp | 9 +++++---- .../setupwizard/pages/esccalibrationpage.h | 4 ++-- .../setupwizard/vehicleconfigurationhelper.cpp | 16 ++++++++-------- .../setupwizard/vehicleconfigurationhelper.h | 10 +++++----- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp index a1eeb4cac..3428fb794 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp @@ -33,6 +33,7 @@ #include "extensionsystem/pluginmanager.h" #include "uavobjectmanager.h" #include "vehicleconfigurationhelper.h" +#include "actuatorsettings.h" EscCalibrationPage::EscCalibrationPage(SetupWizard *wizard, QWidget *parent) : AbstractWizardPage(wizard, parent), @@ -73,13 +74,13 @@ void EscCalibrationPage::startStopButtonClicked() MixerSettings *mSettings = MixerSettings::GetInstance(uavoManager); Q_ASSERT(mSettings); QString mixerTypePattern = "Mixer%1Type"; - for (int i = 0; i < 12; i++) { + for (int i = 0; i < ActuatorSettings::CHANNELADDR_NUMELEM; 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); + output->startChannelOutput(i, LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS); + output->setChannelOutputValue(HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS); m_outputs << output; } } @@ -94,7 +95,7 @@ void EscCalibrationPage::startStopButtonClicked() } m_outputs.clear(); m_isCalibrating = false; - ui->startStopButton->setText("Start"); + ui->startStopButton->setText(tr("Start")); ui->startStopButton->setEnabled(true); enableButtons(true); } diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h index 8f211d2b0..6f4657fab 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.h @@ -49,8 +49,8 @@ private slots: void enableButtons(bool enable); private: - const int LOW_OUTPUT_VALUE = 1000; - const int HIGH_OUTPUT_VALUE = 2000; + const int LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 1000; + const int HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 2000; Ui::EscCalibrationPage *ui; bool m_isCalibrating; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index 33dda353b..d82ceaedc 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -333,26 +333,26 @@ void VehicleConfigurationHelper::applyActuatorConfiguration() { ActuatorSettings *actSettings = ActuatorSettings::GetInstance(m_uavoManager); - qint16 escFrequence = LEGACY_ESC_FREQUENCE; + qint16 escFrequence = LEGACY_ESC_FREQUENCY; switch (m_configSource->getEscType()) { case VehicleConfigurationSource::ESC_STANDARD: - escFrequence = LEGACY_ESC_FREQUENCE; + escFrequence = LEGACY_ESC_FREQUENCY; break; case VehicleConfigurationSource::ESC_RAPID: - escFrequence = RAPID_ESC_FREQUENCE; + escFrequence = RAPID_ESC_FREQUENCY; break; default: break; } - qint16 servoFrequence = ANALOG_SERVO_FREQUENCE; + qint16 servoFrequence = ANALOG_SERVO_FREQUENCY; switch (m_configSource->getServoType()) { case VehicleConfigurationSource::SERVO_ANALOG: - servoFrequence = ANALOG_SERVO_FREQUENCE; + servoFrequence = ANALOG_SERVO_FREQUENCY; break; case VehicleConfigurationSource::SERVO_DIGITAL: - servoFrequence = DIGITAL_SERVO_FREQUENCE; + servoFrequence = DIGITAL_SERVO_FREQUENCY; break; default: break; @@ -375,7 +375,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration() data.MotorsSpinWhileArmed = ActuatorSettings::MOTORSSPINWHILEARMED_FALSE; for (quint16 i = 0; i < ActuatorSettings::CHANNELUPDATEFREQ_NUMELEM; i++) { - data.ChannelUpdateFreq[i] = LEGACY_ESC_FREQUENCE; + data.ChannelUpdateFreq[i] = LEGACY_ESC_FREQUENCY; } switch (m_configSource->getVehicleSubType()) { @@ -592,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 < 12; i++) { + for (int i = 0; i < ActuatorSettings::CHANNELADDR_NUMELEM; i++) { UAVObjectField *field = mSettings->getField(mixerTypePattern.arg(i + 1)); Q_ASSERT(field); field->setValue(field->getOptions().at(channels[i].type)); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h index 34ab3ab20..1c857ee77 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h @@ -57,11 +57,11 @@ public: VehicleConfigurationHelper(VehicleConfigurationSource *configSource); bool setupVehicle(bool save = true); bool setupHardwareSettings(bool save = true); - 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 qint16 LEGACY_ESC_FREQUENCY = 50; + static const qint16 RAPID_ESC_FREQUENCY = 500; + 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_MOTOR = 1; static const int MIXER_TYPE_REVERSABLEMOTOR = 2; static const int MIXER_TYPE_SERVO = 3; From be4ae80696f7d1ffa008549e04dd4cf24e2328e3 Mon Sep 17 00:00:00 2001 From: m_thread Date: Tue, 30 Sep 2014 20:48:20 +0200 Subject: [PATCH 08/10] OP-1512 Fixed some magic numbers... --- .../src/plugins/setupwizard/vehicleconfigurationhelper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index d82ceaedc..1e103b9d5 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -935,7 +935,7 @@ void VehicleConfigurationHelper::setupTriCopter() // 2. Setup GUI data // 3. Apply changes - mixerChannelSettings channels[12]; + mixerChannelSettings channels[ActuatorSettings::CHANNELADDR_NUMELEM]; GUIConfigDataUnion guiSettings = getGUIConfigData(); channels[0].type = MIXER_TYPE_MOTOR; @@ -988,7 +988,7 @@ GUIConfigDataUnion VehicleConfigurationHelper::getGUIConfigData() void VehicleConfigurationHelper::setupQuadCopter() { - mixerChannelSettings channels[12]; + mixerChannelSettings channels[ActuatorSettings::CHANNELADDR_NUMELEM]; GUIConfigDataUnion guiSettings = getGUIConfigData(); SystemSettings::AirframeTypeOptions frame = SystemSettings::AIRFRAMETYPE_QUADX; @@ -1116,7 +1116,7 @@ void VehicleConfigurationHelper::setupQuadCopter() void VehicleConfigurationHelper::setupHexaCopter() { - mixerChannelSettings channels[12]; + mixerChannelSettings channels[ActuatorSettings::CHANNELADDR_NUMELEM]; GUIConfigDataUnion guiSettings = getGUIConfigData(); SystemSettings::AirframeTypeOptions frame = SystemSettings::AIRFRAMETYPE_HEXA; From 1a406d00d4a085b3534fab687656f24e5b12719c Mon Sep 17 00:00:00 2001 From: m_thread Date: Tue, 30 Sep 2014 22:09:41 +0200 Subject: [PATCH 09/10] OP-1512 Simplified HTML text --- .../setupwizard/pages/esccalibrationpage.ui | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui index 9a58a8eb5..a431ed0cd 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.ui @@ -17,26 +17,7 @@ - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:12pt; font-weight:600;">OpenPilot ESC Calibration Procedure</span></p> -<p style="-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;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">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. </span></p> -<p style="-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;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">This part of the wizard will tell you to connect the battery to your aircraft, before doing so you </span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt;">absolutely must </span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt; font-weight:600; color:#ff0000;">remove the propellers from all motors</span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:10pt;">.</span><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> </span></p> -<p style="-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;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">The steps to perform this calibration are as follows:</span></p> -<p style="-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;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">1. Press the Start button on this page </span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">2. Connect the battery to your airframe</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">3. Wait for ESC calibration beep(s)</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">4. Press the Stop button on this page</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">5. Wait for ESC confirmation beep(s)</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">6. Disconnect battery</span></p> -<p style="-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;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">When ready push the start button below.</span></p></body></html> + <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:600;">OpenPilot ESC Calibration Procedure</span></p><p><span style=" font-size:10pt;">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. </span></p><p><span style=" font-size:10pt;">This part of the wizard will tell you to connect the battery to your aircraft, before doing so you absolutely </span><span style=" font-size:10pt; font-weight:600; color:#f30f1d;">must remove the propellers from all motors</span><span style=" font-size:10pt;">. </span></p><p><span style=" font-size:10pt;">The steps to perform this calibration are as follows:</span></p><p><span style=" font-size:10pt;">1. Press the Start button on this page <br/>2. Connect the battery to your airframe<br/>3. Wait for ESC calibration beep(s)<br/>4. Press the Stop button on this page<br/>5. Wait for ESC confirmation beep(s)<br/>6. Disconnect battery</span></p><p><span style=" font-size:10pt;">When ready push the start button below.</span></p></body></html> Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop From 7c2968e7ef0534c7d01b7054bb934566d19e5d41 Mon Sep 17 00:00:00 2001 From: m_thread Date: Tue, 30 Sep 2014 22:27:34 +0200 Subject: [PATCH 10/10] OP-1512 Use QuadX as default muti vehicle. --- ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.cpp index d1bd8c798..ec1aae395 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.cpp @@ -38,6 +38,7 @@ MultiPage::~MultiPage() void MultiPage::initializePage(VehicleConfigurationSource *settings) { Q_UNUSED(settings); + setSelectedItem(SetupWizard::MULTI_ROTOR_QUAD_X); } bool MultiPage::validatePage(SelectionItem *selectedItem)