diff --git a/src/FirmwarePlugin/APM/MavCmdInfoCommon.json b/src/FirmwarePlugin/APM/MavCmdInfoCommon.json index 4a508187203b0f1d6ecf82914161cfc95a7fdf94..8f35edd874a2e3d8fb3b56e2b613ea50aaa716a2 100644 --- a/src/FirmwarePlugin/APM/MavCmdInfoCommon.json +++ b/src/FirmwarePlugin/APM/MavCmdInfoCommon.json @@ -9,6 +9,36 @@ "comment": "MAV_CMD_NAV_WAYPOINT", "paramRemove": "2" }, + { + "id": 17, + "comment": "MAV_CMD_NAV_LOITER_UNLIM", + "param4": { + "label": "Heading", + "units": "radians", + "default": 0, + "decimalPlaces": 2 + } + }, + { + "id": 18, + "comment": "MAV_CMD_NAV_LOITER_TURNS", + "param4": { + "label": "Heading", + "units": "radians", + "default": 0, + "decimalPlaces": 2 + } + }, + { + "id": 19, + "comment": "MAV_CMD_NAV_LOITER_TIME", + "param4": { + "label": "Heading", + "units": "radians", + "default": 0, + "decimalPlaces": 2 + } + }, { "id": 22, "comment": "MAV_CMD_NAV_TAKEOFF", diff --git a/src/FirmwarePlugin/APM/MavCmdInfoFixedWing.json b/src/FirmwarePlugin/APM/MavCmdInfoFixedWing.json index 6fa8db824139abf600a73f4e648afb5db7d37621..9cca7514c414990bcf3f94092886c11c9716dc6a 100644 --- a/src/FirmwarePlugin/APM/MavCmdInfoFixedWing.json +++ b/src/FirmwarePlugin/APM/MavCmdInfoFixedWing.json @@ -9,6 +9,28 @@ "comment": "MAV_CMD_NAV_WAYPOINT", "paramRemove": "1,3,4" }, + { + "id": 18, + "comment": "MAV_CMD_NAV_LOITER_TURNS", + "param4": { + "label": "Exit loiter from", + "enumStrings": "Center,Tangent", + "enumValues": "0,1", + "default": 1, + "decimalPlaces": 0 + } + }, + { + "id": 19, + "comment": "MAV_CMD_NAV_LOITER_TIME", + "param4": { + "label": "Exit loiter from", + "enumStrings": "Center,Tangent", + "enumValues": "0,1", + "default": 1, + "decimalPlaces": 0 + } + }, { "id": 21, "comment": "MAV_CMD_NAV_LAND", diff --git a/src/FirmwarePlugin/PX4/MavCmdInfoCommon.json b/src/FirmwarePlugin/PX4/MavCmdInfoCommon.json index e8f236bbd10e99d9fe2b8e16340952a8da5fc6e9..8657261895e728cd9fdf5aa479ab99e3d4d1e8c7 100644 --- a/src/FirmwarePlugin/PX4/MavCmdInfoCommon.json +++ b/src/FirmwarePlugin/PX4/MavCmdInfoCommon.json @@ -9,39 +9,6 @@ "comment": "MAV_CMD_NAV_WAYPOINT", "paramRemove": "2,3" }, - { - "id": 17, - "comment": "MAV_CMD_NAV_LOITER_UNLIM", - "param4": { - "label": "Heading", - "units": "radians", - "nanUnchanged": true, - "default": null, - "decimalPlaces": 2 - } - }, - { - "id": 18, - "comment": "MAV_CMD_NAV_LOITER_TURNS", - "param4": { - "label": "Heading", - "units": "radians", - "nanUnchanged": true, - "default": null, - "decimalPlaces": 2 - } - }, - { - "id": 19, - "comment": "MAV_CMD_NAV_LOITER_TIME", - "param4": { - "label": "Heading", - "units": "radians", - "nanUnchanged": true, - "default": null, - "decimalPlaces": 2 - } - }, { "id": 21, "comment": "MAV_CMD_NAV_LAND", diff --git a/src/MissionManager/FixedWingLandingComplexItem.cc b/src/MissionManager/FixedWingLandingComplexItem.cc index db3ad990abe4aa4318b89a4eca11b1b112a89386..bb418830646a988c984a7707b1dd9f13dffab0d9 100644 --- a/src/MissionManager/FixedWingLandingComplexItem.cc +++ b/src/MissionManager/FixedWingLandingComplexItem.cc @@ -100,6 +100,12 @@ FixedWingLandingComplexItem::FixedWingLandingComplexItem(Vehicle* vehicle, bool connect(this, &FixedWingLandingComplexItem::altitudesAreRelativeChanged, this, &FixedWingLandingComplexItem::coordinateHasRelativeAltitudeChanged); connect(this, &FixedWingLandingComplexItem::altitudesAreRelativeChanged, this, &FixedWingLandingComplexItem::exitCoordinateHasRelativeAltitudeChanged); + if (vehicle->apmFirmware()) { + // ArduPilot does not support camera commands + _stopTakingVideoFact.setRawValue(false); + _stopTakingPhotosFact.setRawValue(false); + } + if (_valueSetIsDistanceFact.rawValue().toBool()) { _recalcFromHeadingAndDistanceChange(); } else { diff --git a/src/MissionManager/MavCmdInfoCommon.json b/src/MissionManager/MavCmdInfoCommon.json index 93cf03214027082100a264acc2ac436efddf53c9..5841b02a92b7d211ec4f705b3afef01aa1973252 100644 --- a/src/MissionManager/MavCmdInfoCommon.json +++ b/src/MissionManager/MavCmdInfoCommon.json @@ -101,7 +101,8 @@ "param4": { "label": "Heading", "units": "radians", - "default": 0, + "nanUnchanged": true, + "default": null, "decimalPlaces": 2 } }, @@ -128,7 +129,8 @@ "param4": { "label": "Heading", "units": "radians", - "default": 0, + "nanUnchanged": true, + "default": null, "decimalPlaces": 2 } }, diff --git a/src/PlanView/FWLandingPatternEditor.qml b/src/PlanView/FWLandingPatternEditor.qml index 2bfbd1e70830991878e371d14e02e15478a9ca8d..fd3ed3f8990420c303ac19f942e3668e091b1d34 100644 --- a/src/PlanView/FWLandingPatternEditor.qml +++ b/src/PlanView/FWLandingPatternEditor.qml @@ -32,11 +32,15 @@ Rectangle { //property real availableWidth ///< Width for control //property var missionItem ///< Mission Item for editor + property var _masterControler: masterController + property var _missionController: _masterControler.missionController + property var _missionVehicle: _masterControler.controllerVehicle property real _margin: ScreenTools.defaultFontPixelWidth / 2 property real _spacer: ScreenTools.defaultFontPixelWidth / 2 property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property string _setToVehicleHeadingStr: qsTr("Set to vehicle heading") property string _setToVehicleLocationStr: qsTr("Set to vehicle location") + property bool _showCameraSection: !_missionVehicle.apmFirmware ExclusiveGroup { id: distanceGlideGroup } @@ -166,15 +170,16 @@ Rectangle { } SectionHeader { - id: cameraSection - text: qsTr("Camera") + id: cameraSection + text: qsTr("Camera") + visible: _showCameraSection } Column { anchors.left: parent.left anchors.right: parent.right spacing: _margin - visible: cameraSection.checked + visible: _showCameraSection && cameraSection.checked Item { width: 1; height: _spacer }