Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 10:c8d93dc5993c
- Parent:
- 9:a15fc52284ff
- Child:
- 11:e227edfced99
diff -r a15fc52284ff -r c8d93dc5993c main.cpp --- a/main.cpp Wed Jun 05 10:30:39 2019 +0000 +++ b/main.cpp Wed Jun 05 12:29:09 2019 +0000 @@ -34,6 +34,7 @@ direction[1] = 1; float avg_x, avg_y, sum_inv_dist; //list_lidar[180] = 50; // [mm], point fictif qui pousse la voiture + //Définition des points fictifs poussant la voiture int liste_fictifs[360]; for (int i=0; i<360; i++){ liste_fictifs[i] = 0; @@ -51,16 +52,19 @@ int theta; float r, x, y; theta = i; - if (liste_fictifs[theta] == 1){ - r = 50; + if (liste_fictifs[360-theta] == 1){ + //pc.printf("Angle,%i\n\r",theta); + r = 0.01; } else{ + //pc.printf("Angle,%i\n\r",theta); + //r = 0; //test r = list_lidar[360-theta]; + //pc.printf("r,%f\n\r",r); } - //theta = 360 - theta; //pc.printf("Salut 1\n\r"); //pc.printf("%f\n\r",r); - //if (r == 0 && theta != 180) break; // non calcul en cas de distance nul (donnée non captée) + if (r == 0) break; // non calcul en cas de distance nul (donnée non captée) //pc.printf("Salut 2\n\r"); //x = 0; //y = 0; @@ -161,7 +165,7 @@ while (1){ //printf("pwm_moteur = %f, pwm_direction = %f", pwm_moteur, pwm_direction); if(1){ - //afficher_lidar(tableau_distance); + afficher_lidar(tableau_distance); affiche_lidar = 0;