added gy80 dcm
Dependencies: mbed DCM_AHRS_GY80 PID MMA8451Q
Fork of quadCommand by
Diff: quadCommand/quadCommand.cpp
- Revision:
- 17:d73944c3c945
- Parent:
- 16:84c7db5b4464
- Child:
- 18:c7df2edd73f0
--- a/quadCommand/quadCommand.cpp Mon Jun 10 00:04:56 2013 +0000 +++ b/quadCommand/quadCommand.cpp Mon Jun 10 00:10:15 2013 +0000 @@ -6,7 +6,11 @@ const float quadCommand::MOTOR_UPDATE(20.0f); -quadCommand::quadCommand() +quadCommand::quadCommand() : + pidThrottle(1.5,0.1,1.20,DEFAULT_WINDUP_GUARD), + pidPitch(1.5,0.1,1.20,DEFAULT_WINDUP_GUARD), + pidRoll(1.5,0.1,1.20,DEFAULT_WINDUP_GUARD), + pidYaw(1.5,0.1,1.20,DEFAULT_WINDUP_GUARD) { myCom = new com( TXPIN, RXPIN ); // Setup com object. world = new sensors(); // Setup the sensors. @@ -15,11 +19,6 @@ myMotors[1] = new motor( MOTOR2 ); // Connect motor 1 to PTA12 pin. myMotors[2] = new motor( MOTOR3 ); // Connect motor 2 to PTA4 pin. myMotors[3] = new motor( MOTOR4 ); // Connect motor 3 to PTA5 pin. - - rxThrottle = 0; - rxPitch = 0; - rxRoll = 0; - rxYaw = 0; } /******************************* run() ***********************************/ @@ -72,6 +71,4 @@ myMotors[ 1 ]->setSpeed( throttle + pitch + roll + yaw); // Motor 2 myMotors[ 2 ]->setSpeed( throttle - pitch + roll - yaw); // Motor 3 myMotors[ 3 ]->setSpeed( throttle - pitch - roll + yaw); // Motor 4 - - delete[] command; } \ No newline at end of file