Prêt pour match 1

This commit is contained in:
Samuel committed 2023-05-17 23:35:11 +02:00
1 parent 49778b85e6
commit c2d12305d9
3 files changed
+11 -9

No files matched your search

+3 -2
View File
@@ -50,6 +50,7 @@ int main() {
uint32_t temps_ms = 0, temps_ms_old;
uint32_t temps_us_debut_cycle;
uint32_t score=0;
uint32_t match_en_cours=1;
stdio_init_all();
@@ -119,7 +120,7 @@ int main() {
Balise_VL53L1X_gestion();
if(temps_ms != Temps_get_temps_ms()){
if(temps_ms != Temps_get_temps_ms() && match_en_cours){
timer_match_ms = (time_us_32() - timer_match_init) / 1000;
temps_ms = Temps_get_temps_ms();
QEI_update();
@@ -179,7 +180,7 @@ int main() {
case MATCH_TERMINEE:
Moteur_Stop();
while(1);
match_en_cours = 0;
break;
}
}
+7 -6
View File
@@ -86,8 +86,8 @@ void Strategie(enum couleur_t couleur, uint32_t step_ms, uint32_t temps_ms){
if(couleur == COULEUR_BLEU){
Localisation_set(225., 3000 - PETIT_RAYON_ROBOT_MM, (120.+CORR_ANGLE_DEPART_DEGREE) * DEGRE_EN_RADIAN);
struct objectif_t objectif_1 = { .priorite = 10, .etat = FAIT, .cible = CERISE_BAS};
struct objectif_t objectif_2 = { .priorite = 2, .etat = A_FAIRE, .cible = CERISE_HAUT};
struct objectif_t objectif_3 = { .priorite = 1, .etat = A_FAIRE, .cible = CERISE_GAUCHE};
struct objectif_t objectif_2 = { .priorite = 1, .etat = A_FAIRE, .cible = CERISE_HAUT};
struct objectif_t objectif_3 = { .priorite = 2, .etat = FAIT, .cible = CERISE_GAUCHE};
struct objectif_t objectif_4 = { .priorite = 5, .etat = FAIT, .cible = CERISE_DROITE};
objectifs[0]= objectif_1;
objectifs[1]= objectif_2;
@@ -96,8 +96,8 @@ void Strategie(enum couleur_t couleur, uint32_t step_ms, uint32_t temps_ms){
}else{
Localisation_set(2000 - 225., 3000 - PETIT_RAYON_ROBOT_MM, (120.+CORR_ANGLE_DEPART_DEGREE) * DEGRE_EN_RADIAN);
struct objectif_t objectif_1 = { .priorite = 10, .etat = FAIT, .cible = CERISE_BAS};
struct objectif_t objectif_2 = { .priorite = 2, .etat = A_FAIRE, .cible = CERISE_HAUT};
struct objectif_t objectif_3 = { .priorite = 1, .etat = A_FAIRE, .cible = CERISE_DROITE};
struct objectif_t objectif_2 = { .priorite = 1, .etat = A_FAIRE, .cible = CERISE_HAUT};
struct objectif_t objectif_3 = { .priorite = 2, .etat = FAIT, .cible = CERISE_DROITE};
struct objectif_t objectif_4 = { .priorite = 5, .etat = FAIT, .cible = CERISE_GAUCHE};
objectifs[0]= objectif_1;
objectifs[1]= objectif_2;
@@ -711,7 +711,7 @@ int temporisation_terminee(uint32_t * tempo_ms, uint32_t step_ms){
}
/// @brief Gère le chargement des balles au début du match
void Strategie_preparation(){
enum etat_action_t Strategie_preparation(){
static enum{
PREP_INIT_V,
@@ -749,7 +749,8 @@ void Strategie_preparation(){
break;
case PREP_TEMPO:
break;
return ACTION_TERMINEE;
}
return ACTION_EN_COURS;
}
+1 -1
View File
@@ -68,7 +68,7 @@ int temporisation_terminee(uint32_t * tempo_ms, uint32_t step_ms);
enum etat_action_t Strategie_aller_panier(enum couleur_t couleur, uint32_t step_ms);
enum etat_action_t Strategie_parcourir_trajet(struct trajectoire_t trajectoire, uint32_t step_ms, enum evitement_t evitement);
int Robot_est_dans_zone_depose(enum couleur_t couleur);
void Strategie_preparation(void);
enum etat_action_t Strategie_preparation();
extern float distance_obstacle;