Quadcopter software. Flying - Contact me for more details or a copy of the PC ground station code

Dependencies:   ConfigFile PID PPM MODSERIAL mbed-rtos mbed MaxbotixDriver TinyGPS filter

Revision:
9:7b194f83e567
Parent:
7:bc5822aa8878
--- a/rcCommandMonitor.h	Tue Feb 10 20:58:12 2015 +0000
+++ b/rcCommandMonitor.h	Sun Feb 22 20:10:12 2015 +0000
@@ -34,10 +34,10 @@
             i = 0;
             
             //Map yaw channel
-            _rcMappedCommands[0] = - /*_yawMedianFilter->process(*/Map(_rcCommands[3], RC_OUT_MIN, RC_OUT_MAX, RC_YAW_RATE_MIN, RC_YAW_RATE_MAX);//);
+            _rcMappedCommands[0] = - _yawMedianFilter->process(Map(_rcCommands[3], RC_OUT_MIN, RC_OUT_MAX, RC_YAW_RATE_MIN, RC_YAW_RATE_MAX));
         
             //Map thust channel
-            _rcMappedCommands[3] = /*_thrustMedianFilter->process(*/Map(_rcCommands[2], RC_OUT_MIN, RC_OUT_MAX, RC_THRUST_MIN, RC_THRUST_MAX);//);
+            _rcMappedCommands[3] = _thrustMedianFilter->process(Map(_rcCommands[2], RC_OUT_MIN, RC_OUT_MAX, RC_THRUST_MIN, RC_THRUST_MAX));
         
             //Map arm channel.
             if(_rcCommands[4] > 0.5 && _armed == false) Arm();
@@ -62,16 +62,16 @@
             if(_rate == false && _stab == true)//Stability mode
             {
                 //Roll
-                _rcMappedCommands[2] = /*_rollMedianFilter->process(*/Map(_rcCommands[0], RC_OUT_MIN, RC_OUT_MAX, RC_ROLL_ANGLE_MIN, RC_ROLL_ANGLE_MAX);//);
+                _rcMappedCommands[2] = _rollMedianFilter->process(Map(_rcCommands[0], RC_OUT_MIN, RC_OUT_MAX, RC_ROLL_ANGLE_MIN, RC_ROLL_ANGLE_MAX));
                 //Pitch
-                _rcMappedCommands[1] = /*_pitchMedianFilter->process(*/-Map(_rcCommands[1], RC_OUT_MIN, RC_OUT_MAX, RC_PITCH_ANGLE_MIN, RC_PITCH_ANGLE_MAX);//); //Needs to be reverse
+                _rcMappedCommands[1] = _pitchMedianFilter->process(-Map(_rcCommands[1], RC_OUT_MIN, RC_OUT_MAX, RC_PITCH_ANGLE_MIN, RC_PITCH_ANGLE_MAX)); //Needs to be reverse
             }
             else if(_rate == true && _stab == false)//Rate mode
             {
                 //Roll
-                _rcMappedCommands[2] = /*_rollMedianFilter->process(*/Map(_rcCommands[0], RC_OUT_MIN, RC_OUT_MAX, RC_ROLL_RATE_MIN, RC_ROLL_RATE_MAX);//);
+                _rcMappedCommands[2] = _rollMedianFilter->process(Map(_rcCommands[0], RC_OUT_MIN, RC_OUT_MAX, RC_ROLL_RATE_MIN, RC_ROLL_RATE_MAX));
                 //Pitch
-                _rcMappedCommands[1] = /*_pitchMedianFilter->process(*/-Map(_rcCommands[1], RC_OUT_MIN, RC_OUT_MAX, RC_PITCH_RATE_MIN, RC_PITCH_RATE_MAX);//); //Needs to be reverse
+                _rcMappedCommands[1] = _pitchMedianFilter->process(-Map(_rcCommands[1], RC_OUT_MIN, RC_OUT_MAX, RC_PITCH_RATE_MIN, RC_PITCH_RATE_MAX)); //Needs to be reverse
             }
             else
             {
@@ -84,12 +84,6 @@
             //Transmitter not connected so increase iterator
             i++;
             
-            //Set commands to 0
-            _rcMappedCommands[0] = 0;
-            _rcMappedCommands[1] = 0;
-            _rcMappedCommands[2] = 0;
-            _rcMappedCommands[3] = -1;
-            
             //If connection has been down for 10 loops then assume the connection really is lost
             if(i > 10 && _armed == true) Disarm();
         }