mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Merge remote-tracking branch 'origin/thread/OP-816_Setup_Wizard_Revo_Support' into next
This commit is contained in:
commit
4718e666ee
@ -1,11 +1,11 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file levellingutil.cpp
|
||||
* @file cccalibrationutil.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||
* @addtogroup
|
||||
* @{
|
||||
* @addtogroup LevellingUtil
|
||||
* @addtogroup CCCalibrationUtil
|
||||
* @{
|
||||
* @brief
|
||||
*****************************************************************************/
|
||||
@ -25,7 +25,7 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "levellingutil.h"
|
||||
#include "cccalibrationutil.h"
|
||||
#include "extensionsystem/pluginmanager.h"
|
||||
#include "uavobjectmanager.h"
|
||||
#include "attitudesettings.h"
|
||||
@ -33,20 +33,20 @@
|
||||
#include "gyros.h"
|
||||
|
||||
|
||||
LevellingUtil::LevellingUtil(long measurementCount, long measurementRate) : QObject(),
|
||||
CCCalibrationUtil::CCCalibrationUtil(long measurementCount, long measurementRate) : QObject(),
|
||||
m_isMeasuring(false), m_accelMeasurementCount(measurementCount), m_gyroMeasurementCount(measurementCount),
|
||||
m_accelMeasurementRate(measurementRate), m_gyroMeasurementRate(measurementRate)
|
||||
{
|
||||
}
|
||||
|
||||
LevellingUtil::LevellingUtil(long accelMeasurementCount, long accelMeasurementRate,
|
||||
CCCalibrationUtil::CCCalibrationUtil(long accelMeasurementCount, long accelMeasurementRate,
|
||||
long gyroMeasurementCount, long gyroMeasurementRate) : QObject(),
|
||||
m_isMeasuring(false), m_accelMeasurementCount(accelMeasurementCount), m_gyroMeasurementCount(gyroMeasurementCount),
|
||||
m_accelMeasurementRate(accelMeasurementRate), m_gyroMeasurementRate(gyroMeasurementRate)
|
||||
{
|
||||
}
|
||||
|
||||
void LevellingUtil::start()
|
||||
void CCCalibrationUtil::start()
|
||||
{
|
||||
if(!m_isMeasuring) {
|
||||
startMeasurement();
|
||||
@ -58,15 +58,16 @@ void LevellingUtil::start()
|
||||
}
|
||||
}
|
||||
|
||||
void LevellingUtil::abort()
|
||||
void CCCalibrationUtil::abort()
|
||||
{
|
||||
if(m_isMeasuring) {
|
||||
stopMeasurement();
|
||||
}
|
||||
}
|
||||
|
||||
void LevellingUtil::gyroMeasurementsUpdated(UAVObject *obj)
|
||||
void CCCalibrationUtil::gyroMeasurementsUpdated(UAVObject *obj)
|
||||
{
|
||||
Q_UNUSED(obj);
|
||||
QMutexLocker locker(&m_measurementMutex);
|
||||
|
||||
if(m_receivedGyroUpdates < m_gyroMeasurementCount) {
|
||||
@ -91,8 +92,9 @@ void LevellingUtil::gyroMeasurementsUpdated(UAVObject *obj)
|
||||
}
|
||||
}
|
||||
|
||||
void LevellingUtil::accelMeasurementsUpdated(UAVObject *obj)
|
||||
void CCCalibrationUtil::accelMeasurementsUpdated(UAVObject *obj)
|
||||
{
|
||||
Q_UNUSED(obj);
|
||||
QMutexLocker locker(&m_measurementMutex);
|
||||
|
||||
if(m_receivedAccelUpdates < m_accelMeasurementCount) {
|
||||
@ -117,7 +119,7 @@ void LevellingUtil::accelMeasurementsUpdated(UAVObject *obj)
|
||||
}
|
||||
}
|
||||
|
||||
void LevellingUtil::timeout()
|
||||
void CCCalibrationUtil::timeout()
|
||||
{
|
||||
QMutexLocker locker(&m_measurementMutex);
|
||||
|
||||
@ -125,7 +127,7 @@ void LevellingUtil::timeout()
|
||||
emit timeout(tr("Calibration timed out before receiving required updates."));
|
||||
}
|
||||
|
||||
void LevellingUtil::startMeasurement()
|
||||
void CCCalibrationUtil::startMeasurement()
|
||||
{
|
||||
QMutexLocker locker(&m_measurementMutex);
|
||||
|
||||
@ -174,7 +176,7 @@ void LevellingUtil::startMeasurement()
|
||||
uavObject->setMetadata(newMetaData);
|
||||
}
|
||||
|
||||
void LevellingUtil::stopMeasurement()
|
||||
void CCCalibrationUtil::stopMeasurement()
|
||||
{
|
||||
m_isMeasuring = false;
|
||||
|
||||
@ -202,7 +204,7 @@ void LevellingUtil::stopMeasurement()
|
||||
AttitudeSettings::GetInstance(uavObjectManager)->setData(attitudeSettingsData);
|
||||
}
|
||||
|
||||
accelGyroBias LevellingUtil::calculateLevellingData()
|
||||
accelGyroBias CCCalibrationUtil::calculateLevellingData()
|
||||
{
|
||||
accelGyroBias bias;
|
||||
bias.m_accelerometerXBias = m_accelerometerX / (double)m_receivedAccelUpdates / ACCELERATION_SCALE;
|
@ -1,11 +1,11 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file levellingutil.h
|
||||
* @file cccalibrationutil.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||
* @addtogroup
|
||||
* @{
|
||||
* @addtogroup LevellingUtil
|
||||
* @addtogroup CCCalibrationUtil
|
||||
* @{
|
||||
* @brief
|
||||
*****************************************************************************/
|
||||
@ -25,8 +25,8 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef LEVELLINGUTIL_H
|
||||
#define LEVELLINGUTIL_H
|
||||
#ifndef CCCALIBRATIONUTIL_H
|
||||
#define CCCALIBRATIONUTIL_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
@ -35,12 +35,12 @@
|
||||
#include "uavobject.h"
|
||||
#include "vehicleconfigurationsource.h"
|
||||
|
||||
class LevellingUtil : public QObject
|
||||
class CCCalibrationUtil : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LevellingUtil(long measurementCount, long measurementRate);
|
||||
explicit LevellingUtil(long accelMeasurementCount, long accelMeasurementRate,
|
||||
explicit CCCalibrationUtil(long measurementCount, long measurementRate);
|
||||
explicit CCCalibrationUtil(long accelMeasurementCount, long accelMeasurementRate,
|
||||
long gyroMeasurementCount, long gyroMeasurementRate);
|
||||
|
||||
signals:
|
||||
@ -89,4 +89,4 @@ private:
|
||||
accelGyroBias calculateLevellingData();
|
||||
};
|
||||
|
||||
#endif // LEVELLINGUTIL_H
|
||||
#endif // CCCALIBRATIONUTIL_H
|
@ -82,7 +82,7 @@ void ConnectionDiagram::setupGraphicsScene()
|
||||
case VehicleConfigurationSource::CONTROLLER_CC:
|
||||
case VehicleConfigurationSource::CONTROLLER_CC3D:
|
||||
case VehicleConfigurationSource::CONTROLLER_REVO:
|
||||
case VehicleConfigurationSource::CONTROLLER_PIPX:
|
||||
case VehicleConfigurationSource::CONTROLLER_OPLINK:
|
||||
default:
|
||||
elementsToShow << "controller";
|
||||
break;
|
||||
|
@ -46,7 +46,7 @@ OutputCalibrationUtil::~OutputCalibrationUtil()
|
||||
|
||||
void OutputCalibrationUtil::startChannelOutput(quint16 channel, quint16 safeValue)
|
||||
{
|
||||
if(m_outputChannel < 0 && channel >= 0 && channel < ActuatorCommand::CHANNEL_NUMELEM)
|
||||
if(m_outputChannel < 0 && channel < ActuatorCommand::CHANNEL_NUMELEM)
|
||||
{
|
||||
//Start output...
|
||||
m_outputChannel = channel;
|
||||
|
@ -15,9 +15,9 @@ AutoUpdatePage::AutoUpdatePage(SetupWizard *wizard, QWidget *parent) :
|
||||
Q_ASSERT(pm);
|
||||
UploaderGadgetFactory *uploader = pm->getObject<UploaderGadgetFactory>();
|
||||
Q_ASSERT(uploader);
|
||||
connect(ui->startUpdate,SIGNAL(clicked()), this, SLOT(disableButtons()));
|
||||
connect(ui->startUpdate,SIGNAL(clicked()),uploader,SIGNAL(autoUpdate()));
|
||||
connect(uploader,SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep,QVariant)),this,SLOT(updateStatus(uploader::AutoUpdateStep,QVariant)));
|
||||
connect(ui->startUpdate, SIGNAL(clicked()), this, SLOT(disableButtons()));
|
||||
connect(ui->startUpdate, SIGNAL(clicked()), uploader, SIGNAL(autoUpdate()));
|
||||
connect(uploader, SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep,QVariant)), this, SLOT(updateStatus(uploader::AutoUpdateStep, QVariant)));
|
||||
}
|
||||
|
||||
AutoUpdatePage::~AutoUpdatePage()
|
||||
|
@ -1,11 +1,11 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file levellingpage.cpp
|
||||
* @file cccalibrationpage.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||
* @addtogroup
|
||||
* @{
|
||||
* @addtogroup LevellingPage
|
||||
* @addtogroup CCCalibrationPage
|
||||
* @{
|
||||
* @brief
|
||||
*****************************************************************************/
|
||||
@ -27,38 +27,37 @@
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QDebug>
|
||||
#include "levellingpage.h"
|
||||
#include "ui_levellingpage.h"
|
||||
#include "cccalibrationpage.h"
|
||||
#include "ui_cccalibrationpage.h"
|
||||
#include "setupwizard.h"
|
||||
|
||||
LevellingPage::LevellingPage(SetupWizard *wizard, QWidget *parent) :
|
||||
CCCalibrationPage::CCCalibrationPage(SetupWizard *wizard, QWidget *parent) :
|
||||
AbstractWizardPage(wizard, parent),
|
||||
ui(new Ui::LevellingPage), m_levellingUtil(0)
|
||||
ui(new Ui::CCCalibrationPage), m_calibrationUtil(0)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(ui->levelButton, SIGNAL(clicked()), this, SLOT(performLevelling()));
|
||||
connect(ui->levelButton, SIGNAL(clicked()), this, SLOT(performCalibration()));
|
||||
}
|
||||
|
||||
LevellingPage::~LevellingPage()
|
||||
CCCalibrationPage::~CCCalibrationPage()
|
||||
{
|
||||
if(m_levellingUtil) {
|
||||
delete m_levellingUtil;
|
||||
if(m_calibrationUtil) {
|
||||
delete m_calibrationUtil;
|
||||
}
|
||||
delete ui;
|
||||
}
|
||||
|
||||
bool LevellingPage::validatePage()
|
||||
bool CCCalibrationPage::validatePage()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LevellingPage::isComplete() const
|
||||
bool CCCalibrationPage::isComplete() const
|
||||
{
|
||||
//const_cast<LevellingPage *>(this)->getWizard()->isLevellingPerformed() &&
|
||||
return ui->levelButton->isEnabled();
|
||||
}
|
||||
|
||||
void LevellingPage::enableButtons(bool enable)
|
||||
void CCCalibrationPage::enableButtons(bool enable)
|
||||
{
|
||||
ui->levelButton->setEnabled(enable);
|
||||
getWizard()->button(QWizard::NextButton)->setEnabled(enable);
|
||||
@ -68,7 +67,7 @@ void LevellingPage::enableButtons(bool enable)
|
||||
QApplication::processEvents();
|
||||
}
|
||||
|
||||
void LevellingPage::performLevelling()
|
||||
void CCCalibrationPage::performCalibration()
|
||||
{
|
||||
if(!getWizard()->getConnectionManager()->isConnected()) {
|
||||
QMessageBox msgBox;
|
||||
@ -84,19 +83,19 @@ void LevellingPage::performLevelling()
|
||||
ui->progressLabel->setText(QString(tr("Retrieving data...")));
|
||||
|
||||
|
||||
if(!m_levellingUtil)
|
||||
if(!m_calibrationUtil)
|
||||
{
|
||||
m_levellingUtil = new LevellingUtil(BIAS_CYCLES, BIAS_RATE);
|
||||
m_calibrationUtil = new CCCalibrationUtil(BIAS_CYCLES, BIAS_RATE);
|
||||
}
|
||||
|
||||
connect(m_levellingUtil, SIGNAL(progress(long,long)), this, SLOT(levellingProgress(long,long)));
|
||||
connect(m_levellingUtil, SIGNAL(done(accelGyroBias)), this, SLOT(levellingDone(accelGyroBias)));
|
||||
connect(m_levellingUtil, SIGNAL(timeout(QString)), this, SLOT(levellingTimeout(QString)));
|
||||
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_levellingUtil->start();
|
||||
m_calibrationUtil->start();
|
||||
}
|
||||
|
||||
void LevellingPage::levellingProgress(long current, long total)
|
||||
void CCCalibrationPage::calibrationProgress(long current, long total)
|
||||
{
|
||||
if(ui->levellinProgressBar->maximum() != (int)total) {
|
||||
ui->levellinProgressBar->setMaximum((int)total);
|
||||
@ -106,16 +105,16 @@ void LevellingPage::levellingProgress(long current, long total)
|
||||
}
|
||||
}
|
||||
|
||||
void LevellingPage::levellingDone(accelGyroBias bias)
|
||||
void CCCalibrationPage::calibrationDone(accelGyroBias bias)
|
||||
{
|
||||
stopLevelling();
|
||||
stopCalibration();
|
||||
getWizard()->setLevellingBias(bias);
|
||||
emit completeChanged();
|
||||
}
|
||||
|
||||
void LevellingPage::levellingTimeout(QString message)
|
||||
void CCCalibrationPage::calibrationTimeout(QString message)
|
||||
{
|
||||
stopLevelling();
|
||||
stopCalibration();
|
||||
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(message);
|
||||
@ -124,13 +123,13 @@ void LevellingPage::levellingTimeout(QString message)
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
void LevellingPage::stopLevelling()
|
||||
void CCCalibrationPage::stopCalibration()
|
||||
{
|
||||
if(m_levellingUtil)
|
||||
if(m_calibrationUtil)
|
||||
{
|
||||
disconnect(m_levellingUtil, SIGNAL(progress(long,long)), this, SLOT(levellingProgress(long,long)));
|
||||
disconnect(m_levellingUtil, SIGNAL(done(accelGyroBias)), this, SLOT(levellingDone(accelGyroBias)));
|
||||
disconnect(m_levellingUtil, SIGNAL(timeout(QString)), this, SLOT(levellingTimeout(QString)));
|
||||
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("<font color='green'>Done!</font>")));
|
||||
enableButtons(true);
|
||||
}
|
@ -1,11 +1,11 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file levellingpage.h
|
||||
* @file cccalibrationpage.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||
* @addtogroup
|
||||
* @{
|
||||
* @addtogroup LevellingPage
|
||||
* @addtogroup CCCalibrationPage
|
||||
* @{
|
||||
* @brief
|
||||
*****************************************************************************/
|
||||
@ -25,41 +25,41 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef LEVELLINGPAGE_H
|
||||
#define LEVELLINGPAGE_H
|
||||
#ifndef CCCALIBRATIONPAGE_H
|
||||
#define CCCALIBRATIONPAGE_H
|
||||
|
||||
#include "abstractwizardpage.h"
|
||||
#include "levellingutil.h"
|
||||
#include "cccalibrationutil.h"
|
||||
|
||||
namespace Ui {
|
||||
class LevellingPage;
|
||||
class CCCalibrationPage;
|
||||
}
|
||||
|
||||
class LevellingPage : public AbstractWizardPage
|
||||
class CCCalibrationPage : public AbstractWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LevellingPage(SetupWizard *wizard, QWidget *parent = 0);
|
||||
~LevellingPage();
|
||||
explicit CCCalibrationPage(SetupWizard *wizard, QWidget *parent = 0);
|
||||
~CCCalibrationPage();
|
||||
bool validatePage();
|
||||
bool isComplete() const;
|
||||
|
||||
private slots:
|
||||
void performLevelling();
|
||||
void levellingProgress(long current, long total);
|
||||
void levellingDone(accelGyroBias bias);
|
||||
void levellingTimeout(QString message);
|
||||
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 = 30;
|
||||
|
||||
Ui::LevellingPage *ui;
|
||||
LevellingUtil *m_levellingUtil;
|
||||
Ui::CCCalibrationPage *ui;
|
||||
CCCalibrationUtil *m_calibrationUtil;
|
||||
|
||||
void stopLevelling();
|
||||
void stopCalibration();
|
||||
void enableButtons(bool enable);
|
||||
};
|
||||
|
||||
#endif // LEVELLINGPAGE_H
|
||||
#endif // CCCALIBRATIONPAGE_H
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>LevellingPage</class>
|
||||
<widget class="QWizardPage" name="LevellingPage">
|
||||
<class>CCCalibrationPage</class>
|
||||
<widget class="QWizardPage" name="CCCalibrationPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@ -20,12 +20,12 @@
|
||||
<string><!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:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;">
|
||||
<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:12pt; font-weight:600;">OpenPilot controller leveling 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;"></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 wizard needs to get information from the controller to determine in which position the vehicle is normally considered to be level. To be able to successfully perform these measurements, you need to place the vehicle on a surface that is as flat and level as possible. Examples of such surfaces could be a table top or the floor. Be careful to ensure that the vehicle really is level, since this step will affect the accelerometer and gyro bias in the controller software.</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;"></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 perform the leveling, please push the Calculate button and wait for the process to finish. </span></p></body></html></string>
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;">
|
||||
<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:12pt; font-weight:600;">OpenPilot CopterControl sensor 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;">The wizard needs to get information from the controller to determine in which position the vehicle is normally considered to be level. To be able to successfully perform these measurements, you need to place the vehicle on a surface that is as flat and level as possible. Examples of such surfaces could be a table top or the floor. Be careful to ensure that the vehicle really is level, since this step will affect the accelerometer and gyro bias in the controller software.</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;">To perform the calibration, please push the Calculate button and wait for the process to finish. </span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
@ -97,12 +97,12 @@ SetupWizard::CONTROLLER_TYPE ControllerPage::getControllerType()
|
||||
|
||||
switch (id) {
|
||||
case 0x0301:
|
||||
return SetupWizard::CONTROLLER_PIPX;
|
||||
return SetupWizard::CONTROLLER_OPLINK;
|
||||
case 0x0401:
|
||||
return SetupWizard::CONTROLLER_CC;
|
||||
case 0x0402:
|
||||
return SetupWizard::CONTROLLER_CC3D;
|
||||
case 0x0901:
|
||||
case 0x0903:
|
||||
return SetupWizard::CONTROLLER_REVO;
|
||||
default:
|
||||
return SetupWizard::CONTROLLER_UNKNOWN;
|
||||
@ -122,9 +122,7 @@ void ControllerPage::setupBoardTypes()
|
||||
ui->boardTypeCombo->addItem(tr("OpenPilot CopterControl"), SetupWizard::CONTROLLER_CC);
|
||||
ui->boardTypeCombo->addItem(tr("OpenPilot CopterControl 3D"), SetupWizard::CONTROLLER_CC3D);
|
||||
ui->boardTypeCombo->addItem(tr("OpenPilot Revolution"), SetupWizard::CONTROLLER_REVO);
|
||||
//ui->boardTypeCombo->model()->setData(ui->boardTypeCombo->model()->index(ui->boardTypeCombo->count() - 1, 0), v, Qt::UserRole - 1);
|
||||
ui->boardTypeCombo->addItem(tr("OpenPilot OPLink Radio Modem"), SetupWizard::CONTROLLER_PIPX);
|
||||
//ui->boardTypeCombo->model()->setData(ui->boardTypeCombo->model()->index(ui->boardTypeCombo->count() - 1, 0), v, Qt::UserRole - 1);
|
||||
ui->boardTypeCombo->addItem(tr("OpenPilot OPLink Radio Modem"), SetupWizard::CONTROLLER_OPLINK);
|
||||
}
|
||||
|
||||
void ControllerPage::setControllerType(SetupWizard::CONTROLLER_TYPE type)
|
||||
|
@ -74,18 +74,42 @@ bool InputPage::restartNeeded(VehicleConfigurationSource::INPUT_TYPE selectedTyp
|
||||
Q_ASSERT(uavoManager);
|
||||
HwSettings* hwSettings = HwSettings::GetInstance(uavoManager);
|
||||
HwSettings::DataFields data = hwSettings->getData();
|
||||
switch(selectedType)
|
||||
{
|
||||
case VehicleConfigurationSource::INPUT_PWM:
|
||||
return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PWM;
|
||||
case VehicleConfigurationSource::INPUT_PPM:
|
||||
return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PPM;
|
||||
case VehicleConfigurationSource::INPUT_SBUS:
|
||||
return data.CC_MainPort != HwSettings::CC_MAINPORT_SBUS;
|
||||
case VehicleConfigurationSource::INPUT_DSM2:
|
||||
// TODO: Handle all of the DSM types ?? Which is most common?
|
||||
return data.CC_MainPort != HwSettings::CC_MAINPORT_DSM2;
|
||||
default:
|
||||
return true;
|
||||
switch(getWizard()->getControllerType()) {
|
||||
case SetupWizard::CONTROLLER_CC:
|
||||
case SetupWizard::CONTROLLER_CC3D:
|
||||
{
|
||||
switch(selectedType)
|
||||
{
|
||||
case VehicleConfigurationSource::INPUT_PWM:
|
||||
return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PWM;
|
||||
case VehicleConfigurationSource::INPUT_PPM:
|
||||
return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PPM;
|
||||
case VehicleConfigurationSource::INPUT_SBUS:
|
||||
return data.CC_MainPort != HwSettings::CC_MAINPORT_SBUS;
|
||||
case VehicleConfigurationSource::INPUT_DSM2:
|
||||
// TODO: Handle all of the DSM types ?? Which is most common?
|
||||
return data.CC_MainPort != HwSettings::CC_MAINPORT_DSM2;
|
||||
default: return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SetupWizard::CONTROLLER_REVO:
|
||||
{
|
||||
switch(selectedType)
|
||||
{
|
||||
case VehicleConfigurationSource::INPUT_PWM:
|
||||
return data.RM_RcvrPort != HwSettings::CC_RCVRPORT_PWM;
|
||||
case VehicleConfigurationSource::INPUT_PPM:
|
||||
return data.RM_RcvrPort != HwSettings::CC_RCVRPORT_PPM;
|
||||
case VehicleConfigurationSource::INPUT_SBUS:
|
||||
return data.RM_MainPort != HwSettings::CC_MAINPORT_SBUS;
|
||||
case VehicleConfigurationSource::INPUT_DSM2:
|
||||
// TODO: Handle all of the DSM types ?? Which is most common?
|
||||
return data.RM_MainPort != HwSettings::CC_MAINPORT_DSM2;
|
||||
default: return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: return true;
|
||||
}
|
||||
}
|
||||
|
@ -330,6 +330,7 @@ void OutputCalibrationPage::debugLogChannelValues()
|
||||
|
||||
void OutputCalibrationPage::on_motorNeutralSlider_valueChanged(int value)
|
||||
{
|
||||
Q_UNUSED(value);
|
||||
if(ui->motorNeutralButton->isChecked()) {
|
||||
quint16 value = ui->motorNeutralSlider->value();
|
||||
m_calibrationUtil->setChannelOutputValue(value);
|
||||
@ -348,6 +349,7 @@ void OutputCalibrationPage::on_servoCenterButton_toggled(bool checked)
|
||||
|
||||
void OutputCalibrationPage::on_servoCenterSlider_valueChanged(int position)
|
||||
{
|
||||
Q_UNUSED(position);
|
||||
if(ui->servoCenterButton->isChecked()) {
|
||||
quint16 value = ui->servoCenterSlider->value();
|
||||
m_calibrationUtil->setChannelOutputValue(value);
|
||||
@ -375,6 +377,7 @@ void OutputCalibrationPage::on_servoMinAngleButton_toggled(bool checked)
|
||||
|
||||
void OutputCalibrationPage::on_servoMinAngleSlider_valueChanged(int position)
|
||||
{
|
||||
Q_UNUSED(position);
|
||||
if(ui->servoMinAngleButton->isChecked()) {
|
||||
quint16 value = ui->servoMinAngleSlider->value();
|
||||
m_calibrationUtil->setChannelOutputValue(value);
|
||||
@ -393,6 +396,7 @@ void OutputCalibrationPage::on_servoMaxAngleButton_toggled(bool checked)
|
||||
|
||||
void OutputCalibrationPage::on_servoMaxAngleSlider_valueChanged(int position)
|
||||
{
|
||||
Q_UNUSED(position);
|
||||
if(ui->servoMaxAngleButton->isChecked()) {
|
||||
quint16 value = ui->servoMaxAngleSlider->value();
|
||||
m_calibrationUtil->setChannelOutputValue(value);
|
||||
|
@ -0,0 +1,42 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file revocalibrationpage.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||
* @addtogroup
|
||||
* @{
|
||||
* @addtogroup RevoCalibrationPage
|
||||
* @{
|
||||
* @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 "revocalibrationpage.h"
|
||||
#include "ui_revocalibrationpage.h"
|
||||
|
||||
RevoCalibrationPage::RevoCalibrationPage(SetupWizard *wizard, QWidget *parent) :
|
||||
AbstractWizardPage(wizard, parent),
|
||||
ui(new Ui::RevoCalibrationPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setFinalPage(true);
|
||||
}
|
||||
|
||||
RevoCalibrationPage::~RevoCalibrationPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file revocalibrationpage.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||
* @addtogroup
|
||||
* @{
|
||||
* @addtogroup RevoCalibrationPage
|
||||
* @{
|
||||
* @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 REVOCALIBRATIONPAGE_H
|
||||
#define REVOCALIBRATIONPAGE_H
|
||||
|
||||
#include "abstractwizardpage.h"
|
||||
|
||||
namespace Ui {
|
||||
class RevoCalibrationPage;
|
||||
}
|
||||
|
||||
class RevoCalibrationPage : public AbstractWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit RevoCalibrationPage(SetupWizard *wizard, QWidget *parent = 0);
|
||||
~RevoCalibrationPage();
|
||||
|
||||
private:
|
||||
Ui::RevoCalibrationPage *ui;
|
||||
};
|
||||
|
||||
#endif // REVOCALIBRATIONPAGE_H
|
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>RevoCalibrationPage</class>
|
||||
<widget class="QWizardPage" name="RevoCalibrationPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>WizardPage</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>582</width>
|
||||
<height>150</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><!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 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 Revolution controller sensor 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;">The calibration procedure for the OpenPilot Revolution controller is not yet implemented in this setup wizard. To calibrate your OpenPilot Revolution controller please use the calibration utility found in the configuration plugin after you have finished this wizard.</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;">Future versions of will have an easy to use calibration procedure implemented.</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -36,12 +36,13 @@
|
||||
#include "pages/surfacepage.h"
|
||||
#include "pages/inputpage.h"
|
||||
#include "pages/outputpage.h"
|
||||
#include "pages/levellingpage.h"
|
||||
#include "pages/cccalibrationpage.h"
|
||||
#include "pages/summarypage.h"
|
||||
#include "pages/savepage.h"
|
||||
#include "pages/notyetimplementedpage.h"
|
||||
#include "pages/rebootpage.h"
|
||||
#include "pages/outputcalibrationpage.h"
|
||||
#include "pages/revocalibrationpage.h"
|
||||
#include "extensionsystem/pluginmanager.h"
|
||||
#include "vehicleconfigurationhelper.h"
|
||||
#include "actuatorsettings.h"
|
||||
@ -51,7 +52,7 @@
|
||||
SetupWizard::SetupWizard(QWidget *parent) : QWizard(parent), VehicleConfigurationSource(),
|
||||
m_controllerType(CONTROLLER_UNKNOWN),
|
||||
m_vehicleType(VEHICLE_UNKNOWN), m_inputType(INPUT_UNKNOWN), m_escType(ESC_UNKNOWN),
|
||||
m_levellingPerformed(false), m_restartNeeded(false), m_connectionManager(0)
|
||||
m_calibrationPerformed(false), m_restartNeeded(false), m_connectionManager(0)
|
||||
{
|
||||
setWindowTitle(tr("OpenPilot Setup Wizard"));
|
||||
setOption(QWizard::IndependentPages, false);
|
||||
@ -81,9 +82,9 @@ int SetupWizard::nextId() const
|
||||
{
|
||||
case CONTROLLER_CC:
|
||||
case CONTROLLER_CC3D:
|
||||
return PAGE_INPUT;
|
||||
case CONTROLLER_REVO:
|
||||
case CONTROLLER_PIPX:
|
||||
return PAGE_INPUT;
|
||||
case CONTROLLER_OPLINK:
|
||||
default:
|
||||
return PAGE_NOTYETIMPLEMENTED;
|
||||
}
|
||||
@ -117,12 +118,25 @@ int SetupWizard::nextId() const
|
||||
return PAGE_VEHICLES;
|
||||
case PAGE_OUTPUT:
|
||||
return PAGE_SUMMARY;
|
||||
case PAGE_LEVELLING:
|
||||
return PAGE_CALIBRATION;
|
||||
case PAGE_CALIBRATION:
|
||||
case PAGE_CC_CALIBRATION:
|
||||
return PAGE_OUTPUT_CALIBRATION;
|
||||
case PAGE_REVO_CALIBRATION:
|
||||
return PAGE_OUTPUT_CALIBRATION;
|
||||
case PAGE_OUTPUT_CALIBRATION:
|
||||
return PAGE_SAVE;
|
||||
case PAGE_SUMMARY:
|
||||
return PAGE_LEVELLING;
|
||||
{
|
||||
switch(getControllerType())
|
||||
{
|
||||
case CONTROLLER_CC:
|
||||
case CONTROLLER_CC3D:
|
||||
return PAGE_CC_CALIBRATION;
|
||||
case CONTROLLER_REVO:
|
||||
return PAGE_REVO_CALIBRATION;
|
||||
default:
|
||||
return PAGE_NOTYETIMPLEMENTED;
|
||||
}
|
||||
}
|
||||
case PAGE_SAVE:
|
||||
return PAGE_END;
|
||||
case PAGE_NOTYETIMPLEMENTED:
|
||||
@ -147,7 +161,7 @@ QString SetupWizard::getSummaryText()
|
||||
case CONTROLLER_REVO:
|
||||
summary.append(tr("OpenPilot Revolution"));
|
||||
break;
|
||||
case CONTROLLER_PIPX:
|
||||
case CONTROLLER_OPLINK:
|
||||
summary.append(tr("OpenPilot OPLink Radio Modem"));
|
||||
break;
|
||||
default:
|
||||
@ -275,8 +289,9 @@ void SetupWizard::createPages()
|
||||
setPage(PAGE_SURFACE, new SurfacePage(this));
|
||||
setPage(PAGE_INPUT, new InputPage(this));
|
||||
setPage(PAGE_OUTPUT, new OutputPage(this));
|
||||
setPage(PAGE_LEVELLING, new LevellingPage(this));
|
||||
setPage(PAGE_CALIBRATION, new OutputCalibrationPage(this));
|
||||
setPage(PAGE_CC_CALIBRATION, new CCCalibrationPage(this));
|
||||
setPage(PAGE_REVO_CALIBRATION, new RevoCalibrationPage(this));
|
||||
setPage(PAGE_OUTPUT_CALIBRATION, new OutputCalibrationPage(this));
|
||||
setPage(PAGE_SUMMARY, new SummaryPage(this));
|
||||
setPage(PAGE_SAVE, new SavePage(this));
|
||||
setPage(PAGE_REBOOT, new RebootPage(this));
|
||||
@ -295,7 +310,7 @@ void SetupWizard::createPages()
|
||||
|
||||
void SetupWizard::customBackClicked()
|
||||
{
|
||||
if(currentId() == PAGE_CALIBRATION) {
|
||||
if(currentId() == PAGE_OUTPUT_CALIBRATION) {
|
||||
static_cast<OutputCalibrationPage*>(currentPage())->customBackClicked();
|
||||
}
|
||||
else {
|
||||
|
@ -29,7 +29,7 @@
|
||||
#define SETUPWIZARD_H
|
||||
|
||||
#include <QWizard>
|
||||
#include "levellingutil.h"
|
||||
#include "cccalibrationutil.h"
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/connectionmanager.h>
|
||||
#include "vehicleconfigurationsource.h"
|
||||
@ -58,9 +58,15 @@ public:
|
||||
void setESCType(SetupWizard::ESC_TYPE type) { m_escType = type; }
|
||||
SetupWizard::ESC_TYPE getESCType() const { return m_escType; }
|
||||
|
||||
void setLevellingBias(accelGyroBias bias) { m_levellingBias = bias; m_levellingPerformed = true; }
|
||||
bool isLevellingPerformed() const { return m_levellingPerformed; }
|
||||
accelGyroBias getLevellingBias() const { return m_levellingBias; }
|
||||
void setGPSSetting(SetupWizard::GPS_SETTING setting) { m_gpsSetting = setting; }
|
||||
SetupWizard::GPS_SETTING getGPSSetting() const {return m_gpsSetting;}
|
||||
|
||||
void setRadioSetting(SetupWizard::RADIO_SETTING setting) { m_radioSetting = setting; }
|
||||
SetupWizard::RADIO_SETTING getRadioSetting() const {return m_radioSetting;}
|
||||
|
||||
void setLevellingBias(accelGyroBias bias) { m_calibrationBias = bias; m_calibrationPerformed = true; }
|
||||
bool isCalibrationPerformed() const { return m_calibrationPerformed; }
|
||||
accelGyroBias getCalibrationBias() const { return m_calibrationBias; }
|
||||
|
||||
void setActuatorSettings(QList<actuatorChannelSettings> actuatorSettings) { m_actuatorSettings = actuatorSettings; }
|
||||
bool isMotorCalibrationPerformed() const { return m_motorCalibrationPerformed; }
|
||||
@ -84,8 +90,9 @@ private slots:
|
||||
void pageChanged(int currId);
|
||||
private:
|
||||
enum {PAGE_START, PAGE_CONTROLLER, PAGE_VEHICLES, PAGE_MULTI, PAGE_FIXEDWING,
|
||||
PAGE_HELI, PAGE_SURFACE, PAGE_INPUT, PAGE_OUTPUT, PAGE_LEVELLING, PAGE_CALIBRATION,
|
||||
PAGE_SAVE, PAGE_SUMMARY, PAGE_NOTYETIMPLEMENTED, PAGE_REBOOT, PAGE_END, PAGE_UPDATE};
|
||||
PAGE_HELI, PAGE_SURFACE, PAGE_INPUT, PAGE_OUTPUT, PAGE_CC_CALIBRATION,
|
||||
PAGE_REVO_CALIBRATION, PAGE_OUTPUT_CALIBRATION, PAGE_SAVE, PAGE_SUMMARY,
|
||||
PAGE_NOTYETIMPLEMENTED, PAGE_REBOOT, PAGE_END, PAGE_UPDATE};
|
||||
void createPages();
|
||||
bool saveHardwareSettings() const;
|
||||
bool canAutoUpdate() const;
|
||||
@ -96,8 +103,11 @@ private:
|
||||
INPUT_TYPE m_inputType;
|
||||
ESC_TYPE m_escType;
|
||||
|
||||
bool m_levellingPerformed;
|
||||
accelGyroBias m_levellingBias;
|
||||
GPS_SETTING m_gpsSetting;
|
||||
RADIO_SETTING m_radioSetting;
|
||||
|
||||
bool m_calibrationPerformed;
|
||||
accelGyroBias m_calibrationBias;
|
||||
|
||||
bool m_motorCalibrationPerformed;
|
||||
QList<actuatorChannelSettings> m_actuatorSettings;
|
||||
|
@ -25,8 +25,6 @@ HEADERS += setupwizardplugin.h \
|
||||
pages/outputpage.h \
|
||||
pages/inputpage.h \
|
||||
pages/summarypage.h \
|
||||
pages/levellingpage.h \
|
||||
levellingutil.h \
|
||||
vehicleconfigurationsource.h \
|
||||
vehicleconfigurationhelper.h \
|
||||
connectiondiagram.h \
|
||||
@ -34,7 +32,10 @@ HEADERS += setupwizardplugin.h \
|
||||
outputcalibrationutil.h \
|
||||
pages/rebootpage.h \
|
||||
pages/savepage.h \
|
||||
pages/autoupdatepage.h
|
||||
pages/autoupdatepage.h \
|
||||
pages/cccalibrationpage.h \
|
||||
cccalibrationutil.h \
|
||||
pages/revocalibrationpage.h
|
||||
|
||||
SOURCES += setupwizardplugin.cpp \
|
||||
setupwizard.cpp \
|
||||
@ -51,8 +52,6 @@ SOURCES += setupwizardplugin.cpp \
|
||||
pages/outputpage.cpp \
|
||||
pages/inputpage.cpp \
|
||||
pages/summarypage.cpp \
|
||||
pages/levellingpage.cpp \
|
||||
levellingutil.cpp \
|
||||
vehicleconfigurationsource.cpp \
|
||||
vehicleconfigurationhelper.cpp \
|
||||
connectiondiagram.cpp \
|
||||
@ -60,7 +59,10 @@ SOURCES += setupwizardplugin.cpp \
|
||||
outputcalibrationutil.cpp \
|
||||
pages/rebootpage.cpp \
|
||||
pages/savepage.cpp \
|
||||
pages/autoupdatepage.cpp
|
||||
pages/autoupdatepage.cpp \
|
||||
pages/cccalibrationpage.cpp \
|
||||
cccalibrationutil.cpp \
|
||||
pages/revocalibrationpage.cpp
|
||||
|
||||
OTHER_FILES += SetupWizard.pluginspec
|
||||
|
||||
@ -77,12 +79,13 @@ FORMS += \
|
||||
pages/outputpage.ui \
|
||||
pages/inputpage.ui \
|
||||
pages/summarypage.ui \
|
||||
pages/levellingpage.ui \
|
||||
connectiondiagram.ui \
|
||||
pages/outputcalibrationpage.ui \
|
||||
pages/rebootpage.ui \
|
||||
pages/savepage.ui \
|
||||
pages/autoupdatepage.ui
|
||||
pages/autoupdatepage.ui \
|
||||
pages/cccalibrationpage.ui \
|
||||
pages/revocalibrationpage.ui
|
||||
|
||||
RESOURCES += \
|
||||
wizardResources.qrc
|
||||
|
@ -141,7 +141,38 @@ void VehicleConfigurationHelper::applyHardwareConfiguration()
|
||||
}
|
||||
break;
|
||||
case VehicleConfigurationSource::CONTROLLER_REVO:
|
||||
// TODO: Implement Revo settings
|
||||
// Reset all ports
|
||||
data.RM_RcvrPort = HwSettings::RM_RCVRPORT_DISABLED;
|
||||
|
||||
//Default mainport to be active telemetry link
|
||||
data.RM_MainPort = HwSettings::RM_MAINPORT_TELEMETRY;
|
||||
|
||||
data.RM_FlexiPort = HwSettings::RM_FLEXIPORT_DISABLED;
|
||||
switch(m_configSource->getInputType())
|
||||
{
|
||||
case VehicleConfigurationSource::INPUT_PWM:
|
||||
data.RM_RcvrPort = HwSettings::RM_RCVRPORT_PWM;
|
||||
break;
|
||||
case VehicleConfigurationSource::INPUT_PPM:
|
||||
data.RM_RcvrPort = HwSettings::RM_RCVRPORT_PPM;
|
||||
break;
|
||||
case VehicleConfigurationSource::INPUT_SBUS:
|
||||
// We have to set teletry on flexport since s.bus needs the mainport.
|
||||
data.RM_MainPort = HwSettings::RM_MAINPORT_SBUS;
|
||||
data.RM_FlexiPort = HwSettings::RM_FLEXIPORT_TELEMETRY;
|
||||
break;
|
||||
case VehicleConfigurationSource::INPUT_DSMX10:
|
||||
data.RM_FlexiPort = HwSettings::RM_FLEXIPORT_DSMX10BIT;
|
||||
break;
|
||||
case VehicleConfigurationSource::INPUT_DSMX11:
|
||||
data.RM_FlexiPort = HwSettings::RM_FLEXIPORT_DSMX11BIT;
|
||||
break;
|
||||
case VehicleConfigurationSource::INPUT_DSM2:
|
||||
data.RM_FlexiPort = HwSettings::RM_FLEXIPORT_DSM2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -229,11 +260,17 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
||||
switch(m_configSource->getVehicleSubType()) {
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_TRI_Y:
|
||||
data.ChannelUpdateFreq[0] = updateFrequence;
|
||||
if(m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
||||
data.ChannelUpdateFreq[1] = updateFrequence;
|
||||
}
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X:
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
|
||||
data.ChannelUpdateFreq[0] = updateFrequence;
|
||||
data.ChannelUpdateFreq[1] = updateFrequence;
|
||||
if(m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) {
|
||||
data.ChannelUpdateFreq[2] = updateFrequence;
|
||||
}
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y:
|
||||
@ -295,9 +332,9 @@ void VehicleConfigurationHelper::applyLevellingConfiguration()
|
||||
AttitudeSettings* attitudeSettings = AttitudeSettings::GetInstance(m_uavoManager);
|
||||
Q_ASSERT(attitudeSettings);
|
||||
AttitudeSettings::DataFields data = attitudeSettings->getData();
|
||||
if(m_configSource->isLevellingPerformed())
|
||||
if(m_configSource->isCalibrationPerformed())
|
||||
{
|
||||
accelGyroBias bias = m_configSource->getLevellingBias();
|
||||
accelGyroBias bias = m_configSource->getCalibrationBias();
|
||||
|
||||
data.AccelBias[0] += bias.m_accelerometerXBias;
|
||||
data.AccelBias[1] += bias.m_accelerometerYBias;
|
||||
|
@ -56,7 +56,7 @@ class VehicleConfigurationSource
|
||||
public:
|
||||
VehicleConfigurationSource();
|
||||
|
||||
enum CONTROLLER_TYPE {CONTROLLER_UNKNOWN, CONTROLLER_CC, CONTROLLER_CC3D, CONTROLLER_REVO, CONTROLLER_PIPX};
|
||||
enum CONTROLLER_TYPE {CONTROLLER_UNKNOWN, CONTROLLER_CC, CONTROLLER_CC3D, CONTROLLER_REVO, CONTROLLER_OPLINK};
|
||||
enum VEHICLE_TYPE {VEHICLE_UNKNOWN, VEHICLE_MULTI, VEHICLE_FIXEDWING, VEHICLE_HELI, VEHICLE_SURFACE};
|
||||
enum VEHICLE_SUB_TYPE {MULTI_ROTOR_UNKNOWN, MULTI_ROTOR_TRI_Y, MULTI_ROTOR_QUAD_X, MULTI_ROTOR_QUAD_PLUS,
|
||||
MULTI_ROTOR_HEXA, MULTI_ROTOR_HEXA_H, MULTI_ROTOR_HEXA_COAX_Y, MULTI_ROTOR_OCTO,
|
||||
@ -65,14 +65,20 @@ public:
|
||||
enum ESC_TYPE {ESC_RAPID, ESC_LEGACY, ESC_UNKNOWN};
|
||||
enum INPUT_TYPE {INPUT_PWM, INPUT_PPM, INPUT_SBUS, INPUT_DSMX10, INPUT_DSMX11, INPUT_DSM2, INPUT_UNKNOWN};
|
||||
|
||||
enum GPS_SETTING {GPS_UBX, GPS_NMEA, GPS_DISABLED};
|
||||
enum RADIO_SETTING {RADIO_TELEMETRY, RADIO_DISABLED};
|
||||
|
||||
virtual VehicleConfigurationSource::CONTROLLER_TYPE getControllerType() const = 0;
|
||||
virtual VehicleConfigurationSource::VEHICLE_TYPE getVehicleType() const = 0;
|
||||
virtual VehicleConfigurationSource::VEHICLE_SUB_TYPE getVehicleSubType() const = 0;
|
||||
virtual VehicleConfigurationSource::INPUT_TYPE getInputType() const = 0;
|
||||
virtual VehicleConfigurationSource::ESC_TYPE getESCType() const = 0;
|
||||
|
||||
virtual bool isLevellingPerformed() const = 0;
|
||||
virtual accelGyroBias getLevellingBias() const = 0;
|
||||
virtual VehicleConfigurationSource::GPS_SETTING getGPSSetting() const = 0;
|
||||
virtual VehicleConfigurationSource::RADIO_SETTING getRadioSetting() const = 0;
|
||||
|
||||
virtual bool isCalibrationPerformed() const = 0;
|
||||
virtual accelGyroBias getCalibrationBias() const = 0;
|
||||
|
||||
virtual bool isMotorCalibrationPerformed() const = 0;
|
||||
virtual QList<actuatorChannelSettings> getActuatorSettings() const = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user