1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

OP-1760 autotakeoff pathplanner now uses pathstatus in conditionLegRemaining

This commit is contained in:
abeck70 2015-04-17 23:06:02 +10:00
parent eebbfcea64
commit c4aa17a04c

View File

@ -555,18 +555,10 @@ static uint8_t conditionDistanceToTarget()
*/ */
static uint8_t conditionLegRemaining() static uint8_t conditionLegRemaining()
{ {
PathDesiredData pathDesired; PathStatusData pathStatus;
PositionStateData positionState; PathStatusGet(&pathStatus);
PathDesiredGet(&pathDesired); if (pathStatus.fractional_progress >= (1.0f - pathAction.ConditionParameters[0])) {
PositionStateGet(&positionState);
float cur[3] = { positionState.North, positionState.East, positionState.Down };
struct path_status progress;
path_progress(&pathDesired,
cur, &progress, mode3D);
if (progress.fractional_progress >= 1.0f - pathAction.ConditionParameters[0]) {
return true; return true;
} }
return false; return false;