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:
parent
eebbfcea64
commit
c4aa17a04c
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user