2023-03-26 19:28:13 +00:00
|
|
|
#include "pico/stdlib.h"
|
2023-04-01 08:40:30 +00:00
|
|
|
#include "Trajectoire.h"
|
2023-03-26 19:28:13 +00:00
|
|
|
|
|
|
|
#ifndef STRATEGIE_H
|
|
|
|
#define STRATEGIE_H
|
|
|
|
|
2023-03-28 21:03:35 +00:00
|
|
|
#define COULEUR 15
|
|
|
|
#define TIRETTE 14
|
2023-04-13 17:43:35 +00:00
|
|
|
#define CORR_ANGLE_DEPART_DEGREE (-1.145)
|
2023-03-28 21:03:35 +00:00
|
|
|
|
2023-03-03 18:50:44 +00:00
|
|
|
enum etat_action_t{
|
|
|
|
ACTION_EN_COURS,
|
|
|
|
ACTION_TERMINEE
|
2023-03-18 16:59:15 +00:00
|
|
|
};
|
|
|
|
|
2023-03-26 14:34:06 +00:00
|
|
|
enum longer_direction_t{
|
|
|
|
LONGER_VERS_A,
|
|
|
|
LONGER_VERS_C
|
|
|
|
};
|
|
|
|
|
2023-03-28 21:03:35 +00:00
|
|
|
enum couleur_t{
|
|
|
|
COULEUR_BLEU=0,
|
|
|
|
COULEUR_VERT
|
|
|
|
};
|
|
|
|
|
|
|
|
extern enum etat_strategie_t{
|
2023-04-01 13:29:54 +00:00
|
|
|
STRATEGIE_INIT,
|
|
|
|
ATTENTE_TIRETTE,
|
|
|
|
APPROCHE_CERISE_1_A,
|
|
|
|
APPROCHE_CERISE_1_B,
|
|
|
|
ATTRAPE_CERISE_1,
|
|
|
|
APPROCHE_PANIER_1,
|
|
|
|
APPROCHE_PANIER_2,
|
|
|
|
CALAGE_PANIER_1,
|
|
|
|
RECULE_PANIER,
|
|
|
|
TOURNE_PANIER,
|
|
|
|
LANCE_DANS_PANIER,
|
2023-04-01 14:44:08 +00:00
|
|
|
APPROCHE_CERISE_2,
|
|
|
|
ATTRAPPE_CERISE_2,
|
|
|
|
APPROCHE_PANIER_3,
|
2023-04-01 13:29:54 +00:00
|
|
|
STRATEGIE_FIN,
|
2023-04-01 14:44:08 +00:00
|
|
|
|
2023-03-28 21:03:35 +00:00
|
|
|
}etat_strategie;
|
|
|
|
|
2023-03-26 14:34:06 +00:00
|
|
|
enum etat_action_t cerise_accostage(void);
|
2023-03-28 21:03:35 +00:00
|
|
|
enum etat_action_t avance_puis_longe_bordure(enum longer_direction_t longer_direction);
|
2023-04-01 08:40:30 +00:00
|
|
|
enum etat_action_t parcourt_trajet_simple(struct trajectoire_t trajectoire, uint32_t step_ms);
|
2023-04-01 14:44:08 +00:00
|
|
|
enum etat_action_t parcourt_trajet_simple_sans_evitement(struct trajectoire_t trajectoire, uint32_t step_ms);
|
|
|
|
enum etat_action_t depose_cerises(uint32_t step_ms);
|
2023-03-26 19:28:13 +00:00
|
|
|
void Homologation(uint32_t step_ms);
|
2023-03-28 21:03:35 +00:00
|
|
|
enum couleur_t lire_couleur(void);
|
|
|
|
uint attente_tirette(void);
|
2023-04-13 17:43:35 +00:00
|
|
|
enum etat_action_t lance_balles(uint32_t step_ms);
|
|
|
|
int test_panier(void);
|
|
|
|
|
|
|
|
int temporisation_terminee(uint32_t * tempo_ms, uint32_t step_ms);
|
2023-03-28 21:03:35 +00:00
|
|
|
|
|
|
|
|
2023-03-26 19:28:13 +00:00
|
|
|
|
|
|
|
// STRATEGIE_H
|
|
|
|
#endif
|