commander: POSCTL with localpos for MC

Fixedwings need a global position estimate for POSCTL.
This commit is contained in:
Julian Oes
2016-07-14 09:53:41 +02:00
parent f430c39f5b
commit 87e964ec10

View File

@@ -674,8 +674,12 @@ bool set_nav_state(struct vehicle_status_s *status, struct commander_state_s *in
}
/* As long as there is RC, we can fallback to ALTCTL, or STAB. */
/* A local position estimate is enough for POSCTL, this enables POSCTL using e.g. flow. */
} else if (!status_flags->condition_local_position_valid && armed) {
/* A local position estimate is enough for POSCTL for multirotors,
* this enables POSCTL using e.g. flow.
* For fixedwing, a global position is needed. */
} else if (((status->is_rotary_wing && !status_flags->condition_local_position_valid) ||
(!status->is_rotary_wing && !status_flags->condition_global_position_valid))
&& armed) {
status->failsafe = true;
if (status_flags->condition_local_altitude_valid) {