Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
GurvIMU.h
00001 #ifndef _GURVIMU_H_ 00002 #define _GURVIMU_H_ 00003 00004 #include "mbed.h" 00005 #include "MPU6050.h" 00006 00007 class GurvIMU { 00008 private: 00009 //Variables 00010 MPU6050 mpu; 00011 float twoKp; // 2 * proportional gain (Kp) 00012 float twoKi; // 2 * integral gain (Ki) 00013 float integralFBx, integralFBy, integralFBz; // integral error terms scaled by Ki 00014 float q0, q1, q2, q3; // quaternion of sensor frame relative to auxiliary frame 00015 float ax, ay, az, gx, gy, gz; 00016 float sample_freq; 00017 float offset[6]; 00018 Timer timer_us; 00019 float dt_us; 00020 float cycle_nb; 00021 00022 00023 //Functions 00024 void getOffset(); 00025 00026 void AHRS_update(float gx, float gy, float gz, float ax, float ay, float az); 00027 void getQ(float * q); 00028 00029 public: 00030 GurvIMU(); 00031 void init(); 00032 void getValues(float * values); 00033 void getYawPitchRollRad(float * ypr); 00034 void getVerticalAcceleration(float av); 00035 00036 }; 00037 00038 //Fast Inverse Square Root 00039 float invSqrt(float number); 00040 00041 #endif /* _GURVIMU_H_ */
Generated on Wed Jul 13 2022 00:49:05 by
1.7.2