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

LP-240 Add aux/onboard Mag alarms, max deviation level settings. Renamed Tab to "Mag settings"

This commit is contained in:
Laurent Lalanne 2016-02-24 15:53:18 +01:00
parent 45c42537b1
commit 9c4b7498cd
3 changed files with 529 additions and 234 deletions

View File

@ -196,12 +196,16 @@ ConfigRevoWidget::ConfigRevoWidget(QWidget *parent) :
addWidgetBinding("AuxMagSettings", "Usage", m_ui->auxMagUsage, 0, 1, true); addWidgetBinding("AuxMagSettings", "Usage", m_ui->auxMagUsage, 0, 1, true);
addWidgetBinding("AuxMagSettings", "Type", m_ui->auxMagType, 0, 1, true); addWidgetBinding("AuxMagSettings", "Type", m_ui->auxMagType, 0, 1, true);
addWidgetBinding("RevoSettings", "MagnetometerMaxDeviation", m_ui->maxDeviationWarning, RevoSettings::MAGNETOMETERMAXDEVIATION_WARNING);
addWidgetBinding("RevoSettings", "MagnetometerMaxDeviation", m_ui->maxDeviationError, RevoSettings::MAGNETOMETERMAXDEVIATION_ERROR);
addWidgetBinding("AuxMagSettings", "BoardRotation", m_ui->auxMagRollRotation, AuxMagSettings::BOARDROTATION_ROLL); addWidgetBinding("AuxMagSettings", "BoardRotation", m_ui->auxMagRollRotation, AuxMagSettings::BOARDROTATION_ROLL);
addWidgetBinding("AuxMagSettings", "BoardRotation", m_ui->auxMagPitchRotation, AuxMagSettings::BOARDROTATION_PITCH); addWidgetBinding("AuxMagSettings", "BoardRotation", m_ui->auxMagPitchRotation, AuxMagSettings::BOARDROTATION_PITCH);
addWidgetBinding("AuxMagSettings", "BoardRotation", m_ui->auxMagYawRotation, AuxMagSettings::BOARDROTATION_YAW); addWidgetBinding("AuxMagSettings", "BoardRotation", m_ui->auxMagYawRotation, AuxMagSettings::BOARDROTATION_YAW);
connect(MagSensor::GetInstance(getObjectManager()), SIGNAL(objectUpdated(UAVObject *)), this, SLOT(onBoardAuxMagError())); connect(MagSensor::GetInstance(getObjectManager()), SIGNAL(objectUpdated(UAVObject *)), this, SLOT(onBoardAuxMagError()));
connect(MagState::GetInstance(getObjectManager()), SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateMagStatus())); connect(MagState::GetInstance(getObjectManager()), SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateMagStatus()));
connect(HomeLocation::GetInstance(getObjectManager()), SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateMagBeVector()));
addWidget(m_ui->internalAuxErrorX); addWidget(m_ui->internalAuxErrorX);
addWidget(m_ui->internalAuxErrorY); addWidget(m_ui->internalAuxErrorY);
@ -400,6 +404,8 @@ void ConfigRevoWidget::refreshWidgetsValues(UAVObject *object)
QString beStr = QString("%1:%2:%3").arg(QString::number(homeLocationData.Be[0]), QString::number(homeLocationData.Be[1]), QString::number(homeLocationData.Be[2])); QString beStr = QString("%1:%2:%3").arg(QString::number(homeLocationData.Be[0]), QString::number(homeLocationData.Be[1]), QString::number(homeLocationData.Be[2]));
m_ui->beBox->setText(beStr); m_ui->beBox->setText(beStr);
getMagBeVector();
} }
void ConfigRevoWidget::updateObjectsFromWidgets() void ConfigRevoWidget::updateObjectsFromWidgets()
@ -507,28 +513,45 @@ void ConfigRevoWidget::onBoardAuxMagError()
MagSensor::DataFields magData = magSensor->getData(); MagSensor::DataFields magData = magSensor->getData();
AuxMagSensor::DataFields auxMagData = auxMagSensor->getData(); AuxMagSensor::DataFields auxMagData = auxMagSensor->getData();
onboardMag[0] = magData.x;
onboardMag[1] = magData.y;
onboardMag[2] = magData.z;
auxMag[0] = auxMagData.x;
auxMag[1] = auxMagData.y;
auxMag[2] = auxMagData.z;
float normalizedMag[3];
float normalizedAuxMag[3];
// Smooth Mag readings // Smooth Mag readings
float alpha = 0.8f; float alpha = 0.8f;
float inv_alpha = (1.0f - alpha); float inv_alpha = (1.0f - alpha);
onboardMag[0] = (onboardMag[0] * alpha) + (magData.x * inv_alpha);
onboardMag[1] = (onboardMag[1] * alpha) + (magData.y * inv_alpha);
onboardMag[2] = (onboardMag[2] * alpha) + (magData.z * inv_alpha);
auxMag[0] = (auxMag[0] * alpha) + (auxMagData.x * inv_alpha); onboardMagFiltered[0] = (onboardMagFiltered[0] * alpha) + (onboardMag[0] * inv_alpha);
auxMag[1] = (auxMag[1] * alpha) + (auxMagData.y * inv_alpha); onboardMagFiltered[1] = (onboardMagFiltered[1] * alpha) + (onboardMag[1] * inv_alpha);
auxMag[2] = (auxMag[2] * alpha) + (auxMagData.z * inv_alpha); onboardMagFiltered[2] = (onboardMagFiltered[2] * alpha) + (onboardMag[2] * inv_alpha);
auxMagFiltered[0] = (auxMagFiltered[0] * alpha) + (auxMag[0] * inv_alpha);
auxMagFiltered[1] = (auxMagFiltered[1] * alpha) + (auxMag[1] * inv_alpha);
auxMagFiltered[2] = (auxMagFiltered[2] * alpha) + (auxMag[2] * inv_alpha);
// Normalize vectors // Normalize vectors
float magLenght = sqrt((onboardMag[0] * onboardMag[0]) + (onboardMag[1] * onboardMag[1]) + (onboardMag[2] * onboardMag[2])); float magLenght = sqrt((onboardMagFiltered[0] * onboardMagFiltered[0]) +
float auxMagLenght = sqrt((auxMag[0] * auxMag[0]) + (auxMag[1] * auxMag[1]) + (auxMag[2] * auxMag[2])); (onboardMagFiltered[1] * onboardMagFiltered[1]) +
(onboardMagFiltered[2] * onboardMagFiltered[2]));
float auxMagLenght = sqrt((auxMagFiltered[0] * auxMagFiltered[0]) +
(auxMagFiltered[1] * auxMagFiltered[1]) +
(auxMagFiltered[2] * auxMagFiltered[2]));
normalizedMag[0] = onboardMag[0] / magLenght;
normalizedMag[1] = onboardMag[1] / magLenght;
normalizedMag[2] = onboardMag[2] / magLenght;
normalizedAuxMag[0] = auxMag[0] / auxMagLenght; normalizedMag[0] = onboardMagFiltered[0] / magLenght;
normalizedAuxMag[1] = auxMag[1] / auxMagLenght; normalizedMag[1] = onboardMagFiltered[1] / magLenght;
normalizedAuxMag[2] = auxMag[2] / auxMagLenght; normalizedMag[2] = onboardMagFiltered[2] / magLenght;
normalizedAuxMag[0] = auxMagFiltered[0] / auxMagLenght;
normalizedAuxMag[1] = auxMagFiltered[1] / auxMagLenght;
normalizedAuxMag[2] = auxMagFiltered[2] / auxMagLenght;
// Calc diff and scale // Calc diff and scale
float xDiff = (normalizedMag[0] - normalizedAuxMag[0]) * 25.0f; float xDiff = (normalizedMag[0] - normalizedAuxMag[0]) * 25.0f;
@ -539,6 +562,92 @@ void ConfigRevoWidget::onBoardAuxMagError()
m_ui->internalAuxErrorX->setValue(xDiff > 50.0f ? 50.0f : xDiff < -50.0f ? -50.0f : xDiff); m_ui->internalAuxErrorX->setValue(xDiff > 50.0f ? 50.0f : xDiff < -50.0f ? -50.0f : xDiff);
m_ui->internalAuxErrorY->setValue(yDiff > 50.0f ? 50.0f : yDiff < -50.0f ? -50.0f : yDiff); m_ui->internalAuxErrorY->setValue(yDiff > 50.0f ? 50.0f : yDiff < -50.0f ? -50.0f : yDiff);
m_ui->internalAuxErrorZ->setValue(zDiff > 50.0f ? 50.0f : zDiff < -50.0f ? -50.0f : zDiff); m_ui->internalAuxErrorZ->setValue(zDiff > 50.0f ? 50.0f : zDiff < -50.0f ? -50.0f : zDiff);
updateMagAlarm(getMagError(onboardMag), getMagError(auxMag));
}
void ConfigRevoWidget::updateMagAlarm(float errorMag, float errorAuxMag)
{
#define ALARM_THRESHOLD 20
RevoSettings *revoSettings = RevoSettings::GetInstance(getObjectManager());
Q_ASSERT(revoSettings);
RevoSettings::DataFields revoSettingsData = revoSettings->getData();
QString bgColorMag = "green";
QString bgColorAuxMag = "green";
// Onboard Mag
if (errorMag < revoSettingsData.MagnetometerMaxDeviation[RevoSettings::MAGNETOMETERMAXDEVIATION_WARNING]) {
magWarningCount = 0;
magErrorCount = 0;
}
if (errorMag < revoSettingsData.MagnetometerMaxDeviation[RevoSettings::MAGNETOMETERMAXDEVIATION_ERROR]) {
magErrorCount = 0;
if (magWarningCount > ALARM_THRESHOLD) {
bgColorMag = "orange";
} else {
magWarningCount++;
}
}
if (magErrorCount > ALARM_THRESHOLD) {
bgColorMag = "red";
} else {
magErrorCount++;
}
// External Mag
if (errorAuxMag < revoSettingsData.MagnetometerMaxDeviation[RevoSettings::MAGNETOMETERMAXDEVIATION_WARNING]) {
auxMagWarningCount = 0;
auxMagErrorCount = 0;
}
if (errorAuxMag < revoSettingsData.MagnetometerMaxDeviation[RevoSettings::MAGNETOMETERMAXDEVIATION_ERROR]) {
auxMagErrorCount = 0;
if (auxMagWarningCount > ALARM_THRESHOLD) {
bgColorAuxMag = "orange";
} else {
auxMagWarningCount++;
}
}
if (auxMagErrorCount > ALARM_THRESHOLD) {
bgColorAuxMag = "red";
} else {
auxMagErrorCount++;
}
m_ui->onBoardMagStatus->setStyleSheet(
"QLabel { background-color: " + bgColorMag + ";"
"color: rgb(255, 255, 255); border-radius: 5; margin:1px; font:bold; }");
m_ui->auxMagStatus->setStyleSheet(
"QLabel { background-color: " + bgColorAuxMag + ";"
"color: rgb(255, 255, 255); border-radius: 5; margin:1px; font:bold; }");
}
float ConfigRevoWidget::getMagError(float mag[3])
{
float magnitude = sqrt((mag[0] * mag[0]) + (mag[1] * mag[1]) + (mag[2] * mag[2]));
float magnitudeBe = sqrt((magBe[0] * magBe[0]) + (magBe[1] * magBe[1]) + (magBe[2] * magBe[2]));
float invMagnitudeBe = 1.0f / magnitudeBe;
// Absolute value of relative error against Be
float error = fabsf(magnitude - magnitudeBe) * invMagnitudeBe;
return error;
}
void ConfigRevoWidget::getMagBeVector()
{
HomeLocation *homeLocation = HomeLocation::GetInstance(getObjectManager());
Q_ASSERT(homeLocation);
HomeLocation::DataFields homeLocationData = homeLocation->getData();
magBe[0] = homeLocationData.Be[0];
magBe[1] = homeLocationData.Be[1];
magBe[2] = homeLocationData.Be[2];
} }
void ConfigRevoWidget::updateMagStatus() void ConfigRevoWidget::updateMagStatus()

View File

@ -74,9 +74,14 @@ public:
float onboardMag[3]; float onboardMag[3];
float auxMag[3]; float auxMag[3];
float onboardMagFiltered[3];
float auxMagFiltered[3];
float magBe[3];
float normalizedMag[3]; int magWarningCount;
float normalizedAuxMag[3]; int magErrorCount;
int auxMagWarningCount;
int auxMagErrorCount;
private: private:
OpenPilot::SixPointCalibrationModel *m_accelCalibrationModel; OpenPilot::SixPointCalibrationModel *m_accelCalibrationModel;
@ -114,6 +119,10 @@ private slots:
void onBoardAuxMagError(); void onBoardAuxMagError();
void updateMagStatus(); void updateMagStatus();
void getMagBeVector();
void updateMagAlarm(float errorMag, float errorAuxMag);
float getMagError(float mag[3]);
void updateVisualHelp(); void updateVisualHelp();
void openHelp(); void openHelp();

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>890</width> <width>935</width>
<height>725</height> <height>726</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -955,13 +955,239 @@ A setting of 0.00 disables the filter.</string>
<bool>true</bool> <bool>true</bool>
</property> </property>
<attribute name="title"> <attribute name="title">
<string>External Mag Settings</string> <string>Mag Settings</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QGridLayout" name="gridLayout_6">
<item> <property name="leftMargin">
<layout class="QVBoxLayout" name="verticalLayout_7"> <number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item row="0" column="1">
<widget class="QGroupBox" name="gridGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>500</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>External Mag Orientation Help</string>
</property>
<layout class="QGridLayout" name="gridLayout_10">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item row="2" column="0">
<widget class="QLabel" name="label_23">
<property name="minimumSize">
<size>
<width>80</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="text">
<string>Y axis</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_22">
<property name="minimumSize">
<size>
<width>80</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="text">
<string>Z axis</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QProgressBar" name="internalAuxErrorZ">
<property name="toolTip">
<string>Difference on Z axis</string>
</property>
<property name="minimum">
<number>-50</number>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="format">
<string>%v</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QProgressBar" name="internalAuxErrorY">
<property name="toolTip">
<string>Difference on Y axis</string>
</property>
<property name="minimum">
<number>-50</number>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="format">
<string>%v</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QTextEdit" name="textEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="html">
<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:'Cantarell'; font-size:11pt; 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;The bargraphs show the difference between the onboard magnetometer and external magnetometer measurements. &lt;/p&gt;
&lt;p align=&quot;justify&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;When the external magnetometer rotation is set correctlly, all bargraphs should show all zero (bargraph centered) &lt;a name=&quot;result_box&quot;&gt;&lt;/a&gt;whatever the vehicle's orientation.&lt;/p&gt;
&lt;p align=&quot;justify&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;This assumes both magnetometers are calibrated and without alarm.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QProgressBar" name="internalAuxErrorX">
<property name="toolTip">
<string>Difference on X axis</string>
</property>
<property name="minimum">
<number>-50</number>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="textVisible">
<bool>true</bool>
</property>
<property name="format">
<string>%v</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_24">
<property name="minimumSize">
<size>
<width>80</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="text">
<string>X axis</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_7" stretch="0,0,0">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
@ -976,7 +1202,10 @@ A setting of 0.00 disables the filter.</string>
<property name="title"> <property name="title">
<string>Magnetometer Settings</string> <string>Magnetometer Settings</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_13" columnstretch="0,0,0"> <layout class="QGridLayout" name="gridLayout_13" columnstretch="0,0,0,0">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_31"> <widget class="QLabel" name="label_31">
<property name="minimumSize"> <property name="minimumSize">
@ -1003,8 +1232,14 @@ A setting of 0.00 disables the filter.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1" colspan="2">
<widget class="QComboBox" name="auxMagType"> <widget class="QComboBox" name="auxMagType">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
@ -1016,10 +1251,10 @@ A setting of 0.00 disables the filter.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1" colspan="2">
<widget class="QComboBox" name="auxMagUsage"> <widget class="QComboBox" name="auxMagUsage">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -1035,13 +1270,55 @@ A setting of 0.00 disables the filter.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2"> <item row="2" column="1">
<spacer name="horizontalSpacer_5"> <widget class="QDoubleSpinBox" name="maxDeviationWarning">
<property name="toolTip">
<string>Warning level in percent (default 5%)</string>
</property>
<property name="minimum">
<double>0.010000000000000</double>
</property>
<property name="maximum">
<double>0.150000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
<property name="value">
<double>0.050000000000000</double>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QDoubleSpinBox" name="maxDeviationError">
<property name="toolTip">
<string>Error level in percent (default 15%)</string>
</property>
<property name="minimum">
<double>0.150000000000000</double>
</property>
<property name="maximum">
<double>0.300000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Warning / Error levels:</string>
</property>
</widget>
</item>
<item row="2" column="3">
<spacer name="horizontalSpacer_4">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum> <enum>QSizePolicy::Expanding</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -1057,7 +1334,7 @@ A setting of 0.00 disables the filter.</string>
<item> <item>
<widget class="QGroupBox" name="groupBox_9"> <widget class="QGroupBox" name="groupBox_9">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -1065,7 +1342,68 @@ A setting of 0.00 disables the filter.</string>
<property name="title"> <property name="title">
<string>Magnetometer Status</string> <string>Magnetometer Status</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_14" columnstretch="0,0"> <layout class="QGridLayout" name="gridLayout_14" columnstretch="0,0,0,0">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item row="4" column="1">
<widget class="QLabel" name="onBoardMagStatus">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>35</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: green;
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="text">
<string>Onboard</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLabel" name="auxMagStatus">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>35</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: green;
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="text">
<string>AuxMag</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QLabel" name="magStatusSource"> <widget class="QLabel" name="magStatusSource">
<property name="sizePolicy"> <property name="sizePolicy">
@ -1092,13 +1430,48 @@ A setting of 0.00 disables the filter.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Mag alarms:</string>
</property>
</widget>
</item>
<item row="4" column="3">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox_7"> <widget class="QGroupBox" name="groupBox_7">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -1107,6 +1480,9 @@ A setting of 0.00 disables the filter.</string>
<string>Rotate Magnetometer Orientation</string> <string>Rotate Magnetometer Orientation</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_12" columnstretch="0,0,0"> <layout class="QGridLayout" name="gridLayout_12" columnstretch="0,0,0">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_29"> <widget class="QLabel" name="label_29">
<property name="minimumSize"> <property name="minimumSize">
@ -1253,208 +1629,6 @@ font:bold;</string>
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="QGroupBox" name="gridGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>500</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>External Mag Orientation Help</string>
</property>
<layout class="QGridLayout" name="gridLayout_10">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item row="3" column="0">
<widget class="QLabel" name="label_22">
<property name="minimumSize">
<size>
<width>80</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="text">
<string>Z axis</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QProgressBar" name="internalAuxErrorY">
<property name="toolTip">
<string>Difference on Y axis</string>
</property>
<property name="minimum">
<number>-50</number>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="format">
<string>%v</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QProgressBar" name="internalAuxErrorZ">
<property name="toolTip">
<string>Difference on Z axis</string>
</property>
<property name="minimum">
<number>-50</number>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="format">
<string>%v</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_23">
<property name="minimumSize">
<size>
<width>80</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="text">
<string>Y axis</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QProgressBar" name="internalAuxErrorX">
<property name="toolTip">
<string>Difference on X axis</string>
</property>
<property name="minimum">
<number>-50</number>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="textVisible">
<bool>true</bool>
</property>
<property name="format">
<string>%v</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_24">
<property name="minimumSize">
<size>
<width>80</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="text">
<string>X axis</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QTextEdit" name="textEdit">
<property name="html">
<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:'Cantarell'; font-size:11pt; 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;The bargraphs show the difference between the onboard magnetometer and external magnetometer measurements. &lt;/p&gt;
&lt;p align=&quot;justify&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;When the external magnetometer rotation is set correctlly, all bargraphs should show all zero (bargraph centered) &lt;a name=&quot;result_box&quot;&gt;&lt;/a&gt;whatever the vehicle's orientation.&lt;/p&gt;
&lt;p align=&quot;justify&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;This assumes the onboard magnetometer is also calibrated (Mag use=Both).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>
@ -1462,6 +1636,9 @@ p, li { white-space: pre-wrap; }
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>