mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
AHRS: Get the signs for the simple algorithm correct
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1385 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
e94d3d3846
commit
beac0c0ea9
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user