Browse Source

Plane: tailsitters in Qassist inherit motor state

zr-v5.1
Iampete1 5 years ago committed by Andrew Tridgell
parent
commit
b61cf72b8c
  1. 14
      ArduPlane/mode.cpp
  2. 2
      ArduPlane/mode.h

14
ArduPlane/mode.cpp

@ -86,3 +86,17 @@ bool Mode::enter() @@ -86,3 +86,17 @@ bool Mode::enter()
return enter_result;
}
bool Mode::is_vtol_man_throttle() const
{
if (!plane.quadplane.in_vtol_mode() &&
plane.quadplane.is_tailsitter() &&
plane.quadplane.tailsitter_transition_fw_complete() &&
plane.quadplane.assisted_flight) {
// a tailsitter that has fully transisisoned to Q-assisted forward flight
// in this case the forward throttle directly drives the vertical throttle
// set vertical throttle state to match the forward throttle state. Confusingly the booleans are inverted,
// forward throttle uses 'auto_throttle_mode' whereas vertical used 'is_vtol_man_throttle'
return !plane.auto_throttle_mode;
}
return false;
}

2
ArduPlane/mode.h

@ -71,7 +71,7 @@ public: @@ -71,7 +71,7 @@ public:
// true for all q modes
virtual bool is_vtol_mode() const { return false; }
virtual bool is_vtol_man_throttle() const { return false; }
virtual bool is_vtol_man_throttle() const;
virtual bool is_vtol_man_mode() const { return false; }
// guided or adsb mode
virtual bool is_guided_mode() const { return false; }

Loading…
Cancel
Save