From beac0c0ea9d520a436e905e8dcfc89965eb23ce3 Mon Sep 17 00:00:00 2001 From: peabody124 Date: Mon, 23 Aug 2010 04:12:14 +0000 Subject: [PATCH] AHRS: Get the signs for the simple algorithm correct git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1385 ebee16cc-31ac-478f-84a7-5cbb03baadba --- flight/AHRS/ahrs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flight/AHRS/ahrs.c b/flight/AHRS/ahrs.c index d5f448956..dfaafdf8a 100644 --- a/flight/AHRS/ahrs.c +++ b/flight/AHRS/ahrs.c @@ -353,8 +353,8 @@ int main() /***************** SIMPLE ATTITUDE FROM NORTH AND ACCEL ************/ /* Very simple computation of the heading and attitude from accel. */ rpy[2] = atan2((mag_data.raw.axis[0]), (-1 * mag_data.raw.axis[1])) * 180 / M_PI; - rpy[1] = -atan2(accel_data.filtered.x, accel_data.filtered.z) * 180 / M_PI; - rpy[0] = -atan2(accel_data.filtered.y,accel_data.filtered.z) * 180 / M_PI; + rpy[1] = atan2(accel_data.filtered.x, accel_data.filtered.z) * 180 / M_PI; + rpy[0] = atan2(accel_data.filtered.y,accel_data.filtered.z) * 180 / M_PI; RPY2Quaternion(rpy,q); attitude_data.quaternion.q1 = q[0];