carte_strategie_2019

Dependencies:   mbed SerialHalfDuplex SDFileSystem DISCO-F469NI_portrait liaison_Bluetooth ident_crac

Revision:
22:a466d08ac42b
Parent:
21:590cdacb6a35
Child:
23:ab87d308eaf9
diff -r 590cdacb6a35 -r a466d08ac42b Strategie/Strategie.cpp
--- a/Strategie/Strategie.cpp	Thu May 25 06:34:53 2017 +0000
+++ b/Strategie/Strategie.cpp	Thu May 25 14:40:49 2017 +0000
@@ -244,7 +244,13 @@
             SetOdometrie(ODOMETRIE_BIG_POSITION, POSITION_DEBUT_X,localData3,localData2);
 #endif 
 #ifdef ROBOT_SMALL
-            SetOdometrie(ODOMETRIE_SMALL_POSITION, POSITION_DEBUT_X,POSITION_DEBUT_Y,POSITION_DEBUT_T);
+            localData2 = POSITION_DEBUT_T;
+            localData3 = POSITION_DEBUT_Y;
+            if(InversStrat == 1) {
+                localData2 = -localData2;//Inversion theta
+                localData3 = 3000 - POSITION_DEBUT_Y;//Inversion du Y
+            }
+            SetOdometrie(ODOMETRIE_SMALL_POSITION, POSITION_DEBUT_X,localData3,localData2);
 #endif
         break;
         case ETAT_GAME_WAIT_FOR_JACK:
@@ -338,17 +344,16 @@
                     } else {//C'est un rotation absolu, il faut la convertir en relative
                         localData2 = instruction.arg3;
                         
-                        if(InversStrat == 1) {
-                            localData2 = -localData2;
-                        }
-                        
                         localData2 = (localData2 - theta_robot)%3600;
                         if(localData2 > 1800) {
                             localData2 = localData2-3600;
                         }
                         
                     }
-                    
+                   
+                    if(InversStrat == 1) {
+                            localData2 = -localData2;
+                        }
                     Rotate(localData2);
                     waitingAckID = ASSERVISSEMENT_ROTATION;
                     waitingAckFrom = ACKNOWLEDGE_MOTEUR;