2015_robocon_bteam / Mbed 2 deprecated 2015robot_main_zenkoku

Dependencies:   PID QEI mbed

Files at this revision

API Documentation at this revision

Comitter:
DeguNaoto
Date:
Thu Nov 19 07:25:27 2015 +0000
Parent:
42:c420857a3a6f
Commit message:
20151119 ????????

Changed in this revision

autoMode.h Show annotated file Show diff for this revision Revisions of this file
main_ps3.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/autoMode.h	Wed Nov 18 04:24:35 2015 +0000
+++ b/autoMode.h	Thu Nov 19 07:25:27 2015 +0000
@@ -52,7 +52,7 @@
             sendData(5,70); //over
 //            sendData(5,68); //over
             wait(0.05);
-            sendData(4,70); //front
+            sendData(4,69); //front
 //            sendData(4,68); //front
             wait(0.05);
             sendData(6,14); //middle
@@ -85,10 +85,10 @@
             dpcount=0.0;
             direction_controller.setBias(0.0);
 #ifdef BLUE
-            sendData(5,68); 
+            sendData(5,65); 
 //            sendData(5,67); //over cylinder4
             wait(0.05);
-            sendData(4,72); 
+            sendData(4,67); 
 //            sendData(4,75); //front
             wait(0.05);
             sendData(6,1); //middle
@@ -113,17 +113,17 @@
     }
     if((b==8)&&(!flaga)){ //Middle Start
         if(edge8){
-            edge6=0;
+            edge8=0;
             resetState(1);
             flagf=1;
             spcount=0.0;
             dpcount=0.0;
             direction_controller.setBias(0.0);
 #ifdef BLUE
-            sendData(5,69); //over
+            sendData(5,70); //over
 //            sendData(5,69); //over
             wait(0.05);
-            sendData(4,70); //front
+            sendData(4,69); //front
 //            sendData(4,71); //front
             wait(0.05);
             sendData(6,11); //middle
@@ -131,14 +131,14 @@
             stateR = 69;
             stateL = 69;
 #else       
-            sendData(4,68); //over
-//            sendData(5,69); //over
+//            sendData(4,68); //over
+            sendData(4,69); //over
             wait(0.05);
-            sendData(5,71); //front
+            sendData(5,70); //front
 //            sendData(4,71); //front
             wait(0.05);
-            sendData(6,11); //middle
-//            sendData(6,7); //middle
+//            sendData(6,11); //middle
+            sendData(6,12); //middle
             stateR = 69;
             stateL = 69;
 #endif
@@ -171,13 +171,13 @@
             sendData(1,8);
         }
     }*/
-    /*if(a2){
+    if(b==7){
         skip = 1;
     }
-    else if(!a2){
+    else{
         skip = 0;
-    }*/
-    skip=0;
+    }
+//    skip=0;
     if(b!=1) edge1=1;
     if(b!=2) edge2=1;
     if(b!=3) edge3=1;
--- a/main_ps3.cpp	Wed Nov 18 04:24:35 2015 +0000
+++ b/main_ps3.cpp	Thu Nov 19 07:25:27 2015 +0000
@@ -64,7 +64,7 @@
 //                targ_sita=0.0;
                 targ_sita=-0.03;
             }
-            if((step==3)&&(x<1700.0)) {
+            if((step==3)&&(x<1800.0)) {
                 targ_sita=PI/4;
                 step=4;
             }
@@ -105,15 +105,15 @@
                 CStep=7;
             }*/
             /////////////////////////////////////////
-            if((x<7800.0)&&(CStep==5)) {
+            if((x<7830.0)&&(CStep==5)) {
                 if(!skip) sendData(1,6); //front
                 CStep=6;
             }
-            if((x<6670.0)&&(CStep==6)) {
+            if((x<6710.0)&&(CStep==6)) {
                 if(!skip) sendData(1,5); //middle
                 CStep=7;
             }
-            if((x<5470.0)&&(CStep==7)) {
+            if((x<5500.0)&&(CStep==7)) {
                 if(!skip) sendData(1,4); //over
                 CStep=8;
             }
@@ -143,7 +143,7 @@
 //                targ_sita=0.0;
                 targ_sita=-0.03;
             }
-            if((step==13)&&(x<1450.0)) {
+            if((step==13)&&(x<1400.0)) {
                 targ_sita=PI/4;
                 step=14;
             }
@@ -153,15 +153,15 @@
             }
             
             //Cylinderd
-            if((x>3200.0)&&(CStep==10)) {
+            if((x>3230.0)&&(CStep==10)) {
                 if(!skip) sendData(1,1);
                 CStep=11; 
             }
-            if((x>6050.0)&&(CStep==11)) {
+            if((x>6100.0)&&(CStep==11)) {
                 if(!skip) sendData(1,2);
                 CStep=12;
             }
-            if((x>7700.0)&&(CStep==12)) {
+            if((x>7750.0)&&(CStep==12)) {
                 if(!skip) sendData(1,3);
                 CStep=13;
             }
@@ -170,16 +170,16 @@
                 CStep=14;
             }
             if((x>9900.0)&&(CStep==14)) CStep=15;
-            if((x<9500.0)&&(CStep==15)) { //7.8
+//            if((x<9500.0)&&(CStep==15)) { //7.8
+            if((x<9600.0)&&(CStep==15)) { //7.8
                 if(!skip) sendData(1,4);
                 CStep=16;
             }
-            if((x<7800.0)&&(CStep==16)) { //7.8
-//            if((x<7950.0)&&(CStep==16)) { //7.8
+            if((x<7750.0)&&(CStep==16)) { //7.8
                 if(!skip) sendData(1,5);
                 CStep=17;
             }
-            if((x<5400.0)&&(CStep==17)) { //7.8
+            if((x<5500.0)&&(CStep==17)) { //7.8
 //            if((x<5750.0)&&(CStep==17)) { //7.8
                 if(!skip) sendData(1,6);
                 CStep=18;
@@ -256,7 +256,7 @@
                 if(!skip) sendData(1,4); //front
                 CStep=6;
             }
-            if((x<6830.0)&&(CStep==6)) {
+            if((x<6800.0)&&(CStep==6)) {
                 if(!skip) sendData(1,5); //middle
                 CStep=7;
             }
@@ -342,12 +342,12 @@
             manualIM920();     /*IM920 button*/
 #ifdef BLUE
             /********************************Swing Mode(middle)*********************************/
-            if((mstep==0)&&((10000.0>x)&&(x>1350.0))) {
+            if((mstep==0)&&((10000.0>x)&&(x>1400.0))) {
                 dpcount=speed;
                 mstep=1;
             }
             if((mstep==1)&&((velocity<5.0)&&(velocity>-5.0))){
-                targ_sita=PI/4.0+PI/30.0;
+                targ_sita=PI/4.0+PI/30.0+PI/180.0;
                 swingmoved=2;
                 mstep=251;
             }
@@ -488,7 +488,7 @@
                 mstep=11;
             }
             if((mstep==11)&&((velocity<5.0)&&(velocity>-5.0))){
-                targ_sita=-PI/3.0-PI/10.0+PI/4.0-PI/50.0;
+                targ_sita=-PI/3.0-PI/10.0+PI/4.0-PI/38.0;
                 swingmoved=2;
                 mstep=252;
             }