mirror of https://github.com/ArduPilot/ardupilot
Plane: avoid calling quadplane methods if quadplane not available
one block was guarded, the second not
This commit is contained in:
parent
68003a5eb4
commit
96f7d8a969
|
@ -514,16 +514,21 @@ void Plane::update_fly_forward(void)
|
||||||
// wing aircraft. This helps the EKF produce better state
|
// wing aircraft. This helps the EKF produce better state
|
||||||
// estimates as it can make stronger assumptions
|
// estimates as it can make stronger assumptions
|
||||||
#if HAL_QUADPLANE_ENABLED
|
#if HAL_QUADPLANE_ENABLED
|
||||||
if (quadplane.available() &&
|
if (quadplane.available()) {
|
||||||
quadplane.tailsitter.is_in_fw_flight()) {
|
if (quadplane.tailsitter.is_in_fw_flight()) {
|
||||||
ahrs.set_fly_forward(true);
|
ahrs.set_fly_forward(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quadplane.in_vtol_mode() ||
|
if (quadplane.in_vtol_mode()) {
|
||||||
quadplane.in_assisted_flight()) {
|
ahrs.set_fly_forward(false);
|
||||||
ahrs.set_fly_forward(false);
|
return;
|
||||||
return;
|
}
|
||||||
|
|
||||||
|
if (quadplane.in_assisted_flight()) {
|
||||||
|
ahrs.set_fly_forward(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue