From 1ab6e3158f0dd2bcb938a5d54fdd3cbd2dead93d Mon Sep 17 00:00:00 2001 From: "rmackay9@yahoo.com" Date: Sun, 5 Dec 2010 07:53:18 +0000 Subject: [PATCH] TradHeli - fixed small bug in yaw control code git-svn-id: https://arducopter.googlecode.com/svn/trunk@1022 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- ArducopterNG/Heli.pde | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ArducopterNG/Heli.pde b/ArducopterNG/Heli.pde index c69466c514..8e2fb78ac4 100644 --- a/ArducopterNG/Heli.pde +++ b/ArducopterNG/Heli.pde @@ -232,7 +232,7 @@ void heli_read_radio() rollPitchCollPercent = ccpmDeallocation * ccpmPercents; // get the yaw (not coded) - yawPercent = yawSlope * APM_RC.InputCh(CHANNEL_YAW) + yawIntercept; + yawPercent = (yawSlope * APM_RC.InputCh(CHANNEL_YAW) + yawIntercept) - trim_yaw; // we add 1500 to make it fit in with rest of arduCopter code.. ch_roll = rollPitchCollPercent.x; @@ -249,7 +249,7 @@ void heli_read_radio() command_rx_roll = ch_roll / HELI_STICK_TO_ANGLE_FACTOR; // Convert stick position to absolute angles command_rx_pitch = ch_pitch / HELI_STICK_TO_ANGLE_FACTOR; // Convert stick position to absolute angles command_rx_collective = ch_collective; - command_rx_yaw = (ch_yaw-trim_yaw) / HELI_YAW_STICK_TO_ANGLE_FACTOR; // Convert stick position to turn rate + command_rx_yaw = ch_yaw / HELI_YAW_STICK_TO_ANGLE_FACTOR; // Convert stick position to turn rate // hardcode flight mode flightMode = STABLE_MODE;