Skip to content

Commit 9e78843

Browse files
committed
LP-601 Use normal altitude sign above home for AboveAltitude condition parameter
1 parent fe5ca6d commit 9e78843

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

flight/modules/PathPlanner/pathplanner.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,16 +601,15 @@ static uint8_t conditionBelowError()
601601
/**
602602
* the AboveAltitude measures the flight altitude relative to home position
603603
* returns true if above critical altitude
604-
* WARNING! Altitudes are always negative (down coordinate)
605-
* Parameter 0: altitude in meters (negative!)
604+
* Parameter 0: altitude in meters
606605
*/
607606
static uint8_t conditionAboveAltitude()
608607
{
609608
PositionStateData positionState;
610609

611610
PositionStateGet(&positionState);
612611

613-
if (positionState.Down <= pathAction.ConditionParameters[0]) {
612+
if (-positionState.Down >= pathAction.ConditionParameters[0]) {
614613
return true;
615614
}
616615
return false;

ground/gcs/src/plugins/opmap/opmap_edit_waypoint_dialog.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ void opmap_edit_waypoint_dialog::setupConditionWidgets()
290290
ui->condParam1->setEnabled(true);
291291
ui->dsb_condParam1->setEnabled(true);
292292
ui->condParam1->setText("Altitude (m):");
293-
ui->descriptionConditionLabel->setText(tr("<p>The AboveAltitude condition measures the flight altitude relative to home position, returns true if "
294-
"above critical altitude.</p><p><b>WARNING!</b> altitudes set here are always <b>negative</b> if above Home. (down coordinate)</p>"));
293+
ui->descriptionConditionLabel->setText(tr("<p>The AboveAltitude condition measures the flight altitude relative to home position, returns true if above critical altitude.</p>"));
295294
break;
296295
case MapDataDelegate::ENDCONDITION_ABOVESPEED:
297296
ui->condParam1->setEnabled(true);

0 commit comments

Comments
 (0)