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.
Fork of virgo3_imuHandler_Orion_PCB by
Diff: imuHandler.cpp
- Revision:
- 14:7586410ac0e6
- Parent:
- 13:d329bf89c898
- Parent:
- 11:fb47aa30cc7b
diff -r d329bf89c898 -r 7586410ac0e6 imuHandler.cpp
--- a/imuHandler.cpp	Fri Aug 19 01:13:49 2016 +0000
+++ b/imuHandler.cpp	Mon Aug 22 06:46:22 2016 +0000
@@ -111,6 +111,10 @@
                     unstable_readings --;
                 else {
                     imu_mpu6050.dmpGetYawPitchRoll(imu_initialAngles, &imu_Data.q, &imu_Data.gravity);
+                    
+                    for(int i=0; i<3; i++)
+                        imu_initialAngles[i] = RAD_TO_DEG(imu_initialAngles[i]);
+                
                     mpu_timer.start();
                     unstable_readings --;
 
@@ -156,6 +160,9 @@
                 imuTime_s[1] = imuTime_s[0] + mpu_timer.read();
 
             time_s = imuTime_s[1]; //imu timestamp
+            
+            for(int i=0; i<3; i++)
+                yawPitchRoll[i] = RAD_TO_DEG(yawPitchRoll[i]);
 
             imu_Data.posePRY[2] = -1*(yawPitchRoll[0] - imu_initialAngles[0]- DRIFT_CORRECTION(imuTime_s[1])) - PoseCorrection[0];
             imu_Data.posePRY[1] = yawPitchRoll[1] - imu_initialAngles[1] - PoseCorrection[1];
    