mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-05 03:50:35 +08:00
FlightTask: fail activation if required states are not available
This commit is contained in:
committed by
Lorenz Meier
parent
e6f6e2085c
commit
afd02aca92
@@ -63,6 +63,14 @@ bool FlightTaskAuto::activate()
|
||||
_prev_prev_wp = _prev_wp = _target = _next_wp = _position;
|
||||
_setDefaultConstraints();
|
||||
|
||||
// need a valid position and velocity
|
||||
ret = ret && PX4_ISFINITE(_position(0))
|
||||
&& PX4_ISFINITE(_position(1))
|
||||
&& PX4_ISFINITE(_position(2))
|
||||
&& PX4_ISFINITE(_velocity(0))
|
||||
&& PX4_ISFINITE(_velocity(1))
|
||||
&& PX4_ISFINITE(_velocity(2));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user