Commit 6b59739c authored by Lorenz Meier's avatar Lorenz Meier

PX4 Autopilot plugin: Allow horizon level calibration

parent f9238f7e
...@@ -43,7 +43,8 @@ QGCView { ...@@ -43,7 +43,8 @@ QGCView {
readonly property string compassHelp: "For Compass calibration you will need to rotate your vehicle through a number of positions. For this calibration it is best " + readonly property string compassHelp: "For Compass calibration you will need to rotate your vehicle through a number of positions. For this calibration it is best " +
"to be connected to your vehicle via radio instead of USB, since the USB cable will likely get in the way." "to be connected to your vehicle via radio instead of USB, since the USB cable will likely get in the way."
readonly property string gyroHelp: "For Gyroscope calibration you will need to place your vehicle right side up on solid surface and leave it still." readonly property string gyroHelp: "For Gyroscope calibration you will need to place your vehicle right side up on solid surface and leave it still."
readonly property string accelHelp: "For Accelerometer calibration you will need to place your vehicle on all six sides and hold it still in each orientation for a few seconds." readonly property string accelHelp: "For Accelerometer calibration you will need to place your vehicle on all six sides on a level surface and hold it still in each orientation for a few seconds."
readonly property string levelHelp: "To level the horizon you need to place the vehicle in its level flight position."
readonly property string airspeedHelp: "For Airspeed calibration you will need to keep your airspeed sensor out of any wind and then blow across the sensor." readonly property string airspeedHelp: "For Airspeed calibration you will need to keep your airspeed sensor out of any wind and then blow across the sensor."
readonly property string statusTextAreaDefaultText: compassHelp + "\n\n" + gyroHelp + "\n\n" + accelHelp + "\n\n" + airspeedHelp + "\n\n" readonly property string statusTextAreaDefaultText: compassHelp + "\n\n" + gyroHelp + "\n\n" + accelHelp + "\n\n" + airspeedHelp + "\n\n"
...@@ -128,6 +129,8 @@ QGCView { ...@@ -128,6 +129,8 @@ QGCView {
controller.calibrateGyro() controller.calibrateGyro()
} else if (preCalibrationDialogType == "accel") { } else if (preCalibrationDialogType == "accel") {
controller.calibrateAccel() controller.calibrateAccel()
} else if (preCalibrationDialogType == "level") {
controller.calibrateLevel()
} else if (preCalibrationDialogType == "compass") { } else if (preCalibrationDialogType == "compass") {
controller.calibrateCompass() controller.calibrateCompass()
} else if (preCalibrationDialogType == "airspeed") { } else if (preCalibrationDialogType == "airspeed") {
...@@ -330,6 +333,21 @@ QGCView { ...@@ -330,6 +333,21 @@ QGCView {
} }
} }
IndicatorButton {
property Fact fact: Fact { name: "SENS_BOARD_X_OFF" }
id: levelButton
width: parent.buttonWidth
text: "Level Horizon"
indicatorGreen: fact.value != 0
onClicked: {
preCalibrationDialogType = "level"
preCalibrationDialogHelp = levelHelp
showDialog(preCalibrationDialogComponent, "Level Horizon", 50, StandardButton.Cancel | StandardButton.Ok)
}
}
IndicatorButton { IndicatorButton {
property Fact fact: Fact { name: "SENS_DPRES_OFF" } property Fact fact: Fact { name: "SENS_DPRES_OFF" }
......
...@@ -191,6 +191,12 @@ void SensorsComponentController::calibrateAccel(void) ...@@ -191,6 +191,12 @@ void SensorsComponentController::calibrateAccel(void)
_uas->startCalibration(UASInterface::StartCalibrationAccel); _uas->startCalibration(UASInterface::StartCalibrationAccel);
} }
void SensorsComponentController::calibrateLevel(void)
{
_startLogCalibration();
_uas->startCalibration(UASInterface::StartCalibrationLevel);
}
void SensorsComponentController::calibrateAirspeed(void) void SensorsComponentController::calibrateAirspeed(void)
{ {
_startLogCalibration(); _startLogCalibration();
......
...@@ -85,6 +85,7 @@ public: ...@@ -85,6 +85,7 @@ public:
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 calibrateLevel(void);
Q_INVOKABLE void calibrateAirspeed(void); Q_INVOKABLE void calibrateAirspeed(void);
Q_INVOKABLE void cancelCalibration(void); Q_INVOKABLE void cancelCalibration(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment