mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
Plane: quadplane: add allow_weathervane transtion class method
This commit is contained in:
parent
6a719664d3
commit
717b18a680
@ -3259,6 +3259,7 @@ float QuadPlane::get_weathervane_yaw_rate_cds(void)
|
||||
position control.
|
||||
*/
|
||||
if (!in_vtol_mode() ||
|
||||
!transition->allow_weathervane() ||
|
||||
!motors->armed() || (motors->get_desired_spool_state() != AP_Motors::DesiredSpoolState::THROTTLE_UNLIMITED) ||
|
||||
plane.control_mode == &plane.mode_qstabilize ||
|
||||
#if QAUTOTUNE_ENABLED
|
||||
|
@ -960,4 +960,10 @@ MAV_VTOL_STATE Tailsitter_Transition::get_mav_vtol_state() const
|
||||
return MAV_VTOL_STATE_UNDEFINED;
|
||||
}
|
||||
|
||||
// only allow to weathervane once transition is complete and desired pitch has been reached
|
||||
bool Tailsitter_Transition::allow_weathervane()
|
||||
{
|
||||
return !tailsitter.in_vtol_transition() && (vtol_limit_start_ms == 0);
|
||||
}
|
||||
|
||||
#endif // HAL_QUADPLANE_ENABLED
|
||||
|
@ -163,6 +163,8 @@ public:
|
||||
|
||||
bool set_VTOL_roll_pitch_limit(int32_t& nav_roll_cd, int32_t& nav_pitch_cd) override;
|
||||
|
||||
bool allow_weathervane() override;
|
||||
|
||||
private:
|
||||
|
||||
enum {
|
||||
|
@ -52,6 +52,8 @@ public:
|
||||
|
||||
virtual bool set_VTOL_roll_pitch_limit(int32_t& nav_roll_cd, int32_t& nav_pitch_cd) { return false; }
|
||||
|
||||
virtual bool allow_weathervane() { return true; }
|
||||
|
||||
protected:
|
||||
|
||||
// refences for convenience
|
||||
|
Loading…
Reference in New Issue
Block a user