added gy80 dcm

Dependencies:   mbed DCM_AHRS_GY80 PID MMA8451Q

Fork of quadCommand by Greg Abdo

Revision:
63:f4cb482ac5d4
Parent:
62:70fc58d4be9b
--- a/quadCommand/quadCommand.h	Fri Jul 26 02:42:31 2013 +0000
+++ b/quadCommand/quadCommand.h	Sun Jul 28 21:44:00 2013 +0000
@@ -8,11 +8,10 @@
 #include "mbed.h"
 #include "motor.h"
 #include "com.h"
-#include "sensors.h"
+#include "DCM.h"
 #include "PID.h"
-#include "DCM.h"
 
-#define TRIM_VALUE .01
+#define TRIM_VALUE .05
 
 // Motor constants.
 #define MOTOR1              PTD4        // Pin used for motor 1.
@@ -34,7 +33,7 @@
 #define DEFAULT_WINDUP_GUARD 5.0        // Integral windup.
 #define PID_P 1.0                       // Proportional gain.
 #define PID_I 0.0                       // Integral gain.
-#define PID_D 0.0                       // Derivative gain.
+#define PID_D 0.5                       // Derivative gain.
 #define MOTOR_UPDATE       150.0        // Motor update speed.
 
 class quadCommand 
@@ -49,17 +48,15 @@
     private:
         motor *myMotors[4];             // Array of motor objects.
         com *myCom;                     // The com object for Xbee communication.
-        //sensors *world;                 // Sensors used to observe the world.
-        DCM *world;
+        DCM *world;                 // Sensors used to observe the world.
         
         PID *pidPitch;                   // PID for pitch.
         PID *pidRoll;                    // PID for roll.
         PID *pidYaw;                     // PID for yaw.
         
+        Ticker motorProcess;            // Timer for updating the motors.
         Timer timer;
-        Ticker motorProcess;            // Timer for updating the motors.
-        
-        float G_Dt;
+
         float currentThrottle;          // Current throttle.
         float currentPitch;             // Current pitch.
         float currentRoll;              // Current roll.
@@ -73,9 +70,9 @@
         float targetPitch;              // Desired pitch.
         float targetRoll;               // Desired roll.
         float targetYaw;                // Desired yaw. 
-    
-        long timestamp_old;
-        long timestamp;
+        float G_Dt;
+        int timestamp_old;
+        int timestamp;
 };
 
 #endif
\ No newline at end of file