trajets pour les robot 1 à 3 + détection de l'adversaire plus souple
This commit is contained in:
parent
d68fa90724
commit
15c58d0db4
@ -3,7 +3,7 @@
|
||||
#include "math.h"
|
||||
|
||||
#define GAIN_P_POSITION 15
|
||||
#define GAIN_P_ORIENTATION 2
|
||||
#define GAIN_P_ORIENTATION 10
|
||||
|
||||
struct position_t position_maintien;
|
||||
|
||||
|
6
Trajet.c
6
Trajet.c
@ -141,16 +141,16 @@ float Trajet_calcul_vitesse(float pas_de_temps_s){
|
||||
vitesse_max_contrainte = 0;
|
||||
}
|
||||
|
||||
/*distance_contrainte_obstacle = Trajet_get_obstacle_mm();
|
||||
distance_contrainte_obstacle = Trajet_get_obstacle_mm();
|
||||
if(distance_contrainte_obstacle != DISTANCE_INVALIDE){
|
||||
vitesse_max_contrainte_obstacle = sqrtf(2 * acceleration_mm_ss_obstacle * distance_contrainte_obstacle);
|
||||
if(vitesse_max_contrainte_obstacle < vitesse_max_contrainte){
|
||||
vitesse_max_contrainte = vitesse_max_contrainte_obstacle;
|
||||
}
|
||||
}*/
|
||||
}/*
|
||||
if((Trajet_get_obstacle_mm() != DISTANCE_INVALIDE) && (Trajet_get_obstacle_mm() < 50)){
|
||||
vitesse = 0;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
// Selection de la vitesse la plus faible
|
||||
|
@ -14,6 +14,8 @@ int masque[64]={
|
||||
195,200,202,206,213,200,200,202
|
||||
};
|
||||
|
||||
float old_min_distance;
|
||||
|
||||
void VL53L8_init(VL53L8CX_Configuration * Dev){
|
||||
uint8_t status, isAlive, isReady, i;
|
||||
|
||||
@ -162,7 +164,12 @@ int VL53L8_min_distance(VL53L8CX_ResultsData Results, float *distance){
|
||||
if(min_distance-50 > 0){
|
||||
*distance = min_distance-50;
|
||||
}
|
||||
old_min_distance = *distance;
|
||||
|
||||
|
||||
}
|
||||
|
||||
float VL53L8_get_old_min_distance(){
|
||||
return old_min_distance;
|
||||
}
|
||||
|
||||
|
28
main.c
28
main.c
@ -82,7 +82,7 @@ void main(void)
|
||||
|
||||
//multicore_launch_core1(gestion_affichage);
|
||||
multicore_launch_core1(gestion_VL53L8CX);
|
||||
sleep_ms(3000);
|
||||
sleep_ms(5000);
|
||||
printf("Demarrage...\n");
|
||||
|
||||
|
||||
@ -113,9 +113,7 @@ void main(void)
|
||||
if(temps_ms % step_ms == 0){
|
||||
QEI_update();
|
||||
Localisation_gestion();
|
||||
if(Trajet_get_obstacle_mm() < 50){
|
||||
Moteur_Stop();
|
||||
}else{
|
||||
|
||||
if(etat_trajet != TRAJET_TERMINE){
|
||||
etat_trajet = Trajet_avance((float)step_ms/1000.);
|
||||
}else{
|
||||
@ -124,7 +122,6 @@ void main(void)
|
||||
AsserMoteur_Gestion(step_ms);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -239,16 +236,19 @@ void configure_trajet(int identifiant, int couleur){
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
Localisation_set(1465, 2000-63, M_PI);
|
||||
Trajectoire_bezier(&trajectoire, 3000-1465, 2000-63, 3000-1260, 2000-63,
|
||||
3000-600, 1400, 3000-0, 2000, M_PI, M_PI);
|
||||
Localisation_set(3000-1249, 2000-63, 0);
|
||||
Trajectoire_bezier(&trajectoire, 3000-1250, 2000-63, 3000-1050, 2000-63,
|
||||
3000-750, 1400, 3000-750, 2100, 0, 0);
|
||||
break;
|
||||
case 2:
|
||||
Localisation_set(3000-1117, 2000-63, 0);
|
||||
Trajectoire_bezier(&trajectoire, 3000-1116, 2000-63, 3000-975, 2000-63,
|
||||
3000-540, 1400, 3000+60, 1400, -M_PI, -M_PI);
|
||||
break;
|
||||
case 3:
|
||||
Localisation_set(3000 - 1130, 2000-63, 0);
|
||||
Localisation_set(1121-1130, 2000-63, 0);
|
||||
Trajectoire_bezier(&trajectoire, 3000-1122, 2000-63, 3000-905, 2000-63,
|
||||
3000-606, 2000-590, 3000-225, 2000-225, 0, 0);
|
||||
3000-606, 2000-590, 3000-225, 2000-225, -M_PI, -M_PI);
|
||||
break;
|
||||
case 4:
|
||||
break;
|
||||
@ -270,9 +270,9 @@ void configure_trajet(int identifiant, int couleur){
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
Localisation_set(1465, 2000-63, M_PI);
|
||||
Trajectoire_bezier(&trajectoire, 1465, 2000-63, 1260, 2000-63,
|
||||
600, 1400, 0, 2000, M_PI, M_PI);
|
||||
Localisation_set(1249, 2000-63, M_PI);
|
||||
Trajectoire_bezier(&trajectoire, 1250, 2000-63, 1050, 2000-63,
|
||||
750, 1400, 750, 2100, M_PI, M_PI);
|
||||
break;
|
||||
case 2:
|
||||
Localisation_set(1117, 2000-63, M_PI);
|
||||
@ -280,7 +280,7 @@ void configure_trajet(int identifiant, int couleur){
|
||||
540, 1400, -60, 1400, M_PI, M_PI);
|
||||
break;
|
||||
case 3:
|
||||
Localisation_set(1130, 2000-63, M_PI);
|
||||
Localisation_set(1121, 2000-63, M_PI);
|
||||
Trajectoire_bezier(&trajectoire, 1122, 2000-63, 905, 2000-63,
|
||||
606, 2000-590, 225, 2000-225, M_PI, M_PI);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user