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