Programme carte strategie (disco)

Dependencies:   mbed SerialHalfDuplex SDFileSystem DISCO-F469NI_portrait liaison_Bluetooth ident_crac

Revision:
53:e96acb11a51f
Parent:
52:a47350923b5e
Child:
54:8996a5b18d9b
--- a/Strategie/Strategie.cpp	Tue May 21 14:38:09 2019 +0000
+++ b/Strategie/Strategie.cpp	Wed May 22 09:52:00 2019 +0000
@@ -1718,9 +1718,13 @@
             char message1[10]="toto";
             char message2[10]="toto";
             char message3[10]="toto";
-
+            /*
             static short x_terrain=3000;
             static short y_terrain=1500;
+            */
+            
+            static short y_terrain=3000;
+            static short x_terrain=1500;
 
             static float x_cote_droit[3]= {0};
             static float y_cote_droit[3]= {0};
@@ -1730,9 +1734,9 @@
             static short cote=0;
 //--------------------------
             static float dist_robot_adversaire=650;//distance à laquelle on s'arrete grace à la balise
-            int proxy=300;//distance entre point de controle et obstacle/adversaire
+            int proxy=400;//distance entre point de controle et obstacle/adversaire
             int proximity=300;//distance entre l'objectif et obstacle/adversaire
-            short taille_petit=200;// distance proxymité max mur
+            short taille_petit=150;// distance proxymité max mur
 //---------------------------*
             static unsigned short distance=50000;//valeur impossible
             static unsigned short distance_prev=50000;
@@ -1838,23 +1842,23 @@
                     x_cote_gauche[2] = x_robot_adversaire + (proxy)*cos((float)(theta_adversaire+ang_target-500)*M_PI/1800);
                     y_cote_gauche[2] = y_robot_adversaire + (proxy)*sin((float)(theta_adversaire+ang_target-500)*M_PI/1800);
 */
-                    float x_robot_adversaire = x_robot + (dist_robot_adversaire)*sin((float)(theta_adversaire)* M_PI/1800);
-                    float y_robot_adversaire = y_robot + (dist_robot_adversaire)*cos((float)(theta_adversaire)*M_PI/1800);
+                    float x_robot_adversaire = x_robot + (dist_robot_adversaire)*cos((float)(theta_adversaire)* M_PI/1800);
+                    float y_robot_adversaire = y_robot + (dist_robot_adversaire)*sin((float)(theta_adversaire)*M_PI/1800);
                     
-                    x_cote_droit[0] = x_robot_adversaire + (proxy)*sin((float)(theta_adversaire+ang_target+1300)*M_PI/1800);
-                    y_cote_droit[0] = y_robot_adversaire + (proxy)*cos((float)(theta_adversaire+ang_target+1300)*M_PI/1800);
-                    x_cote_gauche[0] = x_robot_adversaire + (proxy)*sin((float)(theta_adversaire+ang_target-1300)*M_PI/1800);
-                    y_cote_gauche[0] = y_robot_adversaire + (proxy)*cos((float)(theta_adversaire+ang_target-1300)*M_PI/1800);
-
-                    x_cote_droit[1] = x_robot_adversaire + (proxy)*sin((float)(theta_adversaire+ang_target+900)*M_PI/1800);
-                    y_cote_droit[1] = y_robot_adversaire + (proxy)*cos((float)(theta_adversaire+ang_target+900)*M_PI/1800);
-                    x_cote_gauche[1] = x_robot_adversaire + (proxy)*sin((float)(theta_adversaire+ang_target-900)*M_PI/1800);
-                    y_cote_gauche[1] = y_robot_adversaire + (proxy)*cos((float)(theta_adversaire+ang_target-900)*M_PI/1800);
-
-                    x_cote_droit[2] = x_robot_adversaire  + (proxy)*sin((float)(theta_adversaire+ang_target+500)*M_PI/1800);
-                    y_cote_droit[2] = y_robot_adversaire  + (proxy)*cos((float)(theta_adversaire+ang_target+500)*M_PI/1800);
-                    x_cote_gauche[2] = x_robot_adversaire + (proxy)*sin((float)(theta_adversaire+ang_target-500)*M_PI/1800);
-                    y_cote_gauche[2] = y_robot_adversaire + (proxy)*cos((float)(theta_adversaire+ang_target-500)*M_PI/1800);
+                    x_cote_droit[0] = x_robot_adversaire + (proxy)*cos((float)(theta_adversaire+ang_target-1300)*M_PI/1800);
+                    y_cote_droit[0] = y_robot_adversaire + (proxy)*sin((float)(theta_adversaire+ang_target-1300)*M_PI/1800);
+                    x_cote_gauche[0] = x_robot_adversaire + (proxy)*cos((float)(theta_adversaire+ang_target+1300)*M_PI/1800);
+                    y_cote_gauche[0] = y_robot_adversaire + (proxy)*sin((float)(theta_adversaire+ang_target+1300)*M_PI/1800);
+
+                    x_cote_droit[1] = x_robot_adversaire + (proxy)*cos((float)(theta_adversaire+ang_target-900)*M_PI/1800);
+                    y_cote_droit[1] = y_robot_adversaire + (proxy)*sin((float)(theta_adversaire+ang_target-900)*M_PI/1800);
+                    x_cote_gauche[1] = x_robot_adversaire + (proxy)*cos((float)(theta_adversaire+ang_target+900)*M_PI/1800);
+                    y_cote_gauche[1] = y_robot_adversaire + (proxy)*sin((float)(theta_adversaire+ang_target+900)*M_PI/1800);
+
+                    x_cote_droit[2] = x_robot_adversaire  + (proxy)*cos((float)(theta_adversaire+ang_target-500)*M_PI/1800);
+                    y_cote_droit[2] = y_robot_adversaire  + (proxy)*sin((float)(theta_adversaire+ang_target-500)*M_PI/1800);
+                    x_cote_gauche[2] = x_robot_adversaire + (proxy)*cos((float)(theta_adversaire+ang_target+500)*M_PI/1800);
+                    y_cote_gauche[2] = y_robot_adversaire + (proxy)*sin((float)(theta_adversaire+ang_target+500)*M_PI/1800);
 
                     SendRawId(0x0D0);//calcul