Browse Source

Plane: quadplane: add allow_weathervane transtion class method

gps-1.3.1
Peter Hall 3 years ago committed by Andrew Tridgell
parent
commit
717b18a680
  1. 1
      ArduPlane/quadplane.cpp
  2. 6
      ArduPlane/tailsitter.cpp
  3. 2
      ArduPlane/tailsitter.h
  4. 2
      ArduPlane/transition.h

1
ArduPlane/quadplane.cpp

@ -3259,6 +3259,7 @@ float QuadPlane::get_weathervane_yaw_rate_cds(void) @@ -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

6
ArduPlane/tailsitter.cpp

@ -960,4 +960,10 @@ MAV_VTOL_STATE Tailsitter_Transition::get_mav_vtol_state() const @@ -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

2
ArduPlane/tailsitter.h

@ -163,6 +163,8 @@ public: @@ -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 {

2
ArduPlane/transition.h

@ -52,6 +52,8 @@ public: @@ -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…
Cancel
Save