From ea884b34f0f13168fee6d36d0b61b0a027f6f8ef Mon Sep 17 00:00:00 2001 From: Andreas Antener Date: Sat, 12 Sep 2015 02:06:37 +0200 Subject: [PATCH] use and reset the new yaw control method --- src/modules/fw_att_control/fw_att_control_main.cpp | 2 ++ src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/fw_att_control/fw_att_control_main.cpp b/src/modules/fw_att_control/fw_att_control_main.cpp index 081645c3ae..de8ee9173e 100644 --- a/src/modules/fw_att_control/fw_att_control_main.cpp +++ b/src/modules/fw_att_control/fw_att_control_main.cpp @@ -964,6 +964,8 @@ FixedwingAttitudeControl::task_main() if (_att_sp.fw_control_yaw == true) { // this method controls heading directly with rudder. Used for auto takeoff on runway _yaw_ctrl.set_coordinated_method(ECL_YawController::COORD_METHOD_HEADING); + } else { + _yaw_ctrl.set_coordinated_method(_parameters.y_coordinated_method); } /* Run attitude controllers */ diff --git a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp index 56da2f7c6e..c8832d830a 100644 --- a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp +++ b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp @@ -1424,7 +1424,7 @@ FixedwingPositionControl::control_position(const math::Vector<2> ¤t_positi // for takeoff we want heading control with rudder, roll and pitch stabilization to zero // throttle should be ramped up to max _att_sp.roll_body = 0.0f; - //_att_sp.fw_control_yaw = true; // tell attitude controller he should control yaw directly + _att_sp.fw_control_yaw = true; // tell attitude controller he should control yaw directly if (_parameters.runway_takeoff_heading == 0) { // fix heading in the direction the airframe points