From 3dc382fba427b231d0fdbf5a3720ff9dcfd0b57c Mon Sep 17 00:00:00 2001 From: DoinLakeFlyer Date: Wed, 19 Feb 2020 10:17:41 -0800 Subject: [PATCH] Plan: Make PX4 VTOL takeoff work like fixed wing --- src/MissionManager/TakeoffMissionItem.cc | 2 +- src/MissionManager/VisualMissionItem.h | 1 + src/PlanView/SimpleItemEditor.qml | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/MissionManager/TakeoffMissionItem.cc b/src/MissionManager/TakeoffMissionItem.cc index 5ee18035b..a03306ed8 100644 --- a/src/MissionManager/TakeoffMissionItem.cc +++ b/src/MissionManager/TakeoffMissionItem.cc @@ -115,7 +115,7 @@ bool TakeoffMissionItem::isTakeoffCommand(MAV_CMD command) void TakeoffMissionItem::_initLaunchTakeoffAtSameLocation(void) { if (specifiesCoordinate()) { - if (_vehicle->fixedWing()) { + if (_vehicle->fixedWing() || _vehicle->vtol()) { setLaunchTakeoffAtSameLocation(false); } else { // PX4 specifies a coordinate for takeoff even for non fixed wing. But it makes more sense to not have a coordinate diff --git a/src/MissionManager/VisualMissionItem.h b/src/MissionManager/VisualMissionItem.h index e97b3932b..1e5675797 100644 --- a/src/MissionManager/VisualMissionItem.h +++ b/src/MissionManager/VisualMissionItem.h @@ -47,6 +47,7 @@ public: }; Q_ENUM(ReadyForSaveState) + Q_PROPERTY(Vehicle* vehicle READ vehicle CONSTANT) Q_PROPERTY(bool homePosition READ homePosition CONSTANT) ///< true: This item is being used as a home position indicator Q_PROPERTY(QGeoCoordinate coordinate READ coordinate WRITE setCoordinate NOTIFY coordinateChanged) ///< This is the entry point for a waypoint line into the item. For a simple item it is also the location of the item Q_PROPERTY(double terrainAltitude READ terrainAltitude NOTIFY terrainAltitudeChanged) ///< The altitude of terrain at the coordinate position, NaN if not known diff --git a/src/PlanView/SimpleItemEditor.qml b/src/PlanView/SimpleItemEditor.qml index e894cc71a..fe64ea646 100644 --- a/src/PlanView/SimpleItemEditor.qml +++ b/src/PlanView/SimpleItemEditor.qml @@ -66,7 +66,7 @@ Rectangle { visible: missionItem.isTakeoffItem && missionItem.wizardMode // Hack special case for takeoff item QGCLabel { - text: qsTr("Move 'T' Takeoff to the climbout location.") + text: qsTr("Move 'T' Takeoff to the %1 location.").arg(missionItem.vehicle.vtol ? qsTr("desired") : qsTr("climbout")) Layout.fillWidth: true wrapMode: Text.WordWrap visible: !initialClickLabel.visible @@ -76,7 +76,7 @@ Rectangle { text: qsTr("Ensure clear of obstacles and into the wind.") Layout.fillWidth: true wrapMode: Text.WordWrap - visible: !initialClickLabel.visible + visible: !initialClickLabel.visible && !missionItem.vehicle.vtol } QGCButton { -- 2.22.0