1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-10 18:24:11 +01:00

OP-38 Ground / Configuration gadget: automatically save results of 6-point calibration to SD (consistent with behaviour of sensor noise calibration). Other smaller updates.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1548 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2010-09-06 11:53:13 +00:00 committed by edouard
parent ce6a4325e4
commit 5c4ba7140b
3 changed files with 36 additions and 12 deletions

View File

@ -34,7 +34,7 @@
<x>10</x> <x>10</x>
<y>10</y> <y>10</y>
<width>341</width> <width>341</width>
<height>141</height> <height>131</height>
</rect> </rect>
</property> </property>
<property name="toolTip"> <property name="toolTip">
@ -100,7 +100,7 @@ Hint: run this with engines at cruising speed.</string>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
<y>390</y> <y>380</y>
<width>111</width> <width>111</width>
<height>17</height> <height>17</height>
</rect> </rect>
@ -113,7 +113,7 @@ Hint: run this with engines at cruising speed.</string>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>140</x> <x>140</x>
<y>380</y> <y>370</y>
<width>131</width> <width>131</width>
<height>31</height> <height>31</height>
</rect> </rect>
@ -171,14 +171,14 @@ Hint: run this with engines at cruising speed.</string>
</rect> </rect>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox"> <widget class="QCheckBox" name="homeLocation">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>310</x> <x>320</x>
<y>380</y> <y>370</y>
<width>201</width> <width>201</width>
<height>22</height> <height>22</height>
</rect> </rect>
@ -254,9 +254,9 @@ specific calibration button on top of the screen.</string>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>360</x> <x>370</x>
<y>10</y> <y>10</y>
<width>271</width> <width>251</width>
<height>17</height> <height>17</height>
</rect> </rect>
</property> </property>
@ -302,6 +302,19 @@ specific calibration button on top of the screen.</string>
<string>Save Position</string> <string>Save Position</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="indoorFlight">
<property name="geometry">
<rect>
<x>320</x>
<y>400</y>
<width>201</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>Indoor flight mode</string>
</property>
</widget>
</widget> </widget>
</widget> </widget>
<resources/> <resources/>

View File

@ -187,7 +187,7 @@ ConfigAHRSWidget::ConfigAHRSWidget(QWidget *parent) : ConfigTaskWidget(parent)
connect(m_ahrs->ahrsSettingsRequest, SIGNAL(clicked()), this, SLOT(ahrsSettingsRequest())); connect(m_ahrs->ahrsSettingsRequest, SIGNAL(clicked()), this, SLOT(ahrsSettingsRequest()));
connect(m_ahrs->ahrsSettingsSaveRAM, SIGNAL(clicked()), this, SLOT(ahrsSettingsSaveRAM())); connect(m_ahrs->ahrsSettingsSaveRAM, SIGNAL(clicked()), this, SLOT(ahrsSettingsSaveRAM()));
connect(m_ahrs->ahrsSettingsSaveSD, SIGNAL(clicked()), this, SLOT(ahrsSettingsSaveSD())); connect(m_ahrs->ahrsSettingsSaveSD, SIGNAL(clicked()), this, SLOT(ahrsSettingsSaveSD()));
connect(m_ahrs->sixPointsStart, SIGNAL(clicked()), this, SLOT(calibrationMode())); connect(m_ahrs->sixPointsStart, SIGNAL(clicked()), this, SLOT(sixPointCalibrationMode()));
connect(m_ahrs->sixPointsSave, SIGNAL(clicked()), this, SLOT(savePositionData())); connect(m_ahrs->sixPointsSave, SIGNAL(clicked()), this, SLOT(savePositionData()));
connect(parent, SIGNAL(autopilotConnected()),this, SLOT(ahrsSettingsRequest())); connect(parent, SIGNAL(autopilotConnected()),this, SLOT(ahrsSettingsRequest()));
@ -350,6 +350,7 @@ void ConfigAHRSWidget::attitudeRawUpdated(UAVObject * obj)
computeScaleBias(); computeScaleBias();
m_ahrs->sixPointsStart->setEnabled(true); m_ahrs->sixPointsStart->setEnabled(true);
m_ahrs->sixPointsSave->setEnabled(false); m_ahrs->sixPointsSave->setEnabled(false);
saveAHRSCalibration(); // Saves the result to SD.
/* Cleanup original settings */ /* Cleanup original settings */
obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("AHRSSettings"))); obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("AHRSSettings")));
@ -521,7 +522,10 @@ void ConfigAHRSWidget::computeScaleBias()
} }
void ConfigAHRSWidget::calibrationMode() /**
Six point calibration mode
*/
void ConfigAHRSWidget::sixPointCalibrationMode()
{ {
UAVObject *obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("AHRSCalibration"))); UAVObject *obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("AHRSCalibration")));
@ -619,8 +623,15 @@ void ConfigAHRSWidget::ahrsSettingsRequest()
UAVObject *obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("AHRSSettings"))); UAVObject *obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("AHRSSettings")));
obj->requestUpdate(); obj->requestUpdate();
UAVObjectField *field = obj->getField(QString("Algorithm")); UAVObjectField *field = obj->getField(QString("Algorithm"));
m_ahrs->algorithm->setCurrentIndex(m_ahrs->algorithm->findText(field->getValue().toString())); if (field)
m_ahrs->algorithm->setCurrentIndex(m_ahrs->algorithm->findText(field->getValue().toString()));
drawVariancesGraph(); drawVariancesGraph();
obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("HomeLocation")));
field = obj->getField(QString("Indoor"));
if (field)
m_ahrs->homeLocation->setEnabled(field->getValue().toBool());
m_ahrs->ahrsCalibStart->setEnabled(true); m_ahrs->ahrsCalibStart->setEnabled(true);
m_ahrs->sixPointsStart->setEnabled(true); m_ahrs->sixPointsStart->setEnabled(true);
m_ahrs->calibInstructions->setText(QString("Press \"Start\" above to calibrate.")); m_ahrs->calibInstructions->setText(QString("Press \"Start\" above to calibrate."));

View File

@ -100,7 +100,7 @@ private slots:
void ahrsSettingsSaveSD(); void ahrsSettingsSaveSD();
void savePositionData(); void savePositionData();
void computeScaleBias(); void computeScaleBias();
void calibrationMode(); void sixPointCalibrationMode();
void attitudeRawUpdated(UAVObject * obj); void attitudeRawUpdated(UAVObject * obj);
protected: protected:
void showEvent(QShowEvent *event); void showEvent(QShowEvent *event);