From 3c6d9d69764104ac3528cbc122f38a55e0915c66 Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 30 Aug 2010 01:16:00 +0000 Subject: [PATCH] =?UTF-8?q?manual=20control=20was=20mapping=20tx=20input?= =?UTF-8?q?=20as=20-180=C2=BA=20->=20180=C2=BA=20for=20AttitudeDesired.Yaw?= =?UTF-8?q?.=20The=20Wiki=20(http://wiki.openpilot.org/Unit=5FStandards)?= =?UTF-8?q?=20states=20this=20should=20be=200=20-=20360=C2=BA=20Made=20the?= =?UTF-8?q?=20code=20match=20the=20wiki.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1463 ebee16cc-31ac-478f-84a7-5cbb03baadba --- flight/OpenPilot/Modules/ManualControl/manualcontrol.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/flight/OpenPilot/Modules/ManualControl/manualcontrol.c b/flight/OpenPilot/Modules/ManualControl/manualcontrol.c index fe480d630..4981789b0 100644 --- a/flight/OpenPilot/Modules/ManualControl/manualcontrol.c +++ b/flight/OpenPilot/Modules/ManualControl/manualcontrol.c @@ -197,7 +197,14 @@ static void manualControlTask(void* parameters) { attitude.Roll = cmd.Roll*stabSettings.RollMax; attitude.Pitch = cmd.Pitch*stabSettings.PitchMax; - attitude.Yaw = cmd.Yaw*180.0; + if (cmd.Yaw<0) + { + attitude.Yaw = 360 + (cmd.Yaw*180.0); + } + else + { + attitude.Yaw = (cmd.Yaw*180.0); + } attitude.Throttle = cmd.Throttle*stabSettings.ThrottleMax; AttitudeDesiredSet(&attitude); }