2 * Copyright (c) 2014, Olivier MATZ <zer0@droids-corp.org>
\r
3 * Copyright (c) 2011, SOH Madgwick
\r
5 * This program is free software: you can redistribute it and/or modify
\r
6 * it under the terms of the GNU General Public License as published by
\r
7 * the Free Software Foundation, either version 3 of the License, or
\r
8 * (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
20 //=============================================================================
\r
22 //=============================================================================
\r
24 // Implementation of Madgwick's IMU and AHRS algorithms.
\r
25 // See: http://www.x-io.co.uk/node/8#open_source_ahrs_and_imu_algorithms
\r
27 // Date Author Notes
\r
28 // 29/09/2011 SOH Madgwick Initial release
\r
29 // 02/10/2011 SOH Madgwick Optimised for reduced CPU load
\r
31 //=============================================================================
\r
33 #ifndef MadgwickAHRS_h
\r
34 #define MadgwickAHRS_h
\r
38 extern volatile float beta; // algorithm gain
\r
40 /* update quaternion structure using the new IMU infos */
\r
41 void MadgwickAHRSupdate(const struct imu_info *imu, struct quaternion *quat);
\r
43 /* update quaternion structure using the new IMU infos, without using magneto */
\r
44 void MadgwickAHRSupdateIMU(const struct imu_info *imu, struct quaternion *quat);
\r