德国四元惯性导航算法.docVIP

  • 2
  • 0
  • 约5.28万字
  • 约 9页
  • 2017-07-26 发布于河南
  • 举报
德国四元惯性导航算法

/* * AHRS * Copyright 2010 S.O.H. Madgwick * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser 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 * Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with this program. If not, see * /licenses/. */ // AHRS.c // S.O.H. Madgwick // 25th August 2010 // // Quaternion implementation of the DCM filter [Mayhony et al]. Incorporates the magnetic distortion // compensation algorithms from my filter [Madgwick] which eliminates the need for a reference // direction of flux (bx bz) to be predefined and limits the effect of magnetic distortions to yaw // axis only. // // User must define halfT as the (sample period / 2), and the filter gains Kp and Ki. // // Global variables q0, q1, q2, q3 are the quaternion elements representing the estimated // orientation. See my report for an overview of the use of quaternions in this application. // // User must call AHRSupdate() every sample period and parse calibrated gyroscope (gx, gy, gz), // accelerometer (ax, ay, ay) and magnetometer (mx, my, mz) data. Gyroscope units are // radians/second, accelerometer and magnetometer units are irrelevant as the vector is normalised. // #include stm32f10x.h #include AHRS.h #include Positioning.h #include math.h #include stdio.h /* Private define ------------------------------------------------------------*/ #define Kp 2.0f

文档评论(0)

1亿VIP精品文档

相关文档