Plane: quadplane: tailsitter: always relax pitch after transtion

This commit is contained in:
Peter Hall 2021-11-10 02:16:51 +00:00 committed by Andrew Tridgell
parent d054ca0426
commit 9df753551e
3 changed files with 14 additions and 4 deletions

View File

@ -906,7 +906,7 @@ void QuadPlane::relax_attitude_control()
{
// disable roll and yaw control for vectored tailsitters
// if not a vectored tailsitter completely disable attitude control
attitude_control->relax_attitude_controllers(tailsitter._is_vectored);
attitude_control->relax_attitude_controllers(!tailsitter.relax_pitch());
}
/*

View File

@ -685,6 +685,14 @@ void Tailsitter::speed_scaling(void)
}
}
// return true if pitch control should be relaxed
// on vectored belly sitters the pitch control is not relaxed in order to keep motors pointing and avoid risk of props hitting the ground
// always relax after a transition
bool Tailsitter::relax_pitch()
{
return !enabled() || !_is_vectored || (transition->vtol_limit_start_ms != 0);
}
/*
update for transition from quadplane to fixed wing mode
*/

View File

@ -62,9 +62,8 @@ public:
// return the transition_angle_vtol value
int8_t get_transition_angle_vtol() const;
// true when flying a tilt-vectored tailsitter
bool _is_vectored;
// return true if pitch control should be relaxed
bool relax_pitch();
// tailsitter speed scaler
float last_spd_scaler = 1.0f; // used to slew rate limiting with TAILSITTER_GSCL_ATT_THR option
@ -111,6 +110,9 @@ private:
bool setup_complete;
// true when flying a tilt-vectored tailsitter
bool _is_vectored;
// refences for convenience
QuadPlane& quadplane;
AP_MotorsMulticopter*& motors;