Browse Source

Merge pull request #7053 from DonLakeFlyer/MavlinkStreamsArduPilot

ArduPilot option to not start mavlink streams
QGC4.4
Don Gagne 6 years ago committed by GitHub
parent
commit
856a4c131d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/FirmwarePlugin/APM/APMFirmwarePlugin.cc
  2. 6
      src/Settings/App.SettingsGroup.json
  3. 1
      src/Settings/AppSettings.cc
  4. 3
      src/Settings/AppSettings.h
  5. 12
      src/ui/preferences/MavlinkSettings.qml

8
src/FirmwarePlugin/APM/APMFirmwarePlugin.cc

@ -17,6 +17,8 @@ @@ -17,6 +17,8 @@
#include "MissionManager.h"
#include "ParameterManager.h"
#include "QGCFileDownload.h"
#include "SettingsManager.h"
#include "AppSettings.h"
#include <QTcpSocket>
@ -641,8 +643,10 @@ void APMFirmwarePlugin::initializeVehicle(Vehicle* vehicle) @@ -641,8 +643,10 @@ void APMFirmwarePlugin::initializeVehicle(Vehicle* vehicle)
break;
}
} else {
// Streams are not started automatically on APM stack
initializeStreamRates(vehicle);
if (qgcApp()->toolbox()->settingsManager()->appSettings()->apmStartMavlinkStreams()->rawValue().toBool()) {
// Streams are not started automatically on APM stack (sort of)
initializeStreamRates(vehicle);
}
}
}

6
src/Settings/App.SettingsGroup.json

@ -199,5 +199,11 @@ @@ -199,5 +199,11 @@
"enumStrings": "Never,Always,When in Follow Me Flight Mode",
"enumValues": "0,1,2",
"defaultValue": 0
},
{
"name": "apmStartMavlinkStreams",
"shortDescription": "Request start of MAVLink telemetry streams (ArduPilot only)",
"type": "bool",
"defaultValue": true
}
]

1
src/Settings/AppSettings.cc

@ -84,6 +84,7 @@ DECLARE_SETTINGSFACT(AppSettings, esriToken) @@ -84,6 +84,7 @@ DECLARE_SETTINGSFACT(AppSettings, esriToken)
DECLARE_SETTINGSFACT(AppSettings, defaultFirmwareType)
DECLARE_SETTINGSFACT(AppSettings, gstDebugLevel)
DECLARE_SETTINGSFACT(AppSettings, followTarget)
DECLARE_SETTINGSFACT(AppSettings, apmStartMavlinkStreams)
DECLARE_SETTINGSFACT_NO_FUNC(AppSettings, indoorPalette)
{

3
src/Settings/AppSettings.h

@ -44,6 +44,9 @@ public: @@ -44,6 +44,9 @@ public:
DEFINE_SETTINGFACT(gstDebugLevel)
DEFINE_SETTINGFACT(followTarget)
// Although this is a global setting it only affects ArduPilot vehicle since PX4 automatically starts the stream from the vehicle side
DEFINE_SETTINGFACT(apmStartMavlinkStreams)
Q_PROPERTY(QString missionSavePath READ missionSavePath NOTIFY savePathsChanged)
Q_PROPERTY(QString parameterSavePath READ parameterSavePath NOTIFY savePathsChanged)
Q_PROPERTY(QString telemetrySavePath READ telemetrySavePath NOTIFY savePathsChanged)

12
src/ui/preferences/MavlinkSettings.qml

@ -15,6 +15,7 @@ import QtQuick.Dialogs 1.2 @@ -15,6 +15,7 @@ import QtQuick.Dialogs 1.2
import QGroundControl 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.MultiVehicleManager 1.0
@ -132,8 +133,7 @@ Rectangle { @@ -132,8 +133,7 @@ Rectangle {
}
}
}
//-----------------------------------------------------------------
//-- Mavlink Heartbeats
QGCCheckBox {
text: qsTr("Emit heartbeat")
checked: QGroundControl.multiVehicleManager.gcsHeartBeatEnabled
@ -141,8 +141,12 @@ Rectangle { @@ -141,8 +141,12 @@ Rectangle {
QGroundControl.multiVehicleManager.gcsHeartBeatEnabled = checked
}
}
//-----------------------------------------------------------------
//-- Mavlink Version Check
FactCheckBox {
text: fact.shortDescription
fact: QGroundControl.settingsManager.appSettings.apmStartMavlinkStreams
}
QGCCheckBox {
text: qsTr("Only accept MAVs with same protocol version")
checked: QGroundControl.isVersionCheckEnabled

Loading…
Cancel
Save