2015_robocon_bteam / Mbed 2 deprecated 2015robot_main

Dependencies:   PID QEI mbed

Fork of 2015robot_main by Naoto Deguchi

Revision:
63:dad3f4e5e99c
Parent:
61:e018207ae860
Child:
64:a98fe602c26d
--- a/autoMode.h	Sun Oct 04 07:18:36 2015 +0000
+++ b/autoMode.h	Sun Oct 04 07:25:49 2015 +0000
@@ -208,8 +208,17 @@
 {
     velocity_following();
     sita_following();
-    Vr                  = ( x1 + x2 ) / 2.0;
-    Vl                  = ( x1 - x2 ) / 2.0;
+//    Vr                  = ( x1 + x2 ) / 2.0;
+//    Vl                  = ( x1 - x2 ) / 2.0;
+    if(x2>0){
+        Vr                  = x1;
+        Vl                  = x1 - x2;
+    }
+    else{
+        Vr                  = x1 + x2;
+        Vl                  = x1;
+    }
+    
     if( abs(Vr) < 0.05 ) Vr = 0.0;
     if( abs(Vl) < 0.05 ) Vl = 0.0;
     Move_r( ( float ) Vr );