Commit 1540b469 authored by Don Gagne's avatar Don Gagne

Merge pull request #2385 from DonLakeFlyer/APMSensorCal

APM accel calibration
parents 64aa2e5e 796b5d79
......@@ -554,6 +554,8 @@ HEADERS+= \
src/AutoPilotPlugins/APM/APMRadioComponent.h \
src/AutoPilotPlugins/APM/APMFlightModesComponent.h \
src/AutoPilotPlugins/APM/APMFlightModesComponentController.h \
src/AutoPilotPlugins/APM/APMSensorsComponent.h \
src/AutoPilotPlugins/APM/APMSensorsComponentController.h \
src/AutoPilotPlugins/Common/RadioComponentController.h \
src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.h \
src/AutoPilotPlugins/PX4/AirframeComponent.h \
......@@ -601,6 +603,8 @@ SOURCES += \
src/AutoPilotPlugins/APM/APMRadioComponent.cc \
src/AutoPilotPlugins/APM/APMFlightModesComponent.cc \
src/AutoPilotPlugins/APM/APMFlightModesComponentController.cc \
src/AutoPilotPlugins/APM/APMSensorsComponent.cc \
src/AutoPilotPlugins/APM/APMSensorsComponentController.cc \
src/AutoPilotPlugins/Common/RadioComponentController.cc \
src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.cc \
src/AutoPilotPlugins/PX4/AirframeComponent.cc \
......
......@@ -111,6 +111,8 @@
<file alias="SensorsComponent.qml">src/AutoPilotPlugins/PX4/SensorsComponent.qml</file>
<file alias="SensorsComponentSummary.qml">src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml</file>
<file alias="SensorsComponentSummaryFixedWing.qml">src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml</file>
<file alias="APMSensorsComponent.qml">src/AutoPilotPlugins/APM/APMSensorsComponent.qml</file>
<file alias="APMSensorsComponentSummary.qml">src/AutoPilotPlugins/APM/APMSensorsComponentSummary.qml</file>
<file alias="SetupParameterEditor.qml">src/VehicleSetup/SetupParameterEditor.qml</file>
<file alias="SetupView.qml">src/VehicleSetup/SetupView.qml</file>
<file alias="test.qml">src/test.qml</file>
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
......@@ -50,19 +50,36 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
if (parametersReady()) {
_airframeComponent = new APMAirframeComponent(_vehicle, this);
Q_CHECK_PTR(_airframeComponent);
_airframeComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_airframeComponent));
if (_airframeComponent) {
_airframeComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_airframeComponent));
} else {
qWarning() << "new APMAirframeComponent failed";
}
_flightModesComponent = new APMFlightModesComponent(_vehicle, this);
Q_CHECK_PTR(_flightModesComponent);
_flightModesComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_flightModesComponent));
if (_flightModesComponent) {
_flightModesComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_flightModesComponent));
} else {
qWarning() << "new APMFlightModesComponent failed";
}
_radioComponent = new APMRadioComponent(_vehicle, this);
Q_CHECK_PTR(_radioComponent);
_radioComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_radioComponent));
if (_radioComponent) {
_radioComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_radioComponent));
} else {
qWarning() << "new APMRadioComponent failed";
}
_sensorsComponent = new APMSensorsComponent(_vehicle, this);
if (_sensorsComponent) {
_sensorsComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_sensorsComponent));
} else {
qWarning() << "new APMSensorsComponent failed";
}
} else {
qWarning() << "Call to vehicleCompenents prior to parametersReady";
}
......@@ -76,17 +93,17 @@ void APMAutoPilotPlugin::_parametersReadyPreChecks(bool missingParameters)
{
#if 0
I believe APM has parameter version stamp, we should check that
// Check for older parameter version set
// FIXME: Firmware is moving to version stamp parameter set. Once that is complete the version stamp
// should be used instead.
if (parameterExists(FactSystem::defaultComponentId, "SENS_GYRO_XOFF")) {
// Check for older parameter version set
// FIXME: Firmware is moving to version stamp parameter set. Once that is complete the version stamp
// should be used instead.
if (parameterExists(FactSystem::defaultComponentId, "SENS_GYRO_XOFF")) {
_incorrectParameterVersion = true;
qgcApp()->showMessage("This version of GroundControl can only perform vehicle setup on a newer version of firmware. "
"Please perform a Firmware Upgrade if you wish to use Vehicle Setup.");
}
}
#endif
_parametersReady = true;
_missingParameters = missingParameters;
emit missingParametersChanged(_missingParameters);
......
......@@ -27,8 +27,9 @@
#include "AutoPilotPlugin.h"
#include "Vehicle.h"
#include "APMAirframeComponent.h"
#include "APMRadioComponent.h"
#include "APMFlightModesComponent.h"
#include "APMRadioComponent.h"
#include "APMSensorsComponent.h"
/// This is the APM specific implementation of the AutoPilot class.
class APMAutoPilotPlugin : public AutoPilotPlugin
......@@ -45,6 +46,7 @@ public:
APMAirframeComponent* airframeComponent (void) { return _airframeComponent; }
APMFlightModesComponent* flightModesComponent(void) { return _flightModesComponent; }
APMRadioComponent* radioComponent (void) { return _radioComponent; }
APMSensorsComponent* sensorsComponent (void) { return _sensorsComponent; }
public slots:
// FIXME: This is public until we restructure AutoPilotPlugin/FirmwarePlugin/Vehicle
......@@ -57,6 +59,7 @@ private:
APMAirframeComponent* _airframeComponent;
APMFlightModesComponent* _flightModesComponent;
APMRadioComponent* _radioComponent;
APMSensorsComponent* _sensorsComponent;
};
#endif
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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.
QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#include "APMSensorsComponent.h"
#include "APMAutoPilotPlugin.h"
#include "APMSensorsComponentController.h"
// These two list must be kept in sync
APMSensorsComponent::APMSensorsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) :
APMComponent(vehicle, autopilot, parent),
_name(tr("Sensors"))
{
}
QString APMSensorsComponent::name(void) const
{
return _name;
}
QString APMSensorsComponent::description(void) const
{
return tr("The Sensors Component allows you to calibrate the sensors within your vehicle. "
"Prior to flight you must calibrate the Magnetometer, Gyroscope and Accelerometer.");
}
QString APMSensorsComponent::iconResource(void) const
{
return "/qmlimages/SensorsComponentIcon.png";
}
bool APMSensorsComponent::requiresSetup(void) const
{
return true;
}
bool APMSensorsComponent::setupComplete(void) const
{
foreach(QString triggerParam, setupCompleteChangedTriggerList()) {
if (_autopilot->getParameterFact(FactSystem::defaultComponentId, triggerParam)->rawValue().toFloat() == 0.0f) {
return false;
}
}
return true;
}
QString APMSensorsComponent::setupStateDescription(void) const
{
const char* stateDescription;
if (requiresSetup()) {
stateDescription = "Requires calibration";
} else {
stateDescription = "Calibrated";
}
return QString(stateDescription);
}
QStringList APMSensorsComponent::setupCompleteChangedTriggerList(void) const
{
QStringList triggers;
triggers << "COMPASS_OFS_X" << "COMPASS_OFS_X" << "COMPASS_OFS_X"
<< "INS_ACCOFFS_X" << "INS_ACCOFFS_Y" << "INS_ACCOFFS_Z";
return triggers;
}
QStringList APMSensorsComponent::paramFilterList(void) const
{
return QStringList();
}
QUrl APMSensorsComponent::setupSource(void) const
{
return QUrl::fromUserInput("qrc:/qml/APMSensorsComponent.qml");
}
QUrl APMSensorsComponent::summaryQmlSource(void) const
{
return QUrl::fromUserInput("qrc:/qml/APMSensorsComponentSummary.qml");
}
QString APMSensorsComponent::prerequisiteSetup(void) const
{
APMAutoPilotPlugin* plugin = dynamic_cast<APMAutoPilotPlugin*>(_autopilot);
Q_ASSERT(plugin);
if (!plugin->airframeComponent()->setupComplete()) {
return plugin->airframeComponent()->name();
}
return QString();
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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.
QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef APMSensorsComponent_H
#define APMSensorsComponent_H
#include "APMComponent.h"
class APMSensorsComponent : public APMComponent
{
Q_OBJECT
public:
APMSensorsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
// Virtuals from APMComponent
virtual QStringList setupCompleteChangedTriggerList(void) const;
// Virtuals from VehicleComponent
virtual QString name(void) const;
virtual QString description(void) const;
virtual QString iconResource(void) const;
virtual bool requiresSetup(void) const;
virtual bool setupComplete(void) const;
virtual QString setupStateDescription(void) const;
virtual QUrl setupSource(void) const;
virtual QStringList paramFilterList(void) const;
virtual QUrl summaryQmlSource(void) const;
virtual QString prerequisiteSetup(void) const;
private:
const QString _name;
QVariantList _summaryItems;
};
#endif
This diff is collapsed.
This diff is collapsed.
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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.
QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef APMSensorsComponentController_H
#define APMSensorsComponentController_H
#include <QObject>
#include "UASInterface.h"
#include "FactPanelController.h"
#include "QGCLoggingCategory.h"
Q_DECLARE_LOGGING_CATEGORY(APMSensorsComponentControllerLog)
/// Sensors Component MVC Controller for SensorsComponent.qml.
class APMSensorsComponentController : public FactPanelController
{
Q_OBJECT
public:
APMSensorsComponentController(void);
Q_PROPERTY(bool fixedWing READ fixedWing CONSTANT)
Q_PROPERTY(QQuickItem* statusLog MEMBER _statusLog)
Q_PROPERTY(QQuickItem* progressBar MEMBER _progressBar)
Q_PROPERTY(QQuickItem* compassButton MEMBER _compassButton)
Q_PROPERTY(QQuickItem* accelButton MEMBER _accelButton)
Q_PROPERTY(QQuickItem* nextButton MEMBER _nextButton)
Q_PROPERTY(QQuickItem* cancelButton MEMBER _cancelButton)
Q_PROPERTY(QQuickItem* orientationCalAreaHelpText MEMBER _orientationCalAreaHelpText)
Q_PROPERTY(bool showOrientationCalArea MEMBER _showOrientationCalArea NOTIFY showOrientationCalAreaChanged)
Q_PROPERTY(bool orientationCalDownSideDone MEMBER _orientationCalDownSideDone NOTIFY orientationCalSidesDoneChanged)
Q_PROPERTY(bool orientationCalUpsideDownSideDone MEMBER _orientationCalUpsideDownSideDone NOTIFY orientationCalSidesDoneChanged)
Q_PROPERTY(bool orientationCalLeftSideDone MEMBER _orientationCalLeftSideDone NOTIFY orientationCalSidesDoneChanged)
Q_PROPERTY(bool orientationCalRightSideDone MEMBER _orientationCalRightSideDone NOTIFY orientationCalSidesDoneChanged)
Q_PROPERTY(bool orientationCalNoseDownSideDone MEMBER _orientationCalNoseDownSideDone 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 orientationCalUpsideDownSideInProgress MEMBER _orientationCalUpsideDownSideInProgress NOTIFY orientationCalSidesInProgressChanged)
Q_PROPERTY(bool orientationCalLeftSideInProgress MEMBER _orientationCalLeftSideInProgress NOTIFY orientationCalSidesInProgressChanged)
Q_PROPERTY(bool orientationCalRightSideInProgress MEMBER _orientationCalRightSideInProgress NOTIFY orientationCalSidesInProgressChanged)
Q_PROPERTY(bool orientationCalNoseDownSideInProgress MEMBER _orientationCalNoseDownSideInProgress NOTIFY orientationCalSidesInProgressChanged)
Q_PROPERTY(bool orientationCalTailDownSideInProgress MEMBER _orientationCalTailDownSideInProgress NOTIFY orientationCalSidesInProgressChanged)
Q_PROPERTY(bool orientationCalDownSideRotate MEMBER _orientationCalDownSideRotate NOTIFY orientationCalSidesRotateChanged)
Q_PROPERTY(bool orientationCalUpsideDownSideRotate MEMBER _orientationCalUpsideDownSideRotate NOTIFY orientationCalSidesRotateChanged)
Q_PROPERTY(bool orientationCalLeftSideRotate MEMBER _orientationCalLeftSideRotate NOTIFY orientationCalSidesRotateChanged)
Q_PROPERTY(bool orientationCalRightSideRotate MEMBER _orientationCalRightSideRotate NOTIFY orientationCalSidesRotateChanged)
Q_PROPERTY(bool orientationCalNoseDownSideRotate MEMBER _orientationCalNoseDownSideRotate NOTIFY orientationCalSidesRotateChanged)
Q_PROPERTY(bool orientationCalTailDownSideRotate MEMBER _orientationCalTailDownSideRotate NOTIFY orientationCalSidesRotateChanged)
Q_PROPERTY(bool waitingForCancel MEMBER _waitingForCancel NOTIFY waitingForCancelChanged)
Q_INVOKABLE void calibrateCompass(void);
Q_INVOKABLE void calibrateGyro(void);
Q_INVOKABLE void calibrateAccel(void);
Q_INVOKABLE void calibrateLevel(void);
Q_INVOKABLE void calibrateAirspeed(void);
Q_INVOKABLE void cancelCalibration(void);
Q_INVOKABLE void nextClicked(void);
bool fixedWing(void);
signals:
void showGyroCalAreaChanged(void);
void showOrientationCalAreaChanged(void);
void orientationCalSidesDoneChanged(void);
void orientationCalSidesVisibleChanged(void);
void orientationCalSidesInProgressChanged(void);
void orientationCalSidesRotateChanged(void);
void resetStatusTextArea(void);
void waitingForCancelChanged(void);
void setCompassRotations(void);
private slots:
void _handleUASTextMessage(int uasId, int compId, int severity, QString text);
private:
void _startLogCalibration(void);
void _startVisualCalibration(void);
void _appendStatusLog(const QString& text);
void _refreshParams(void);
void _hideAllCalAreas(void);
void _resetInternalState(void);
enum StopCalibrationCode {
StopCalibrationSuccess,
StopCalibrationFailed,
StopCalibrationCancelled
};
void _stopCalibration(StopCalibrationCode code);
void _updateAndEmitShowOrientationCalArea(bool show);
QQuickItem* _statusLog;
QQuickItem* _progressBar;
QQuickItem* _compassButton;
QQuickItem* _accelButton;
QQuickItem* _nextButton;
QQuickItem* _cancelButton;
QQuickItem* _orientationCalAreaHelpText;
bool _showGyroCalArea;
bool _showOrientationCalArea;
bool _gyroCalInProgress;
bool _magCalInProgress;
bool _accelCalInProgress;
bool _orientationCalDownSideDone;
bool _orientationCalUpsideDownSideDone;
bool _orientationCalLeftSideDone;
bool _orientationCalRightSideDone;
bool _orientationCalNoseDownSideDone;
bool _orientationCalTailDownSideDone;
bool _orientationCalDownSideVisible;
bool _orientationCalUpsideDownSideVisible;
bool _orientationCalLeftSideVisible;
bool _orientationCalRightSideVisible;
bool _orientationCalNoseDownSideVisible;
bool _orientationCalTailDownSideVisible;
bool _orientationCalDownSideInProgress;
bool _orientationCalUpsideDownSideInProgress;
bool _orientationCalLeftSideInProgress;
bool _orientationCalRightSideInProgress;
bool _orientationCalNoseDownSideInProgress;
bool _orientationCalTailDownSideInProgress;
bool _orientationCalDownSideRotate;
bool _orientationCalUpsideDownSideRotate;
bool _orientationCalLeftSideRotate;
bool _orientationCalRightSideRotate;
bool _orientationCalNoseDownSideRotate;
bool _orientationCalTailDownSideRotate;
bool _waitingForCancel;
static const int _supportedFirmwareCalVersion = 2;
};
#endif
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
/*
IMPORTANT NOTE: Any changes made here must also be made to SensorsComponentSummary.qml
*/
FactPanel {
id: panel
anchors.fill: parent
color: qgcPal.windowShadeDark
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
FactPanelController { id: controller; factPanel: panel }
property Fact ins_accoffs_x: controller.getParameterFact(-1, "INS_ACCOFFS_X")
property Fact ins_accoffs_y: controller.getParameterFact(-1, "INS_ACCOFFS_Y")
property Fact ins_accoffs_z: controller.getParameterFact(-1, "INS_ACCOFFS_Z")
property Fact compass_ofs_x: controller.getParameterFact(-1, "COMPASS_OFS_X")
property Fact compass_ofs_y: controller.getParameterFact(-1, "COMPASS_OFS_Y")
property Fact compass_ofs_z: controller.getParameterFact(-1, "COMPASS_OFS_Z")
property bool accelCalNeeded: ins_accoffs_x.value == 0 && ins_accoffs_y.value == 0 && ins_accoffs_z.value == 0
property bool compassCalNeeded: compass_ofs_x.value == 0 && compass_ofs_y.value == 0 && compass_ofs_y.value == 0
Column {
anchors.fill: parent
anchors.margins: 8
VehicleSummaryRow {
labelText: "Compass:"
valueText: compassCalNeeded ? "Setup required" : "Ready"
}
VehicleSummaryRow {
labelText: "Accelerometer:"
valueText: accelCalNeeded ? "Setup required" : "Ready"
}
}
}
......@@ -292,22 +292,34 @@ void APMFirmwarePlugin::adjustMavlinkMessage(mavlink_message_t* message)
mavlink_msg_param_set_encode(message->sysid, message->compid, message, &paramSet);
}
if (message->msgid == MAVLINK_MSG_ID_STATUSTEXT)
{
if (!_firmwareVersion.isValid()) {
if (message->msgid == MAVLINK_MSG_ID_STATUSTEXT) {
mavlink_statustext_t statusText;
mavlink_msg_statustext_decode(message, &statusText);
// APM user facing calibration messages come through as high severity, we need to parse them out
// and lower the severity on them so that they don't pop in the users face.
if (!_firmwareVersion.isValid() || statusText.severity < MAV_SEVERITY_NOTICE) {
QByteArray b;
b.resize(MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN+1);
mavlink_msg_statustext_get_text(message, b.data());
// Ensure NUL-termination
b[b.length()-1] = '\0';
QString text = QString(b);
qCDebug(APMFirmwarePluginLog) << text;
// if don't know firmwareVersion yet, try and see this message contains it
if (text.contains(APM_COPTER_REXP) || text.contains(APM_PLANE_REXP) || text.contains(APM_ROVER_REXP)) {
// found version string
_firmwareVersion = APMFirmwareVersion(text);
_textSeverityAdjustmentNeeded = _isTextSeverityAdjustmentNeeded(_firmwareVersion);
QString messageText = QString(b);
qCDebug(APMFirmwarePluginLog) << messageText;
if (!_firmwareVersion.isValid()) {
// if don't know firmwareVersion yet, try and see if this message contains it
if (messageText.contains(APM_COPTER_REXP) || messageText.contains(APM_PLANE_REXP) || messageText.contains(APM_ROVER_REXP)) {
// found version string
_firmwareVersion = APMFirmwareVersion(messageText);
_textSeverityAdjustmentNeeded = _isTextSeverityAdjustmentNeeded(_firmwareVersion);
}
}
if (messageText.contains("Place vehicle") || messageText.contains("Calibration successful")) {
_adjustCalibrationMessageSeverity(message);
return;
}
}
......@@ -362,6 +374,14 @@ void APMFirmwarePlugin::_adjustSeverity(mavlink_message_t* message) const
mavlink_msg_statustext_encode(message->sysid, message->compid, message, &statusText);
}
void APMFirmwarePlugin::_adjustCalibrationMessageSeverity(mavlink_message_t* message) const
{
mavlink_statustext_t statusText;
mavlink_msg_statustext_decode(message, &statusText);
statusText.severity = MAV_SEVERITY_INFO;
mavlink_msg_statustext_encode(message->sysid, message->compid, message, &statusText);
}
void APMFirmwarePlugin::initializeVehicle(Vehicle* vehicle)
{
// Streams are not started automatically on APM stack
......
......@@ -100,6 +100,7 @@ protected:
private:
void _adjustSeverity(mavlink_message_t* message) const;
void _adjustCalibrationMessageSeverity(mavlink_message_t* message) const;
static bool _isTextSeverityAdjustmentNeeded(const APMFirmwareVersion& firmwareVersion);
APMFirmwareVersion _firmwareVersion;
......
......@@ -65,6 +65,7 @@
#include "APMFlightModesComponentController.h"
#include "AirframeComponentController.h"
#include "SensorsComponentController.h"
#include "APMSensorsComponentController.h"
#include "PowerComponentController.h"
#include "RadioComponentController.h"
#include "ScreenToolsController.h"
......@@ -381,6 +382,7 @@ void QGCApplication::_initCommon(void)
qmlRegisterType<APMFlightModesComponentController> ("QGroundControl.Controllers", 1, 0, "APMFlightModesComponentController");
qmlRegisterType<FlightModesComponentController> ("QGroundControl.Controllers", 1, 0, "FlightModesComponentController");
qmlRegisterType<AirframeComponentController> ("QGroundControl.Controllers", 1, 0, "AirframeComponentController");
qmlRegisterType<APMSensorsComponentController> ("QGroundControl.Controllers", 1, 0, "APMSensorsComponentController");
qmlRegisterType<SensorsComponentController> ("QGroundControl.Controllers", 1, 0, "SensorsComponentController");
qmlRegisterType<PowerComponentController> ("QGroundControl.Controllers", 1, 0, "PowerComponentController");
qmlRegisterType<RadioComponentController> ("QGroundControl.Controllers", 1, 0, "RadioComponentController");
......
......@@ -97,9 +97,9 @@
1 1 COMPASS_OFS3_X 0 9
1 1 COMPASS_OFS3_Y 0 9
1 1 COMPASS_OFS3_Z 0 9
1 1 COMPASS_OFS_X 0 9
1 1 COMPASS_OFS_Y 0 9
1 1 COMPASS_OFS_Z 0 9
1 1 COMPASS_OFS_X 10 9
1 1 COMPASS_OFS_Y 10 9
1 1 COMPASS_OFS_Z 10 9
1 1 COMPASS_ORIENT 0 2
1 1 COMPASS_ORIENT2 0 2
1 1 COMPASS_ORIENT3 0 2
......@@ -200,9 +200,9 @@
1 1 INS_ACC3SCAL_Y 0 9
1 1 INS_ACC3SCAL_Z 0 9
1 1 INS_ACCEL_FILTER 20 2
1 1 INS_ACCOFFS_X 0 9
1 1 INS_ACCOFFS_Y 0 9
1 1 INS_ACCOFFS_Z 0 9
1 1 INS_ACCOFFS_X 10 9
1 1 INS_ACCOFFS_Y 10 9
1 1 INS_ACCOFFS_Z 10 9
1 1 INS_ACCSCAL_X 1 9
1 1 INS_ACCSCAL_Y 1 9
1 1 INS_ACCSCAL_Z 1 9
......
......@@ -121,9 +121,9 @@
1 1 COMPASS_OFS3_X 0 9
1 1 COMPASS_OFS3_Y 0 9
1 1 COMPASS_OFS3_Z 0 9
1 1 COMPASS_OFS_X 0 9
1 1 COMPASS_OFS_Y 0 9
1 1 COMPASS_OFS_Z 0 9
1 1 COMPASS_OFS_X 10 9
1 1 COMPASS_OFS_Y 10 9
1 1 COMPASS_OFS_Z 10 9
1 1 COMPASS_ORIENT 0 2
1 1 COMPASS_ORIENT2 0 2
1 1 COMPASS_ORIENT3 0 2
......@@ -244,9 +244,9 @@
1 1 INS_ACC3SCAL_Y 0 9
1 1 INS_ACC3SCAL_Z 0 9
1 1 INS_ACCEL_FILTER 20 2
1 1 INS_ACCOFFS_X 0 9
1 1 INS_ACCOFFS_Y 0 9
1 1 INS_ACCOFFS_Z 0 9
1 1 INS_ACCOFFS_X 10 9
1 1 INS_ACCOFFS_Y 10 9
1 1 INS_ACCOFFS_Z 10 9
1 1 INS_ACCSCAL_X 1 9
1 1 INS_ACCSCAL_Y 1 9
1 1 INS_ACCSCAL_Z 1 9
......
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