2015_robocon_bteam / Mbed 2 deprecated 2015robot_main

Dependencies:   PID QEI mbed

Fork of 2015robot_main by Naoto Deguchi

Revision:
60:4a75f3f3a934
Parent:
59:9d66edf3e734
Child:
61:e018207ae860
--- a/main_ps3.cpp	Thu Oct 01 09:52:36 2015 +0000
+++ b/main_ps3.cpp	Fri Oct 02 07:24:52 2015 +0000
@@ -61,8 +61,9 @@
             autoPS3();   /*PS3 button*/
 #endif
 #ifdef BLUE
-            //Blue
-            if((step==0)&&((8650.0>x)&&(x>1400.0))) targ_sita=0.0,step=1;
+            //Blue            
+//            if((step==0)&&((8650.0>x)&&(x>1400.0))) targ_sita=0.0,step=1;
+            if((step==0)&&((8650.0>x)&&(x>1400.0))) targ_sita=0.015,step=1;
             if((step==1)&&(x>8650.0)) targ_velocity=-speed,step=2;
             if((step==2)&&(x<2000.0)) targ_sita=PI/4,step=3;
             if((step==3)&&(x<10.0)) targ_velocity=0.0,step=4;
@@ -70,9 +71,9 @@
             if((x>3344.0)&&(CStep==1)) CStep=2,sendData(1,1);
             if((x>6234.0)&&(CStep==2)) CStep=3,sendData(1,2);
             if((x>7885.0)&&(CStep==3)) CStep=4,sendData(1,3);
-//            if((x<6700.0)&&(CStep==4)) CStep=5,sendData(1,5);
-            if((x<6750.0)&&(CStep==4)) CStep=5,sendData(1,5);
-            if((x<6300.0)&&(CStep==5)) CStep=6,sendData(1,4);
+//            if((x<6750.0)&&(CStep==4)) CStep=5,sendData(1,5);
+//            if((x<6300.0)&&(CStep==5)) CStep=6,sendData(1,4);
+            if((x<6000.0)&&(CStep==4)) CStep=5,sendData(1,5);
 #else
             //Red
             if((step==0)&&((8650.0>x)&&(x>1400.0))) targ_sita=0.0,step=1;
@@ -97,7 +98,7 @@
             manualPS3();       /*PS3 button*/
 #endif
             //Swing
-            swingFollowing();
+//            swingFollowing();
             /*if(square){
                 IndicatorAuto=0;
                 fclose(fp_r);
@@ -116,7 +117,5 @@
 //        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\r\n",cont,swingRadVelocity);
-        double pt=(2 * PI) / swingRadVelocity;
-        pc.printf("%f\r\n",pt);
     }
 }
\ No newline at end of file