From 9e788436d003b3eba6db0e16d6cf016cc35baace Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sun, 7 Oct 2018 23:16:25 +0200 Subject: [PATCH] LP-601 Use normal altitude sign above home for AboveAltitude condition parameter --- flight/modules/PathPlanner/pathplanner.c | 5 ++--- ground/gcs/src/plugins/opmap/opmap_edit_waypoint_dialog.cpp | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/flight/modules/PathPlanner/pathplanner.c b/flight/modules/PathPlanner/pathplanner.c index 0faeeafe2..0650bc59c 100644 --- a/flight/modules/PathPlanner/pathplanner.c +++ b/flight/modules/PathPlanner/pathplanner.c @@ -601,8 +601,7 @@ static uint8_t conditionBelowError() /** * the AboveAltitude measures the flight altitude relative to home position * returns true if above critical altitude - * WARNING! Altitudes are always negative (down coordinate) - * Parameter 0: altitude in meters (negative!) + * Parameter 0: altitude in meters */ static uint8_t conditionAboveAltitude() { @@ -610,7 +609,7 @@ static uint8_t conditionAboveAltitude() PositionStateGet(&positionState); - if (positionState.Down <= pathAction.ConditionParameters[0]) { + if (-positionState.Down >= pathAction.ConditionParameters[0]) { return true; } return false; diff --git a/ground/gcs/src/plugins/opmap/opmap_edit_waypoint_dialog.cpp b/ground/gcs/src/plugins/opmap/opmap_edit_waypoint_dialog.cpp index 9975246dc..dbbed9ba5 100644 --- a/ground/gcs/src/plugins/opmap/opmap_edit_waypoint_dialog.cpp +++ b/ground/gcs/src/plugins/opmap/opmap_edit_waypoint_dialog.cpp @@ -290,8 +290,7 @@ void opmap_edit_waypoint_dialog::setupConditionWidgets() ui->condParam1->setEnabled(true); ui->dsb_condParam1->setEnabled(true); ui->condParam1->setText("Altitude (m):"); - ui->descriptionConditionLabel->setText(tr("

The AboveAltitude condition measures the flight altitude relative to home position, returns true if " - "above critical altitude.

WARNING! altitudes set here are always negative if above Home. (down coordinate)

")); + ui->descriptionConditionLabel->setText(tr("

The AboveAltitude condition measures the flight altitude relative to home position, returns true if above critical altitude.

")); break; case MapDataDelegate::ENDCONDITION_ABOVESPEED: ui->condParam1->setEnabled(true); -- 2.11.4.GIT