From 3e2a253f4aeab0bfa838216713756b5f396d614d Mon Sep 17 00:00:00 2001 From: Mark Whitehorn Date: Thu, 11 Apr 2019 16:48:27 -0600 Subject: [PATCH] Plane: in QACRO mode, use multicopter attitude target to set nav_roll/pitch --- ArduPlane/mode_qstabilize.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ArduPlane/mode_qstabilize.cpp b/ArduPlane/mode_qstabilize.cpp index a87c7b0c7a..5315c0acb4 100644 --- a/ArduPlane/mode_qstabilize.cpp +++ b/ArduPlane/mode_qstabilize.cpp @@ -17,6 +17,13 @@ bool ModeQStabilize::_enter() void ModeQStabilize::update() { + if (plane.quadplane.tailsitter_active() && (plane.control_mode == &plane.mode_qacro)) { + // get nav_roll and nav_pitch from multicopter attitude controller + Vector3f att_target = plane.quadplane.attitude_control->get_att_target_euler_cd(); + plane.nav_pitch_cd = att_target.y; + plane.nav_roll_cd = att_target.x; + return; + } // set nav_roll and nav_pitch using sticks int16_t roll_limit = MIN(plane.roll_limit_cd, plane.quadplane.aparm.angle_max); plane.nav_roll_cd = (plane.channel_roll->get_control_in() / 4500.0) * roll_limit;