mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 16:51:37 +08:00
FlightTask: fail activation if required states are not available
This commit is contained in:
committed by
Lorenz Meier
parent
e6f6e2085c
commit
afd02aca92
@@ -47,6 +47,9 @@ bool FlightTaskManualAltitude::activate()
|
||||
_position_setpoint(2) = _position(2);
|
||||
_velocity_setpoint(2) = 0.0f;
|
||||
_setDefaultConstraints();
|
||||
|
||||
// altitude-mode requires to have a valid position and velocity state in D-direction
|
||||
ret = ret && PX4_ISFINITE(_position(2)) && PX4_ISFINITE(_velocity(2));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user