mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-18 06:38:29 -04:00
Plane: Quadplane: move disable of assistance in flare to should_assist
function
This commit is contained in:
parent
8196c899e8
commit
20015c60a7
@ -121,20 +121,11 @@ void RC_Channel_Plane::do_aux_function_flare(AuxSwitchPos ch_flag)
|
|||||||
switch(ch_flag) {
|
switch(ch_flag) {
|
||||||
case AuxSwitchPos::HIGH:
|
case AuxSwitchPos::HIGH:
|
||||||
plane.flare_mode = Plane::FlareMode::ENABLED_PITCH_TARGET;
|
plane.flare_mode = Plane::FlareMode::ENABLED_PITCH_TARGET;
|
||||||
#if HAL_QUADPLANE_ENABLED
|
|
||||||
plane.quadplane.assist.set_state(QuadPlane::VTOL_Assist::STATE::ASSIST_DISABLED);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case AuxSwitchPos::MIDDLE:
|
case AuxSwitchPos::MIDDLE:
|
||||||
plane.flare_mode = Plane::FlareMode::ENABLED_NO_PITCH_TARGET;
|
plane.flare_mode = Plane::FlareMode::ENABLED_NO_PITCH_TARGET;
|
||||||
#if HAL_QUADPLANE_ENABLED
|
|
||||||
plane.quadplane.assist.set_state(QuadPlane::VTOL_Assist::STATE::ASSIST_DISABLED);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case AuxSwitchPos::LOW:
|
case AuxSwitchPos::LOW:
|
||||||
#if HAL_QUADPLANE_ENABLED
|
|
||||||
plane.quadplane.assist.set_state(QuadPlane::VTOL_Assist::STATE::ASSIST_ENABLED);
|
|
||||||
#endif
|
|
||||||
plane.flare_mode = Plane::FlareMode::FLARE_DISABLED;
|
plane.flare_mode = Plane::FlareMode::FLARE_DISABLED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1481,6 +1481,12 @@ bool QuadPlane::VTOL_Assist::should_assist(float aspeed, bool have_airspeed)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (plane.flare_mode != Plane::FlareMode::FLARE_DISABLED) {
|
||||||
|
// Never active in fixed wing flare
|
||||||
|
reset();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (state == STATE::FORCE_ENABLED) {
|
if (state == STATE::FORCE_ENABLED) {
|
||||||
// force enabled, no need to check thresholds
|
// force enabled, no need to check thresholds
|
||||||
reset();
|
reset();
|
||||||
|
Loading…
Reference in New Issue
Block a user