2015_robocon_bteam / Mbed 2 deprecated 2015robot_main

Dependencies:   PID QEI mbed

Fork of 2015robot_main by Naoto Deguchi

Revision:
100:5769dc0e7478
Parent:
94:086b53bd195e
Parent:
99:ee7f78d64c14
Child:
101:b67d33e56b66
--- a/main_ps3.cpp	Fri Oct 16 10:47:50 2015 +0000
+++ b/main_ps3.cpp	Fri Oct 16 10:58:18 2015 +0000
@@ -201,7 +201,7 @@
             }
             /********************************Nomal Mode*********************************/
             if((step==0)&&((8650.0>x)&&(x>850.0))) {
-                targ_sita=-0.035;
+                targ_sita=0.0;
                 step=1; 
             }
             if((step==1)&&(x>8600.0)) {
@@ -212,7 +212,7 @@
                 step=3;
                 spcount=0.0;
                 flagf=0;
-                targ_sita=-0.045;
+                targ_sita=0.0;
             }
             if((step==3)&&(x<2000.0)) {
                 targ_sita=-PI/4;
@@ -224,30 +224,30 @@
                 step=114;
             }
             
-            if((x>2950.0)&&(CStep==1)) { 
+            if((x>3100.0)&&(CStep==1)) { 
                 if(!skip) sendData(1,1);
                 CStep=2;
             }
-            if((x>5850.0)&&(CStep==2)) {
+            if((x>5940.0)&&(CStep==2)) {
                 if(!skip) sendData(1,2);
                 CStep=3;
             }
-            if((x>7600.0)&&(CStep==3)) {
+            if((x>7650.0)&&(CStep==3)) {
                 if(!skip) sendData(1,3);
                 CStep=6;
             }
-            if((x<6650.0)&&(CStep==4)) {
+            if((x<6700.0)&&(CStep==4)) {
                 if(!skip) sendData(1,4);
                 CStep=5;
             }
-            if((x<6130.0)&&(CStep==5)) {
+            if((x<6160.0)&&(CStep==5)) {
                 if(!skip) sendData(1,5);
                 CStep=114;
             }
             /////////////////////////////////////////////////////////////////////////
             /******************************Middle Mode******************************/
             if((step==5)&&((5700.0>x)&&(x>800.0))) {
-                targ_sita=-0.035;
+                targ_sita=0.0;
                 step=6;
             }
             if((step==6)&&(x>7000.0)){
@@ -257,7 +257,7 @@
             if((step==7)&&((velocity<500.0)&&(velocity>-500.0))){
                 flagf=0;
                 spcount=0.0;
-                targ_sita=-0.045;
+                targ_sita=0.0;
                 step=8;
             }
             if((step==8)&&(x<1900.0)) {
@@ -281,7 +281,7 @@
             /////////////////////////////////////////////////////////////////////////
             /*****************************Opponents Mode****************************/
             if((step==15)&&((5700.0>x)&&(x>70.0))) {
-                targ_sita=-0.035;
+                targ_sita=0.0;
                 step=16;
             }
             if((step==16)&&(x>2800.0)){
@@ -291,7 +291,7 @@
             if((step==17)&&((velocity<500.0)&&(velocity>-500.0))){
                 flagf=0;
                 spcount=0.0;
-                targ_sita=-0.045;
+                targ_sita=0.0;
                 step=18;
             }
             if((step==18)&&(x<-100.0)){
@@ -300,8 +300,12 @@
                 step=114;
             }
             
-            if((x>2700.0)&&(CStep==15)){
+            if((x>950.0)&&(CStep==15)){
                 sendData(1,4);
+                CStep=16;
+            }
+            if((x>2350.0)&&(CStep==16)){
+                sendData(1,5);
                 CStep=114;
             }
             /////////////////////////////////////////////////////////////////////////
@@ -323,6 +327,7 @@
 #ifdef MESURE
             if(down){
                 IndicatorAuto=0;
+
                 fclose(fp_r);
             }
             fprintf(fp_r, "time:%1.3f, %f[rad/s], pwm:%f\r\n",time,swingRadVelocity,cont);
@@ -338,6 +343,6 @@
 
 //        pc.printf("sita:%f, x:%f, y:%f ,x1:%f, x2:%f ,velocity:%f\r\n",sita,x,y,x1,x2,velocity);
 //        pc.printf("A2 = %d, X = %d, Y = %d, B = %d, dead = %d\r\n", a2, X, Y, b, deadflag);
-        pc.printf("%f %f %f\r\n",cont,swingRadVelocity, (double)SwingSens.getPulses());
+//        pc.printf("%f %f %f\r\n",cont,swingRadVelocity, (double)SwingSens.getPulses());
     }
 }
\ No newline at end of file