1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

OP-816 Added page for Revolution calibration referring to the configuration plug-in until we get 'our ducks in a row' regarding the Revolution calibration procedure.

This commit is contained in:
Fredrik Arvidsson 2013-04-16 20:40:25 +02:00
parent 66b66ee8f4
commit 9a9578a2a3
7 changed files with 169 additions and 13 deletions

View File

@ -21,7 +21,7 @@
<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 controller sensor calibration procedure</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: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>

View File

@ -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;
}

View File

@ -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

View File

@ -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>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;OpenPilot Revolution controller sensor calibration procedure&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt; font-weight:600;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;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.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Future versions of will have an easy to use calibration procedure implemented.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -42,6 +42,7 @@
#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);
@ -119,10 +120,23 @@ int SetupWizard::nextId() const
return PAGE_SUMMARY;
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_CC_CALIBRATION;
{
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:
@ -276,6 +290,7 @@ void SetupWizard::createPages()
setPage(PAGE_INPUT, new InputPage(this));
setPage(PAGE_OUTPUT, new OutputPage(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));

View File

@ -64,9 +64,9 @@ public:
void setRadioSetting(SetupWizard::RADIO_SETTING setting) { m_radioSetting = setting; }
SetupWizard::RADIO_SETTING getRadioSetting() const {return m_radioSetting;}
void setLevellingBias(accelGyroBias bias) { m_levellingBias = bias; m_levellingPerformed = true; }
bool isCalibrationPerformed() const { return m_levellingPerformed; }
accelGyroBias getCalibrationBias() const { return m_levellingBias; }
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; }
@ -90,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_CC_CALIBRATION, PAGE_OUTPUT_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;
@ -105,8 +106,8 @@ private:
GPS_SETTING m_gpsSetting;
RADIO_SETTING m_radioSetting;
bool m_levellingPerformed;
accelGyroBias m_levellingBias;
bool m_calibrationPerformed;
accelGyroBias m_calibrationBias;
bool m_motorCalibrationPerformed;
QList<actuatorChannelSettings> m_actuatorSettings;

View File

@ -34,7 +34,8 @@ HEADERS += setupwizardplugin.h \
pages/savepage.h \
pages/autoupdatepage.h \
pages/cccalibrationpage.h \
cccalibrationutil.h
cccalibrationutil.h \
pages/revocalibrationpage.h
SOURCES += setupwizardplugin.cpp \
setupwizard.cpp \
@ -60,7 +61,8 @@ SOURCES += setupwizardplugin.cpp \
pages/savepage.cpp \
pages/autoupdatepage.cpp \
pages/cccalibrationpage.cpp \
cccalibrationutil.cpp
cccalibrationutil.cpp \
pages/revocalibrationpage.cpp
OTHER_FILES += SetupWizard.pluginspec
@ -82,7 +84,8 @@ FORMS += \
pages/rebootpage.ui \
pages/savepage.ui \
pages/autoupdatepage.ui \
pages/cccalibrationpage.ui
pages/cccalibrationpage.ui \
pages/revocalibrationpage.ui
RESOURCES += \
wizardResources.qrc