ジャパンオープン用のメインプログラム

Dependencies:   mbed AQM1602 HMC6352 PID

Revision:
10:6df631c39f9b
Parent:
9:c966191926c5
Child:
11:3efae754e6ef
--- a/main_processing/strategy_parts/output.cpp	Tue Mar 08 09:52:22 2016 +0000
+++ b/main_processing/strategy_parts/output.cpp	Thu Mar 10 03:03:50 2016 +0000
@@ -10,10 +10,14 @@
 
     pid.setProcessValue(cmps_set.InputPID);
     cmps_set.OutputPID = -pid.compute();
+    if((abs(cmps_set.OutputPID)<PID_OUT_MIN)&&(cmps_set.OutputPID!=0)){
+        if(cmps_set.OutputPID>0) cmps_set.OutputPID=PID_OUT_MIN;
+        else cmps_set.OutputPID=-PID_OUT_MIN;
+    }
 }
 void FrontHere(void){
-    ReadCmps();
-    cmps_set.CmpsInitialValue = cmps_set.cmps;
+    //ReadCmps();
+    //cmps_set.CmpsInitialValue = cmps_set.cmps;
     
     cmps_set.CmpsDiff = (REFERENCE-cmps_set.FrontDeg) - cmps_set.cmps;
 }
@@ -30,7 +34,7 @@
     }
 }
 void tx_motor(){//モーターへの送信
-    array2(speed[1],-speed[0],-speed[2],speed[3]);//右後左無
+    array2(speed[1],-speed[0],-speed[2],-speed[3]);//右後左無
     motor.printf("%s",StringFIN.c_str());
 }
 void move(int vx, int vy, int vs){//三輪オムニの移動(基本の形)
@@ -40,7 +44,7 @@
     pwm[0] = (double)((vx) + vs);
     pwm[1] = (double)((-0.5 * vx) + ((sqrt(3.0) / 2.0)  * vy) + vs);
     pwm[2] = (double)((-0.5 * vx) + ((-sqrt(3.0) / 2.0) * vy) + vs);
-    pwm[3] = 0;
+    pwm[3] = (sys.dri_pow)*(sys.DribbleFlag);
 
     for(i = 0; i < 4; i++){
         if(pwm[i] > 100){