Browse Source

Better sensor cal

- cancel support
- mag rotation images
- set board rotation before cal
- set compass rotation after mag cal
QGC4.4
Don Gagne 10 years ago
parent
commit
ea433369ad
  1. 344
      src/AutoPilotPlugins/PX4/SensorsComponent.qml
  2. 346
      src/AutoPilotPlugins/PX4/SensorsComponentController.cc
  3. 66
      src/AutoPilotPlugins/PX4/SensorsComponentController.h

344
src/AutoPilotPlugins/PX4/SensorsComponent.qml

@ -24,6 +24,7 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2 import QtQuick.Controls.Styles 1.2
import QtQuick.Dialogs 1.2
import QGroundControl.FactSystem 1.0 import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0 import QGroundControl.FactControls 1.0
@ -66,6 +67,25 @@ Rectangle {
"ROTATION_ROLL_270_YAW_270" "ROTATION_ROLL_270_YAW_270"
] ]
readonly property string statusTextAreaDefaultText: "Sensor config is a work in progress. Not all visuals for all calibration types fully implemented.\n\n" +
"For Compass calibration you will need to rotate your vehicle through a number of positions. For this calibration is is best " +
"to be connected to you vehicle via radio instead of USB since the USB cable will likely get in the way.\n\n" +
"For Gyroscope calibration you will need to place your vehicle right side up on solid surface and leave it still.\n\n" +
"For Accelerometer calibration you will need to place your vehicle on all six sides and hold it there for a few seconds.\n\n" +
"For Airspeed calibration you will need to keep your airspeed sensor out of any wind.\n\n"
Fact { id: cal_mag0_id; name: "CAL_MAG0_ID" }
Fact { id: cal_mag1_id; name: "CAL_MAG1_ID" }
Fact { id: cal_mag2_id; name: "CAL_MAG2_ID" }
Fact { id: cal_mag0_rot; name: "CAL_MAG0_ROT" }
Fact { id: cal_mag1_rot; name: "CAL_MAG1_ROT" }
Fact { id: cal_mag2_rot; name: "CAL_MAG2_ROT" }
// Id > = signals compass available, rot < 0 signals internal compass
property bool showCompass0Rot: cal_mag0_id.value > 0 && cal_mag0_rot.value >= 0
property bool showCompass1Rot: cal_mag1_id.value > 0 && cal_mag1_rot.value >= 0
property bool showCompass2Rot: cal_mag2_id.value > 0 && cal_mag2_rot.value >= 0
color: qgcPal.window color: qgcPal.window
// We use this bogus loader just so we can get an onLoaded signal to hook to in order to // We use this bogus loader just so we can get an onLoaded signal to hook to in order to
@ -83,6 +103,227 @@ Rectangle {
controller.gyroButton = gyroButton controller.gyroButton = gyroButton
controller.accelButton = accelButton controller.accelButton = accelButton
controller.airspeedButton = airspeedButton controller.airspeedButton = airspeedButton
controller.cancelButton = cancelButton
controller.orientationCalAreaHelpText = orientationCalAreaHelpText
}
}
Connections {
target: controller
onResetStatusTextArea: statusTextArea.text = statusTextAreaDefaultText
onSetCompassRotations: showCompassRotationOverlay()
}
Rectangle {
id: overlay
anchors.fill: parent
color: qgcPal.window
opacity: 0.75
z: 100
visible: false
}
Rectangle {
width: 300
height: 100
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
color: qgcPal.window
border.width: 1
border.color: qgcPal.text
visible: controller.waitingForCancel
z: overlay.z + 1
onVisibleChanged: {
overlay.visible = visible
}
QGCLabel {
anchors.fill: parent
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
text: "Waiting for Cancel (may take a few seconds)"
}
}
Rectangle {
property string calibrationType
id: boardRotationOverlay
width: 300
height: boardRotationOverlayColumn.height + 11
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
color: qgcPal.window
border.width: 1
border.color: qgcPal.text
visible: false
z: overlay.z + 1
Column {
id: boardRotationOverlayColumn
anchors.topMargin: 10
anchors.top: parent.top
width: parent.width
spacing: 10
Column {
anchors.leftMargin: 10
anchors.rightMargin: 10
anchors.left: parent.left
anchors.right: parent.right
spacing: 10
QGCLabel {
width: parent.width
wrapMode: Text.WordWrap
text: "Please check and/or update board rotation before calibrating"
}
FactComboBox {
width: rotationColumnWidth
model: rotations
fact: Fact { name: "SENS_BOARD_ROT" }
}
}
QGCButton {
x: 1
width: parent.width - 2
primary: true
text: "OK"
onClicked: {
boardRotationOverlay.visible = false
overlay.visible = false
if (boardRotationOverlay.calibrationType == "gyro") {
controller.calibrateGyro()
} else if (boardRotationOverlay.calibrationType == "accel") {
controller.calibrateAccel()
} else if (boardRotationOverlay.calibrationType == "compass") {
controller.calibrateCompass()
}
}
}
}
}
function showBoardRotationOverlay(calibrationType) {
boardRotationOverlay.calibrationType = calibrationType
boardRotationOverlay.visible = true
overlay.visible = true
}
Rectangle {
id: compassRotationOverlay
width: 300
height: compassRotationOverlayColumn.height + 11
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
color: qgcPal.window
border.width: 1
border.color: qgcPal.text
visible: false
z: overlay.z + 1
Column {
id: compassRotationOverlayColumn
anchors.topMargin: 10
anchors.top: parent.top
width: parent.width
spacing: 10
Column {
anchors.leftMargin: 10
anchors.rightMargin: 10
anchors.left: parent.left
anchors.right: parent.right
spacing: 10
QGCLabel {
width: parent.width
wrapMode: Text.WordWrap
text: "Please check and/or update compass rotation(s)"
}
// Compass 0 rotation
Component {
id: compass0ComponentLabel
QGCLabel { text: "Compass Orientation" }
}
Component {
id: compass0ComponentCombo
FactComboBox {
id: compass0RotationCombo
width: rotationColumnWidth
model: rotations
fact: Fact { name: "CAL_MAG0_ROT" }
}
}
Loader { sourceComponent: showCompass0Rot ? compass0ComponentLabel : null }
Loader { sourceComponent: showCompass0Rot ? compass0ComponentCombo : null }
// Compass 1 rotation
Component {
id: compass1ComponentLabel
QGCLabel { text: "Compass 1 Orientation" }
}
Component {
id: compass1ComponentCombo
FactComboBox {
id: compass1RotationCombo
width: rotationColumnWidth
model: rotations
fact: Fact { name: "CAL_MAG1_ROT" }
}
}
Loader { sourceComponent: showCompass1Rot ? compass1ComponentLabel : null }
Loader { sourceComponent: showCompass1Rot ? compass1ComponentCombo : null }
// Compass 2 rotation
Component {
id: compass2ComponentLabel
QGCLabel { text: "Compass 2 Orientation" }
}
Component {
id: compass2ComponentCombo
FactComboBox {
id: compass1RotationCombo
width: rotationColumnWidth
model: rotations
fact: Fact { name: "CAL_MAG2_ROT" }
}
}
Loader { sourceComponent: showCompass2Rot ? compass2ComponentLabel : null }
Loader { sourceComponent: showCompass2Rot ? compass2ComponentCombo : null }
}
QGCButton {
x: 1
width: parent.width - 2
primary: true
text: "OK"
onClicked: {
compassRotationOverlay.visible = false
overlay.visible = false
}
}
}
}
function showCompassRotationOverlay() {
if (showCompass0Rot || showCompass1Rot || showCompass2Rot) {
compassRotationOverlay.visible = true
overlay.visible = true
} }
} }
@ -110,7 +351,8 @@ Rectangle {
width: parent.buttonWidth width: parent.buttonWidth
text: "Compass" text: "Compass"
indicatorGreen: fact.value != 0 indicatorGreen: fact.value != 0
onClicked: controller.calibrateCompass()
onClicked: showBoardRotationOverlay("compass")
} }
IndicatorButton { IndicatorButton {
@ -120,7 +362,8 @@ Rectangle {
width: parent.buttonWidth width: parent.buttonWidth
text: "Gyroscope" text: "Gyroscope"
indicatorGreen: fact.value != 0 indicatorGreen: fact.value != 0
onClicked: controller.calibrateGyro()
onClicked: showBoardRotationOverlay("gyro")
} }
IndicatorButton { IndicatorButton {
@ -130,7 +373,8 @@ Rectangle {
width: parent.buttonWidth width: parent.buttonWidth
text: "Accelerometer" text: "Accelerometer"
indicatorGreen: fact.value != 0 indicatorGreen: fact.value != 0
onClicked: controller.calibrateAccel()
onClicked: showBoardRotationOverlay("accel")
} }
IndicatorButton { IndicatorButton {
@ -143,6 +387,13 @@ Rectangle {
indicatorGreen: fact.value != 0 indicatorGreen: fact.value != 0
onClicked: controller.calibrateAirspeed() onClicked: controller.calibrateAirspeed()
} }
QGCButton {
id: cancelButton
text: "Cancel"
enabled: false
onClicked: controller.cancelCalibration()
}
} }
Item { height: 20; width: 10 } // spacer Item { height: 20; width: 10 } // spacer
@ -167,12 +418,7 @@ Rectangle {
height: parent.height height: parent.height
readOnly: true readOnly: true
frameVisible: false frameVisible: false
text: "Sensor config is a work in progress. Not all visuals for all calibration types fully implemented.\n\n" + text: statusTextAreaDefaultText
"For Compass calibration you will need to rotate your vehicle through a number of positions. For this calibration is is best " +
"to be connected to you vehicle via radio instead of USB since the USB cable will likely get in the way.\n\n" +
"For Gyroscope calibration you will need to place your vehicle right side up on solid surface and leave it still.\n\n" +
"For Accelerometer calibration you will need to place your vehicle on all six sides and hold it there for a few seconds.\n\n" +
"For Airspeed calibration you will need to keep your airspeed sensor out of any wind.\n\n"
style: TextAreaStyle { style: TextAreaStyle {
textColor: qgcPal.text textColor: qgcPal.text
@ -181,29 +427,6 @@ Rectangle {
} }
Rectangle { Rectangle {
id: gyroCalArea
width: parent.calDisplayAreaWidth
height: parent.height
visible: controller.showGyroCalArea
color: qgcPal.windowShade
Column {
width: parent.width
QGCLabel {
text: "Place your vehicle upright on a solid surface and hold it still."
}
VehicleRotationCal {
calValid: true
calInProgress: controller.gyroCalInProgress
imageSource: "qrc:///qml/VehicleDown.png"
}
}
}
Rectangle {
id: orientationCalArea id: orientationCalArea
width: parent.calDisplayAreaWidth width: parent.calDisplayAreaWidth
height: parent.height height: parent.height
@ -211,53 +434,58 @@ Rectangle {
color: qgcPal.windowShade color: qgcPal.windowShade
QGCLabel { QGCLabel {
id: calAreaLabel id: orientationCalAreaHelpText
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
font.pointSize: screenTools.fontPointFactor * (17);
text: "Place your vehicle into each of the positions below and hold still. Once that position is completed you can move to another."
} }
Flow { Flow {
y: calAreaLabel.height y: orientationCalAreaHelpText.height
width: parent.width width: parent.width
height: parent.height - calAreaLabel.implicitHeight height: parent.height - orientationCalAreaHelpText.implicitHeight
spacing: 5 spacing: 5
VehicleRotationCal { VehicleRotationCal {
visible: controller.orientationCalDownSideVisible
calValid: controller.orientationCalDownSideDone calValid: controller.orientationCalDownSideDone
calInProgress: controller.orientationCalDownSideInProgress calInProgress: controller.orientationCalDownSideInProgress
calInProgressText: controller.calInProgressText calInProgressText: controller.orientationCalDownSideRotate ? "Rotate" : "Hold Still"
imageSource: "qrc:///qml/VehicleDown.png" imageSource: controller.orientationCalDownSideRotate ? "qrc:///qml/VehicleDownRotate.png" : "qrc:///qml/VehicleDown.png"
} }
VehicleRotationCal { VehicleRotationCal {
visible: controller.orientationCalUpsideDownSideVisible
calValid: controller.orientationCalUpsideDownSideDone calValid: controller.orientationCalUpsideDownSideDone
calInProgress: controller.orientationCalUpsideDownSideInProgress calInProgress: controller.orientationCalUpsideDownSideInProgress
calInProgressText: controller.calInProgressText calInProgressText: "Hold Still"
imageSource: "qrc:///qml/VehicleUpsideDown.png" imageSource: "qrc:///qml/VehicleUpsideDown.png"
} }
VehicleRotationCal { VehicleRotationCal {
visible: controller.orientationCalNoseDownSideVisible
calValid: controller.orientationCalNoseDownSideDone calValid: controller.orientationCalNoseDownSideDone
calInProgress: controller.orientationCalNoseDownSideInProgress calInProgress: controller.orientationCalNoseDownSideInProgress
calInProgressText: controller.calInProgressText calInProgressText: controller.orientationCalNoseDownSideRotate ? "Rotate" : "Hold Still"
imageSource: "qrc:///qml/VehicleNoseDown.png" imageSource: controller.orientationCalNoseDownSideRotate ? "qrc:///qml/VehicleNoseDownRotate.png" : "qrc:///qml/VehicleNoseDown.png"
} }
VehicleRotationCal { VehicleRotationCal {
visible: controller.orientationCalTailDownSideVisible
calValid: controller.orientationCalTailDownSideDone calValid: controller.orientationCalTailDownSideDone
calInProgress: controller.orientationCalTailDownSideInProgress calInProgress: controller.orientationCalTailDownSideInProgress
calInProgressText: controller.calInProgressText calInProgressText: "Hold Still"
imageSource: "qrc:///qml/VehicleTailDown.png" imageSource: "qrc:///qml/VehicleTailDown.png"
} }
VehicleRotationCal { VehicleRotationCal {
visible: controller.orientationCalLeftSideVisible
calValid: controller.orientationCalLeftSideDone calValid: controller.orientationCalLeftSideDone
calInProgress: controller.orientationCalLeftSideInProgress calInProgress: controller.orientationCalLeftSideInProgress
calInProgressText: controller.calInProgressText calInProgressText: controller.orientationCalLeftSideRotate ? "Rotate" : "Hold Still"
imageSource: "qrc:///qml/VehicleLeft.png" imageSource: controller.orientationCalLeftSideRotate ? "qrc:///qml/VehicleLeftRotate.png" : "qrc:///qml/VehicleLeft.png"
} }
VehicleRotationCal { VehicleRotationCal {
visible: controller.orientationCalRightSideVisible
calValid: controller.orientationCalRightSideDone calValid: controller.orientationCalRightSideDone
calInProgress: controller.orientationCalRightSideInProgress calInProgress: controller.orientationCalRightSideInProgress
calInProgressText: controller.calInProgressText calInProgressText: "Hold Still"
imageSource: "qrc:///qml/VehicleRight.png" imageSource: "qrc:///qml/VehicleRight.png"
} }
} }
@ -277,12 +505,12 @@ Rectangle {
// Compass 0 rotation // Compass 0 rotation
Component { Component {
id: compass0ComponentLabel id: compass0ComponentLabel2
QGCLabel { text: "Compass Orientation" } QGCLabel { text: "Compass Orientation" }
} }
Component { Component {
id: compass0ComponentCombo id: compass0ComponentCombo2
FactComboBox { FactComboBox {
id: compass0RotationCombo id: compass0RotationCombo
@ -291,17 +519,17 @@ Rectangle {
fact: Fact { name: "CAL_MAG0_ROT" } fact: Fact { name: "CAL_MAG0_ROT" }
} }
} }
Loader { sourceComponent: controller.showCompass0 ? compass0ComponentLabel : null } Loader { sourceComponent: showCompass0Rot ? compass0ComponentLabel2 : null }
Loader { sourceComponent: controller.showCompass0 ? compass0ComponentCombo : null } Loader { sourceComponent: showCompass0Rot ? compass0ComponentCombo2 : null }
// Compass 1 rotation // Compass 1 rotation
Component { Component {
id: compass1ComponentLabel id: compass1ComponentLabel2
QGCLabel { text: "Compass 1 Orientation" } QGCLabel { text: "Compass 1 Orientation" }
} }
Component { Component {
id: compass1ComponentCombo id: compass1ComponentCombo2
FactComboBox { FactComboBox {
id: compass1RotationCombo id: compass1RotationCombo
@ -310,17 +538,17 @@ Rectangle {
fact: Fact { name: "CAL_MAG1_ROT" } fact: Fact { name: "CAL_MAG1_ROT" }
} }
} }
Loader { sourceComponent: controller.showCompass1 ? compass1ComponentLabel : null } Loader { sourceComponent: showCompass1Rot ? compass1ComponentLabel2 : null }
Loader { sourceComponent: controller.showCompass1 ? compass1ComponentCombo : null } Loader { sourceComponent: showCompass1Rot ? compass1ComponentCombo2 : null }
// Compass 2 rotation // Compass 2 rotation
Component { Component {
id: compass2ComponentLabel id: compass2ComponentLabel2
QGCLabel { text: "Compass 2 Orientation" } QGCLabel { text: "Compass 2 Orientation" }
} }
Component { Component {
id: compass2ComponentCombo id: compass2ComponentCombo2
FactComboBox { FactComboBox {
id: compass1RotationCombo id: compass1RotationCombo
@ -329,8 +557,8 @@ Rectangle {
fact: Fact { name: "CAL_MAG2_ROT" } fact: Fact { name: "CAL_MAG2_ROT" }
} }
} }
Loader { sourceComponent: controller.showCompass2 ? compass2ComponentLabel : null } Loader { sourceComponent: showCompass2Rot ? compass2ComponentLabel2 : null }
Loader { sourceComponent: controller.showCompass2 ? compass2ComponentCombo : null } Loader { sourceComponent: showCompass2Rot ? compass2ComponentCombo2 : null }
} }
} }
} }

346
src/AutoPilotPlugins/PX4/SensorsComponentController.cc

@ -36,11 +36,12 @@ SensorsComponentController::SensorsComponentController(AutoPilotPlugin* autopilo
QObject(parent), QObject(parent),
_statusLog(NULL), _statusLog(NULL),
_progressBar(NULL), _progressBar(NULL),
_showGyroCalArea(false), _compassButton(NULL),
_gyroButton(NULL),
_accelButton(NULL),
_airspeedButton(NULL),
_cancelButton(NULL),
_showOrientationCalArea(false), _showOrientationCalArea(false),
_showCompass0(false),
_showCompass1(false),
_showCompass2(false),
_gyroCalInProgress(false), _gyroCalInProgress(false),
_magCalInProgress(false), _magCalInProgress(false),
_accelCalInProgress(false), _accelCalInProgress(false),
@ -50,18 +51,31 @@ SensorsComponentController::SensorsComponentController(AutoPilotPlugin* autopilo
_orientationCalRightSideDone(false), _orientationCalRightSideDone(false),
_orientationCalNoseDownSideDone(false), _orientationCalNoseDownSideDone(false),
_orientationCalTailDownSideDone(false), _orientationCalTailDownSideDone(false),
_orientationCalDownSideVisible(false),
_orientationCalUpsideDownSideVisible(false),
_orientationCalLeftSideVisible(false),
_orientationCalRightSideVisible(false),
_orientationCalNoseDownSideVisible(false),
_orientationCalTailDownSideVisible(false),
_orientationCalDownSideInProgress(false), _orientationCalDownSideInProgress(false),
_orientationCalUpsideDownSideInProgress(false), _orientationCalUpsideDownSideInProgress(false),
_orientationCalLeftSideInProgress(false), _orientationCalLeftSideInProgress(false),
_orientationCalRightSideInProgress(false), _orientationCalRightSideInProgress(false),
_orientationCalNoseDownSideInProgress(false), _orientationCalNoseDownSideInProgress(false),
_orientationCalTailDownSideInProgress(false), _orientationCalTailDownSideInProgress(false),
_textLoggingStarted(false), _orientationCalDownSideRotate(false),
_orientationCalLeftSideRotate(false),
_orientationCalNoseDownSideRotate(false),
_unknownFirmwareVersion(false),
_waitingForCancel(false),
_autopilot(autopilot) _autopilot(autopilot)
{ {
Q_ASSERT(_autopilot); Q_ASSERT(_autopilot);
Q_ASSERT(_autopilot->pluginReady()); Q_ASSERT(_autopilot->pluginReady());
_uas = _autopilot->uas();
Q_ASSERT(_uas);
// Mag rotation parameters are optional // Mag rotation parameters are optional
_showCompass0 = _autopilot->parameterExists("CAL_MAG0_ROT") && _showCompass0 = _autopilot->parameterExists("CAL_MAG0_ROT") &&
_autopilot->getParameterFact("CAL_MAG0_ROT")->value().toInt() >= 0; _autopilot->getParameterFact("CAL_MAG0_ROT")->value().toInt() >= 0;
@ -84,89 +98,115 @@ void SensorsComponentController::_appendStatusLog(const QString& text)
Q_ARG(QVariant, varText)); Q_ARG(QVariant, varText));
} }
void SensorsComponentController::_startCalibration(void) void SensorsComponentController::_startLogCalibration(void)
{ {
_beginTextLogging(); _unknownFirmwareVersion = false;
_hideAllCalAreas(); _hideAllCalAreas();
connect(_uas, &UASInterface::textMessageReceived, this, &SensorsComponentController::_handleUASTextMessage);
_cancelButton->setEnabled(false);
}
void SensorsComponentController::_startVisualCalibration(void)
{
_compassButton->setEnabled(false); _compassButton->setEnabled(false);
_gyroButton->setEnabled(false); _gyroButton->setEnabled(false);
_accelButton->setEnabled(false); _accelButton->setEnabled(false);
_airspeedButton->setEnabled(false); _airspeedButton->setEnabled(false);
_cancelButton->setEnabled(true);
_progressBar->setProperty("value", 0);
} }
void SensorsComponentController::_stopCalibration(bool failed) void SensorsComponentController::_stopCalibration(SensorsComponentController::StopCalibrationCode code)
{ {
_magCalInProgress = false; disconnect(_uas, &UASInterface::textMessageReceived, this, &SensorsComponentController::_handleUASTextMessage);
_accelCalInProgress = false;
_compassButton->setEnabled(true); _compassButton->setEnabled(true);
_gyroButton->setEnabled(true); _gyroButton->setEnabled(true);
_accelButton->setEnabled(true); _accelButton->setEnabled(true);
_airspeedButton->setEnabled(true); _airspeedButton->setEnabled(true);
_cancelButton->setEnabled(false);
if (code == StopCalibrationSuccess) {
_orientationCalDownSideDone = true;
_orientationCalUpsideDownSideDone = true;
_orientationCalLeftSideDone = true;
_orientationCalRightSideDone = true;
_orientationCalTailDownSideDone = true;
_orientationCalNoseDownSideDone = true;
_orientationCalDownSideInProgress = false;
_orientationCalUpsideDownSideInProgress = false;
_orientationCalLeftSideInProgress = false;
_orientationCalRightSideInProgress = false;
_orientationCalNoseDownSideInProgress = false;
_orientationCalTailDownSideInProgress = false;
emit orientationCalSidesDoneChanged();
emit orientationCalSidesInProgressChanged();
_progressBar->setProperty("value", 1);
} else {
_progressBar->setProperty("value", 0);
}
_waitingForCancel = false;
emit waitingForCancelChanged();
_progressBar->setProperty("value", failed ? 0 : 1);
_updateAndEmitGyroCalInProgress(false);
_refreshParams(); _refreshParams();
if (failed) { switch (code) {
QGCMessageBox::warning("Calibration", "Calibration failed. Calibration log will be displayed."); case StopCalibrationSuccess:
_orientationCalAreaHelpText->setProperty("text", "Calibration complete");
emit resetStatusTextArea();
if (_magCalInProgress) {
emit setCompassRotations();
}
break;
case StopCalibrationCancelled:
emit resetStatusTextArea();
_hideAllCalAreas();
break;
default:
// Assume failed
_hideAllCalAreas(); _hideAllCalAreas();
QGCMessageBox::warning("Calibration", "Calibration failed. Calibration log will be displayed.");
break;
} }
_magCalInProgress = false;
_accelCalInProgress = false;
_gyroCalInProgress = false;
} }
void SensorsComponentController::calibrateGyro(void) void SensorsComponentController::calibrateGyro(void)
{ {
_startCalibration(); _startLogCalibration();
_uas->startCalibration(UASInterface::StartCalibrationGyro);
UASInterface* uas = _autopilot->uas();
Q_ASSERT(uas);
uas->executeCommand(MAV_CMD_PREFLIGHT_CALIBRATION, 1, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0);
} }
void SensorsComponentController::calibrateCompass(void) void SensorsComponentController::calibrateCompass(void)
{ {
_startCalibration(); _startLogCalibration();
_uas->startCalibration(UASInterface::StartCalibrationMag);
UASInterface* uas = _autopilot->uas();
Q_ASSERT(uas);
uas->executeCommand(MAV_CMD_PREFLIGHT_CALIBRATION, 1, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0);
} }
void SensorsComponentController::calibrateAccel(void) void SensorsComponentController::calibrateAccel(void)
{ {
_startCalibration(); _startLogCalibration();
_uas->startCalibration(UASInterface::StartCalibrationAccel);
UASInterface* uas = _autopilot->uas();
Q_ASSERT(uas);
uas->executeCommand(MAV_CMD_PREFLIGHT_CALIBRATION, 1, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0);
} }
void SensorsComponentController::calibrateAirspeed(void) void SensorsComponentController::calibrateAirspeed(void)
{ {
_startCalibration(); _startLogCalibration();
_uas->startCalibration(UASInterface::StartCalibrationAirspeed);
UASInterface* uas = _autopilot->uas();
Q_ASSERT(uas);
uas->executeCommand(MAV_CMD_PREFLIGHT_CALIBRATION, 1, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0);
}
void SensorsComponentController::_beginTextLogging(void)
{
if (!_textLoggingStarted) {
_textLoggingStarted = true;
UASInterface* uas = _autopilot->uas();
Q_ASSERT(uas);
connect(uas, &UASInterface::textMessageReceived, this, &SensorsComponentController::_handleUASTextMessage);
}
} }
void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, int severity, QString text) void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, int severity, QString text)
{ {
QString startingSidePrefix("Hold still, starting to measure ");
QString sideDoneSuffix(" side done, rotate to a different side");
QString orientationDetectedSuffix(" orientation detected");
Q_UNUSED(compId); Q_UNUSED(compId);
Q_UNUSED(severity); Q_UNUSED(severity);
@ -176,14 +216,6 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in
return; return;
} }
QStringList ignorePrefixList;
ignorePrefixList << "[cmd]" << "[mavlink pm]" << "[ekf check]" << "[pm]" << "[inav]" << "IN AIR MODE" << "LANDED MODE";
foreach (QString ignorePrefix, ignorePrefixList) {
if (text.startsWith(ignorePrefix)) {
return;
}
}
if (text.contains("progress <")) { if (text.contains("progress <")) {
QString percent = text.split("<").last().split(">").first(); QString percent = text.split("<").last().split(">").first();
bool ok; bool ok;
@ -196,18 +228,37 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in
} }
_appendStatusLog(text); _appendStatusLog(text);
qDebug() << text;
if (text == "gyro calibration: started") { if (_unknownFirmwareVersion) {
_updateAndEmitShowGyroCalArea(true); // We don't know how to do visual cal with the version of firwmare
_updateAndEmitGyroCalInProgress(true); return;
} else if (text == "accel calibration: started" || text == "mag calibration: started") { }
if (text == "accel calibration: started") {
_accelCalInProgress = true; // All calibration messages start with [cal]
_updateAndEmitCalInProgressText("Hold Still"); QString calPrefix("[cal] ");
} else { if (!text.startsWith(calPrefix)) {
_updateAndEmitCalInProgressText("Rotate"); return;
_magCalInProgress = true;
} }
text = text.right(text.length() - calPrefix.length());
QString calStartPrefix("calibration started: ");
if (text.startsWith(calStartPrefix)) {
text = text.right(text.length() - calStartPrefix.length());
// Split version number and cal type
QStringList parts = text.split(" ");
if (parts.count() != 2 && parts[0].toInt() != 1) {
_unknownFirmwareVersion = true;
qDebug() << "Unknown cal firmware version, using log";
return;
}
_startVisualCalibration();
text = parts[1];
if (text == "accel" || text == "mag" || text == "gyro") {
// Reset all progress indication
_orientationCalDownSideDone = false; _orientationCalDownSideDone = false;
_orientationCalUpsideDownSideDone = false; _orientationCalUpsideDownSideDone = false;
_orientationCalLeftSideDone = false; _orientationCalLeftSideDone = false;
@ -220,114 +271,136 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in
_orientationCalRightSideInProgress = false; _orientationCalRightSideInProgress = false;
_orientationCalNoseDownSideInProgress = false; _orientationCalNoseDownSideInProgress = false;
_orientationCalTailDownSideInProgress = false; _orientationCalTailDownSideInProgress = false;
// Reset all visibility
_orientationCalDownSideVisible = false;
_orientationCalUpsideDownSideVisible = false;
_orientationCalLeftSideVisible = false;
_orientationCalRightSideVisible = false;
_orientationCalTailDownSideVisible = false;
_orientationCalNoseDownSideVisible = false;
_orientationCalAreaHelpText->setProperty("text", "Place your vehicle into one of the Incomplete orientations shown below and hold it still");
if (text == "accel") {
_accelCalInProgress = true;
_orientationCalDownSideVisible = true;
_orientationCalUpsideDownSideVisible = true;
_orientationCalLeftSideVisible = true;
_orientationCalRightSideVisible = true;
_orientationCalTailDownSideVisible = true;
_orientationCalNoseDownSideVisible = true;
} else if (text == "mag") {
_magCalInProgress = true;
_orientationCalDownSideVisible = true;
_orientationCalLeftSideVisible = true;
_orientationCalNoseDownSideVisible = true;
} else if (text == "gyro") {
_gyroCalInProgress = true;
_orientationCalDownSideVisible = true;
} else {
Q_ASSERT(false);
}
emit orientationCalSidesDoneChanged(); emit orientationCalSidesDoneChanged();
emit orientationCalSidesVisibleChanged();
emit orientationCalSidesInProgressChanged(); emit orientationCalSidesInProgressChanged();
_updateAndEmitShowOrientationCalArea(true); _updateAndEmitShowOrientationCalArea(true);
} else if (text.startsWith(startingSidePrefix)) {
QString side = text.right(text.length() - startingSidePrefix.length()).section(" ", 0, 0);
qDebug() << "Side started" << side;
if (side == "down") {
_orientationCalDownSideInProgress = true;
} else if (side == "up") {
_orientationCalUpsideDownSideInProgress = true;
} else if (side == "left") {
_orientationCalLeftSideInProgress = true;
} else if (side == "right") {
_orientationCalRightSideInProgress = true;
} else if (side == "front") {
_orientationCalNoseDownSideInProgress = true;
} else if (side == "back") {
_orientationCalTailDownSideInProgress = true;
} }
emit orientationCalSidesInProgressChanged(); return;
} else if (text.endsWith(orientationDetectedSuffix)) { }
if (text.endsWith("orientation detected")) {
QString side = text.section(" ", 0, 0); QString side = text.section(" ", 0, 0);
qDebug() << "Side started" << side; qDebug() << "Side started" << side;
if (side == "down") { if (side == "down") {
_orientationCalDownSideInProgress = true; _orientationCalDownSideInProgress = true;
if (_magCalInProgress) {
_orientationCalDownSideRotate = true;
}
} else if (side == "up") { } else if (side == "up") {
_orientationCalUpsideDownSideInProgress = true; _orientationCalUpsideDownSideInProgress = true;
} else if (side == "left") { } else if (side == "left") {
_orientationCalLeftSideInProgress = true; _orientationCalLeftSideInProgress = true;
if (_magCalInProgress) {
_orientationCalLeftSideRotate = true;
}
} else if (side == "right") { } else if (side == "right") {
_orientationCalRightSideInProgress = true; _orientationCalRightSideInProgress = true;
} else if (side == "front") { } else if (side == "front") {
_orientationCalNoseDownSideInProgress = true; _orientationCalNoseDownSideInProgress = true;
if (_magCalInProgress) {
_orientationCalNoseDownSideRotate = true;
}
} else if (side == "back") { } else if (side == "back") {
_orientationCalTailDownSideInProgress = true; _orientationCalTailDownSideInProgress = true;
} }
if (_magCalInProgress) {
_orientationCalAreaHelpText->setProperty("text", "Rotate the vehicle continuously as shown in the diagram until marked as Completed");
} else {
_orientationCalAreaHelpText->setProperty("text", "Hold still in the current orientation");
}
emit orientationCalSidesInProgressChanged(); emit orientationCalSidesInProgressChanged();
} else if (text.endsWith(sideDoneSuffix)) { emit orientationCalSidesRotateChanged();
return;
}
if (text.endsWith("side done, rotate to a different side")) {
QString side = text.section(" ", 0, 0); QString side = text.section(" ", 0, 0);
qDebug() << "Side finished" << side; qDebug() << "Side finished" << side;
if (side == "down") { if (side == "down") {
_orientationCalDownSideInProgress = false; _orientationCalDownSideInProgress = false;
_orientationCalDownSideDone = true; _orientationCalDownSideDone = true;
_orientationCalDownSideRotate = false;
} else if (side == "up") { } else if (side == "up") {
_orientationCalUpsideDownSideInProgress = false; _orientationCalUpsideDownSideInProgress = false;
_orientationCalUpsideDownSideDone = true; _orientationCalUpsideDownSideDone = true;
} else if (side == "left") { } else if (side == "left") {
_orientationCalLeftSideInProgress = false; _orientationCalLeftSideInProgress = false;
_orientationCalLeftSideDone = true; _orientationCalLeftSideDone = true;
_orientationCalLeftSideRotate = false;
} else if (side == "right") { } else if (side == "right") {
_orientationCalRightSideInProgress = false; _orientationCalRightSideInProgress = false;
_orientationCalRightSideDone = true; _orientationCalRightSideDone = true;
} else if (side == "front") { } else if (side == "front") {
_orientationCalNoseDownSideInProgress = false; _orientationCalNoseDownSideInProgress = false;
_orientationCalNoseDownSideDone = true; _orientationCalNoseDownSideDone = true;
_orientationCalNoseDownSideRotate = false;
} else if (side == "back") { } else if (side == "back") {
_orientationCalTailDownSideInProgress = false; _orientationCalTailDownSideInProgress = false;
_orientationCalTailDownSideDone = true; _orientationCalTailDownSideDone = true;
} }
_orientationCalAreaHelpText->setProperty("text", "Place you vehicle into one of the orientations shown below and hold it still");
emit orientationCalSidesInProgressChanged(); emit orientationCalSidesInProgressChanged();
emit orientationCalSidesDoneChanged(); emit orientationCalSidesDoneChanged();
} else if (text == "accel calibration: done" || text == "mag calibration: done") { emit orientationCalSidesRotateChanged();
_progressBar->setProperty("value", 1); return;
_orientationCalDownSideDone = true;
_orientationCalUpsideDownSideDone = true;
_orientationCalLeftSideDone = true;
_orientationCalRightSideDone = true;
_orientationCalTailDownSideDone = true;
_orientationCalNoseDownSideDone = true;
_orientationCalDownSideInProgress = false;
_orientationCalUpsideDownSideInProgress = false;
_orientationCalLeftSideInProgress = false;
_orientationCalRightSideInProgress = false;
_orientationCalNoseDownSideInProgress = false;
_orientationCalTailDownSideInProgress = false;
emit orientationCalSidesDoneChanged();
emit orientationCalSidesInProgressChanged();
_stopCalibration(false /* success */);
} else if (text == "gyro calibration: done") {
_stopCalibration(false /* success */);
} else if (text == "dpress calibration: done") {
_stopCalibration(false /* success */);
} else if (text.endsWith(" calibration: failed")) {
_stopCalibration(true /* failed */);
} }
}
void SensorsComponentController::_refreshParams(void)
{
// Pull specified params first so red/green indicators update quickly
_autopilot->refreshParameter(FactSystem::defaultComponentId, "CAL_MAG0_ID");
_autopilot->refreshParameter(FactSystem::defaultComponentId, "CAL_GYRO0_ID");
_autopilot->refreshParameter(FactSystem::defaultComponentId, "CAL_ACC0_ID");
_autopilot->refreshParameter(FactSystem::defaultComponentId, "SENS_DPRES_OFF");
_autopilot->refreshParameter(FactSystem::defaultComponentId, "SENS_BOARD_ROT");
// Mag rotation parameters are optional QString calCompletePrefix("calibration done:");
if (_autopilot->parameterExists("CAL_MAG0_ROT")) { if (text.startsWith(calCompletePrefix)) {
_autopilot->refreshParameter(FactSystem::defaultComponentId, "CAL_MAG0_ROT"); _stopCalibration(StopCalibrationSuccess);
return;
} }
if (_autopilot->parameterExists("CAL_MAG1_ROT")) {
_autopilot->refreshParameter(FactSystem::defaultComponentId, "CAL_MAG1_ROT"); if (text.startsWith("calibration cancelled")) {
_stopCalibration(_waitingForCancel ? StopCalibrationCancelled : StopCalibrationFailed);
return;
} }
if (_autopilot->parameterExists("CAL_MAG2_ROT")) {
_autopilot->refreshParameter(FactSystem::defaultComponentId, "CAL_MAG2_ROT"); if (text.startsWith("calibration failed")) {
_stopCalibration(StopCalibrationFailed);
return;
} }
}
void SensorsComponentController::_refreshParams(void)
{
// Pull full set in order to get all cal values back // Pull full set in order to get all cal values back
_autopilot->refreshAllParameters(); _autopilot->refreshAllParameters();
} }
@ -339,18 +412,6 @@ bool SensorsComponentController::fixedWing(void)
return uas->getSystemType() == MAV_TYPE_FIXED_WING; return uas->getSystemType() == MAV_TYPE_FIXED_WING;
} }
void SensorsComponentController::_updateAndEmitGyroCalInProgress(bool inProgress)
{
_gyroCalInProgress = inProgress;
emit gyroCalInProgressChanged();
}
void SensorsComponentController::_updateAndEmitShowGyroCalArea(bool show)
{
_showGyroCalArea = show;
emit showGyroCalAreaChanged();
}
void SensorsComponentController::_updateAndEmitShowOrientationCalArea(bool show) void SensorsComponentController::_updateAndEmitShowOrientationCalArea(bool show)
{ {
_showOrientationCalArea = show; _showOrientationCalArea = show;
@ -359,12 +420,15 @@ void SensorsComponentController::_updateAndEmitShowOrientationCalArea(bool show)
void SensorsComponentController::_hideAllCalAreas(void) void SensorsComponentController::_hideAllCalAreas(void)
{ {
_updateAndEmitShowGyroCalArea(false);
_updateAndEmitShowOrientationCalArea(false); _updateAndEmitShowOrientationCalArea(false);
} }
void SensorsComponentController::_updateAndEmitCalInProgressText(const QString& text) void SensorsComponentController::cancelCalibration(void)
{ {
_calInProgressText = text; // The firmware doesn't allow us to cancel calibration. The best we can do is wait
emit calInProgressTextChanged(text); // for it to timeout.
_waitingForCancel = true;
emit waitingForCancelChanged();
_cancelButton->setEnabled(false);
_uas->stopCalibration();
} }

66
src/AutoPilotPlugins/PX4/SensorsComponentController.h

@ -50,18 +50,11 @@ public:
Q_PROPERTY(QQuickItem* gyroButton MEMBER _gyroButton) Q_PROPERTY(QQuickItem* gyroButton MEMBER _gyroButton)
Q_PROPERTY(QQuickItem* accelButton MEMBER _accelButton) Q_PROPERTY(QQuickItem* accelButton MEMBER _accelButton)
Q_PROPERTY(QQuickItem* airspeedButton MEMBER _airspeedButton) Q_PROPERTY(QQuickItem* airspeedButton MEMBER _airspeedButton)
Q_PROPERTY(QQuickItem* cancelButton MEMBER _cancelButton)
Q_PROPERTY(QQuickItem* orientationCalAreaHelpText MEMBER _orientationCalAreaHelpText)
Q_PROPERTY(bool showCompass0 MEMBER _showCompass0 CONSTANT)
Q_PROPERTY(bool showCompass1 MEMBER _showCompass1 CONSTANT)
Q_PROPERTY(bool showCompass2 MEMBER _showCompass2 CONSTANT)
Q_PROPERTY(bool showGyroCalArea MEMBER _showGyroCalArea NOTIFY showGyroCalAreaChanged)
Q_PROPERTY(bool showOrientationCalArea MEMBER _showOrientationCalArea NOTIFY showOrientationCalAreaChanged) Q_PROPERTY(bool showOrientationCalArea MEMBER _showOrientationCalArea NOTIFY showOrientationCalAreaChanged)
Q_PROPERTY(bool gyroCalInProgress MEMBER _gyroCalInProgress NOTIFY gyroCalInProgressChanged)
Q_PROPERTY(QString calInProgressText MEMBER _calInProgressText NOTIFY calInProgressTextChanged)
Q_PROPERTY(bool orientationCalDownSideDone MEMBER _orientationCalDownSideDone NOTIFY orientationCalSidesDoneChanged) Q_PROPERTY(bool orientationCalDownSideDone MEMBER _orientationCalDownSideDone NOTIFY orientationCalSidesDoneChanged)
Q_PROPERTY(bool orientationCalUpsideDownSideDone MEMBER _orientationCalUpsideDownSideDone NOTIFY orientationCalSidesDoneChanged) Q_PROPERTY(bool orientationCalUpsideDownSideDone MEMBER _orientationCalUpsideDownSideDone NOTIFY orientationCalSidesDoneChanged)
Q_PROPERTY(bool orientationCalLeftSideDone MEMBER _orientationCalLeftSideDone NOTIFY orientationCalSidesDoneChanged) Q_PROPERTY(bool orientationCalLeftSideDone MEMBER _orientationCalLeftSideDone NOTIFY orientationCalSidesDoneChanged)
@ -69,6 +62,13 @@ public:
Q_PROPERTY(bool orientationCalNoseDownSideDone MEMBER _orientationCalNoseDownSideDone NOTIFY orientationCalSidesDoneChanged) Q_PROPERTY(bool orientationCalNoseDownSideDone MEMBER _orientationCalNoseDownSideDone NOTIFY orientationCalSidesDoneChanged)
Q_PROPERTY(bool orientationCalTailDownSideDone MEMBER _orientationCalTailDownSideDone NOTIFY orientationCalSidesDoneChanged) Q_PROPERTY(bool orientationCalTailDownSideDone MEMBER _orientationCalTailDownSideDone NOTIFY orientationCalSidesDoneChanged)
Q_PROPERTY(bool orientationCalDownSideVisible MEMBER _orientationCalDownSideVisible NOTIFY orientationCalSidesVisibleChanged)
Q_PROPERTY(bool orientationCalUpsideDownSideVisible MEMBER _orientationCalUpsideDownSideVisible NOTIFY orientationCalSidesVisibleChanged)
Q_PROPERTY(bool orientationCalLeftSideVisible MEMBER _orientationCalLeftSideVisible NOTIFY orientationCalSidesVisibleChanged)
Q_PROPERTY(bool orientationCalRightSideVisible MEMBER _orientationCalRightSideVisible NOTIFY orientationCalSidesVisibleChanged)
Q_PROPERTY(bool orientationCalNoseDownSideVisible MEMBER _orientationCalNoseDownSideVisible NOTIFY orientationCalSidesVisibleChanged)
Q_PROPERTY(bool orientationCalTailDownSideVisible MEMBER _orientationCalTailDownSideVisible NOTIFY orientationCalSidesVisibleChanged)
Q_PROPERTY(bool orientationCalDownSideInProgress MEMBER _orientationCalDownSideInProgress NOTIFY orientationCalSidesInProgressChanged) Q_PROPERTY(bool orientationCalDownSideInProgress MEMBER _orientationCalDownSideInProgress NOTIFY orientationCalSidesInProgressChanged)
Q_PROPERTY(bool orientationCalUpsideDownSideInProgress MEMBER _orientationCalUpsideDownSideInProgress NOTIFY orientationCalSidesInProgressChanged) Q_PROPERTY(bool orientationCalUpsideDownSideInProgress MEMBER _orientationCalUpsideDownSideInProgress NOTIFY orientationCalSidesInProgressChanged)
Q_PROPERTY(bool orientationCalLeftSideInProgress MEMBER _orientationCalLeftSideInProgress NOTIFY orientationCalSidesInProgressChanged) Q_PROPERTY(bool orientationCalLeftSideInProgress MEMBER _orientationCalLeftSideInProgress NOTIFY orientationCalSidesInProgressChanged)
@ -76,37 +76,48 @@ public:
Q_PROPERTY(bool orientationCalNoseDownSideInProgress MEMBER _orientationCalNoseDownSideInProgress NOTIFY orientationCalSidesInProgressChanged) Q_PROPERTY(bool orientationCalNoseDownSideInProgress MEMBER _orientationCalNoseDownSideInProgress NOTIFY orientationCalSidesInProgressChanged)
Q_PROPERTY(bool orientationCalTailDownSideInProgress MEMBER _orientationCalTailDownSideInProgress NOTIFY orientationCalSidesInProgressChanged) Q_PROPERTY(bool orientationCalTailDownSideInProgress MEMBER _orientationCalTailDownSideInProgress NOTIFY orientationCalSidesInProgressChanged)
Q_PROPERTY(bool orientationCalDownSideRotate MEMBER _orientationCalDownSideRotate NOTIFY orientationCalSidesRotateChanged)
Q_PROPERTY(bool orientationCalLeftSideRotate MEMBER _orientationCalLeftSideRotate NOTIFY orientationCalSidesRotateChanged)
Q_PROPERTY(bool orientationCalNoseDownSideRotate MEMBER _orientationCalNoseDownSideRotate NOTIFY orientationCalSidesRotateChanged)
Q_PROPERTY(bool waitingForCancel MEMBER _waitingForCancel NOTIFY waitingForCancelChanged)
Q_INVOKABLE void calibrateCompass(void); Q_INVOKABLE void calibrateCompass(void);
Q_INVOKABLE void calibrateGyro(void); Q_INVOKABLE void calibrateGyro(void);
Q_INVOKABLE void calibrateAccel(void); Q_INVOKABLE void calibrateAccel(void);
Q_INVOKABLE void calibrateAirspeed(void); Q_INVOKABLE void calibrateAirspeed(void);
Q_INVOKABLE void cancelCalibration(void);
bool fixedWing(void); bool fixedWing(void);
signals: signals:
void showGyroCalAreaChanged(void); void showGyroCalAreaChanged(void);
void showOrientationCalAreaChanged(void); void showOrientationCalAreaChanged(void);
void gyroCalInProgressChanged(void);
void orientationCalSidesDoneChanged(void); void orientationCalSidesDoneChanged(void);
void orientationCalSidesVisibleChanged(void);
void orientationCalSidesInProgressChanged(void); void orientationCalSidesInProgressChanged(void);
void calInProgressTextChanged(const QString& newText); void orientationCalSidesRotateChanged(void);
void resetStatusTextArea(void);
void waitingForCancelChanged(void);
void setCompassRotations(void);
private slots: private slots:
void _handleUASTextMessage(int uasId, int compId, int severity, QString text); void _handleUASTextMessage(int uasId, int compId, int severity, QString text);
private: private:
void _startCalibration(void); void _startLogCalibration(void);
void _stopCalibration(bool failed); void _startVisualCalibration(void);
void _beginTextLogging(void);
void _appendStatusLog(const QString& text); void _appendStatusLog(const QString& text);
void _refreshParams(void); void _refreshParams(void);
void _hideAllCalAreas(void); void _hideAllCalAreas(void);
void _updateAndEmitGyroCalInProgress(bool inProgress); enum StopCalibrationCode {
StopCalibrationSuccess,
void _updateAndEmitCalInProgressText(const QString& text); StopCalibrationFailed,
StopCalibrationCancelled
};
void _stopCalibration(StopCalibrationCode code);
void _updateAndEmitShowGyroCalArea(bool show);
void _updateAndEmitShowOrientationCalArea(bool show); void _updateAndEmitShowOrientationCalArea(bool show);
QQuickItem* _statusLog; QQuickItem* _statusLog;
@ -115,6 +126,8 @@ private:
QQuickItem* _gyroButton; QQuickItem* _gyroButton;
QQuickItem* _accelButton; QQuickItem* _accelButton;
QQuickItem* _airspeedButton; QQuickItem* _airspeedButton;
QQuickItem* _cancelButton;
QQuickItem* _orientationCalAreaHelpText;
bool _showGyroCalArea; bool _showGyroCalArea;
bool _showOrientationCalArea; bool _showOrientationCalArea;
@ -127,8 +140,6 @@ private:
bool _magCalInProgress; bool _magCalInProgress;
bool _accelCalInProgress; bool _accelCalInProgress;
QString _calInProgressText;
bool _orientationCalDownSideDone; bool _orientationCalDownSideDone;
bool _orientationCalUpsideDownSideDone; bool _orientationCalUpsideDownSideDone;
bool _orientationCalLeftSideDone; bool _orientationCalLeftSideDone;
@ -136,6 +147,13 @@ private:
bool _orientationCalNoseDownSideDone; bool _orientationCalNoseDownSideDone;
bool _orientationCalTailDownSideDone; bool _orientationCalTailDownSideDone;
bool _orientationCalDownSideVisible;
bool _orientationCalUpsideDownSideVisible;
bool _orientationCalLeftSideVisible;
bool _orientationCalRightSideVisible;
bool _orientationCalNoseDownSideVisible;
bool _orientationCalTailDownSideVisible;
bool _orientationCalDownSideInProgress; bool _orientationCalDownSideInProgress;
bool _orientationCalUpsideDownSideInProgress; bool _orientationCalUpsideDownSideInProgress;
bool _orientationCalLeftSideInProgress; bool _orientationCalLeftSideInProgress;
@ -143,9 +161,15 @@ private:
bool _orientationCalNoseDownSideInProgress; bool _orientationCalNoseDownSideInProgress;
bool _orientationCalTailDownSideInProgress; bool _orientationCalTailDownSideInProgress;
bool _textLoggingStarted; bool _orientationCalDownSideRotate;
bool _orientationCalLeftSideRotate;
bool _orientationCalNoseDownSideRotate;
bool _unknownFirmwareVersion;
bool _waitingForCancel;
AutoPilotPlugin* _autopilot; AutoPilotPlugin* _autopilot;
UASInterface* _uas;
}; };
#endif #endif

Loading…
Cancel
Save