2015_robocon_bteam / Mbed 2 deprecated 2015robot_main_zenkoku

Dependencies:   PID QEI mbed

Revision:
30:cd344beb415d
Parent:
26:760f1bce8214
Child:
32:b8c8ad2eeca7
--- a/machine_ps3.h	Tue Nov 10 07:46:00 2015 +0000
+++ b/machine_ps3.h	Tue Nov 10 09:42:33 2015 +0000
@@ -162,17 +162,29 @@
 }
 
 /***The function reset state.***/
-void resetState(){
+void resetState(short d){
 #ifdef BLUE
     x=0.0;
     y=0.0;
-    sita=PI/4.0;
-    targ_sita=PI/4.0;
+    if(d){
+        sita=PI/4.0;
+        targ_sita=PI/4.0;
+    }
+    else{
+        sita=-PI/4.0;
+        targ_sita=-PI/4.0;
+    }
 #else
     x=0.0;
     y=0.0;
-    sita=-PI/4.0;
-    targ_sita=-PI/4.0;
+    if(d){
+        sita=-PI/4.0;
+        targ_sita=-PI/4.0;
+    }
+    else{
+        sita=PI/4.0;
+        targ_sita=PI/4.0;
+    }
 #endif
     targ_velocity=0.0;
     Move_r_sense.reset();
@@ -181,4 +193,4 @@
     direction_controller.reset();
 }
 
-#endif /*machine.h*/
+#endif /*machine.h*/
\ No newline at end of file