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:
parent
4359590f14
commit
d17bfc67e3
3 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue