1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-14 11:59:56 +03:00

Add logic condition for 3D home distance based on Pythagorean theorem.

This commit is contained in:
Alexander van Saase 2020-10-19 22:30:23 +02:00
parent 4359590f14
commit d17bfc67e3
3 changed files with 6 additions and 0 deletions

View file

@ -478,6 +478,10 @@ static int logicConditionGetFlightOperandValue(int operand) {
return NAV_Status.activeWpAction;
break;
case LOGIC_CONDITION_OPERAND_FLIGHT_3D_HOME_DISTANCE: //in m
return constrain(sqrtf(sq(GPS_distanceToHome) + sq(getEstimatedActualPosition(Z)/100)), 0, INT16_MAX);
break;
default:
return 0;
break;