added gy80 dcm
Dependencies: mbed DCM_AHRS_GY80 PID MMA8451Q
Fork of quadCommand by
Diff: quadCommand/quadCommand.cpp
- Revision:
- 46:f1eb22f41ebc
- Parent:
- 43:e2fc699e8e8c
- Child:
- 47:adc1a438aa33
--- a/quadCommand/quadCommand.cpp Mon Jun 10 01:46:43 2013 +0000 +++ b/quadCommand/quadCommand.cpp Mon Jun 10 02:10:19 2013 +0000 @@ -13,7 +13,6 @@ pidRoll(1.5,0.1,1.20,DEFAULT_WINDUP_GUARD), pidYaw(1.5,0.1,1.20,DEFAULT_WINDUP_GUARD) { - Ticker sensorProcess; //sensorProcess.attach( this,&quadCommand::sendTelemetry, 2 ); sensorProcess.attach( this, &quadCommand::updateCurrent, .002 ); @@ -74,12 +73,16 @@ roll = pidRoll.correct(currentRoll, targetRoll, MOTOR_UPDATE); yaw = 0.0; //pidYaw.correct(currentYaw, targetYaw, MOTOR_UPDATE); + DEBUG(pc.printf("----------------------------------------");) + DEBUG(pc.printf("cur : { t : %f, p : %f, r : %f, y : %f }\r\n", currentThrottle, currentPitch, currentRoll, 0.0);) + DEBUG(pc.printf("tar : { t : %f, p : %f, r : %f, y : %f }\r\n", targetThrottle, targetPitch, targetRoll, 0.0);) DEBUG(pc.printf("att : { t : %f, p : %f, r : %f, y : %f }\r\n", throttle, pitch, roll, yaw);) + DEBUG(pc.printf("----------------------------------------");) - int speed0 = throttle + pitch - roll - yaw; - int speed1 = throttle + pitch + roll + yaw; - int speed2 = throttle - pitch + roll - yaw; - int speed3 = throttle - pitch - roll + yaw; + float speed0 = throttle + pitch - roll - yaw; + float speed1 = throttle + pitch + roll + yaw; + float speed2 = throttle - pitch + roll - yaw; + float speed3 = throttle - pitch - roll + yaw; DEBUG(pc.printf("motor : [ %f , %f , %f , %f ]\r\n", speed0, speed1, speed2, speed3);)