X-Git-Url: http://git.droids-corp.org/?p=protos%2Fimu.git;a=blobdiff_plain;f=MadgwickAHRS.h;fp=MadgwickAHRS.h;h=018f34a768f3d8535fd726b738cc9d09ca87ff9f;hp=18e19fa72a04f649f7d314deba3af385b2f6c3fb;hb=2998e2d15b6098be4c272b187af9438d95b140cf;hpb=849b29b998a8cbc10cd1900d3e5dd1a8488b77f6 diff --git a/MadgwickAHRS.h b/MadgwickAHRS.h index 18e19fa..018f34a 100644 --- a/MadgwickAHRS.h +++ b/MadgwickAHRS.h @@ -1,6 +1,25 @@ -//===================================================================================================== +/* + * Copyright (c) 2014, Olivier MATZ + * Copyright (c) 2011, SOH Madgwick + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +//============================================================================= // MadgwickAHRS.h -//===================================================================================================== +//============================================================================= // // Implementation of Madgwick's IMU and AHRS algorithms. // See: http://www.x-io.co.uk/node/8#open_source_ahrs_and_imu_algorithms @@ -9,25 +28,19 @@ // 29/09/2011 SOH Madgwick Initial release // 02/10/2011 SOH Madgwick Optimised for reduced CPU load // -//===================================================================================================== +//============================================================================= + #ifndef MadgwickAHRS_h #define MadgwickAHRS_h -//---------------------------------------------------------------------------------------------------- -// Variable declaration +#include "imu.h" -extern volatile float beta; // algorithm gain -extern volatile float q0, q1, q2, q3; // quaternion of sensor frame relative to auxiliary frame +extern volatile float beta; // algorithm gain -//--------------------------------------------------------------------------------------------------- -// Function declarations +/* update quaternion structure using the new IMU infos */ +void MadgwickAHRSupdate(const struct imu_info *imu, struct quaternion *quat); -void MadgwickAHRSupdate(float gx, float gy, float gz, float ax, float ay, float az, float mx, float my, float mz); -void MadgwickAHRSupdateIMU(float gx, float gy, float gz, float ax, float ay, float az); -void Mad_f32_init(void); -void MadgwickAHRSupdateIMU_f32(float gx, float gy, float gz, float ax, float ay, float az); +/* update quaternion structure using the new IMU infos, without using magneto */ +void MadgwickAHRSupdateIMU(const struct imu_info *imu, struct quaternion *quat); #endif -//===================================================================================================== -// End of file -//=====================================================================================================