Hlimi Omar
/
biniou
TRR2018 omar
Fork of biniou by
stateMachines.cpp@3:03ea98f5b2e4, 2018-08-23 (annotated)
- Committer:
- GaspardD
- Date:
- Thu Aug 23 12:35:06 2018 +0000
- Revision:
- 3:03ea98f5b2e4
- Parent:
- 2:fd0ffe46a87d
- Child:
- 8:1d8c3ca5e508
Suppression de la gestion/suivi ligne
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GaspardD | 2:fd0ffe46a87d | 1 | #include <stdint.h> |
GaspardD | 2:fd0ffe46a87d | 2 | |
GaspardD | 3:03ea98f5b2e4 | 3 | #define MODE_SUIVI_MUR_DROIT 1 |
GaspardD | 3:03ea98f5b2e4 | 4 | #define MODE_SUIVI_MUR_GAUCHE 2 |
GaspardD | 2:fd0ffe46a87d | 5 | #define MODE_COURSE 4 |
GaspardD | 2:fd0ffe46a87d | 6 | |
GaspardD | 2:fd0ffe46a87d | 7 | #define DRIFT_ENABLED 1 |
GaspardD | 2:fd0ffe46a87d | 8 | #define DRIFT_OFF 1 |
GaspardD | 2:fd0ffe46a87d | 9 | |
GaspardD | 2:fd0ffe46a87d | 10 | #define NB_ECHANTILLONS_IR 3 |
GaspardD | 2:fd0ffe46a87d | 11 | #define NB_ECHANTILLONS_US 3 |
GaspardD | 2:fd0ffe46a87d | 12 | #define NB_CAPTEURS_VECTORISATION 3 |
GaspardD | 2:fd0ffe46a87d | 13 | |
GaspardD | 2:fd0ffe46a87d | 14 | static int mode_courant = MODE_COURSE; // mettre en define pour la compilation ? ou régler via télécommande ? |
GaspardD | 2:fd0ffe46a87d | 15 | |
GaspardD | 3:03ea98f5b2e4 | 16 | int fifo_dists_ir[NB_CAPTEURS_VECTORISATION][NB_ECHANTILLONS_IR];//buffer tournant des mesures sur lesquelles ont fait une moyenne |
GaspardD | 2:fd0ffe46a87d | 17 | int dist_obstacle_us[NB_ECHANTILLONS_US];//buffer tournant |
GaspardD | 2:fd0ffe46a87d | 18 | int index_fifo_ir = 0;//pour géreer le buffer tournant |
GaspardD | 2:fd0ffe46a87d | 19 | int index_fifo_us = 0; |
GaspardD | 2:fd0ffe46a87d | 20 | int position = 0; |
GaspardD | 2:fd0ffe46a87d | 21 | int vitesse = 0; |
GaspardD | 2:fd0ffe46a87d | 22 | |
GaspardD | 2:fd0ffe46a87d | 23 | //change en mode course uniquement 1 réglage de PID par SECTION |
GaspardD | 2:fd0ffe46a87d | 24 | typedef enum{ |
GaspardD | 2:fd0ffe46a87d | 25 | ARRET, |
GaspardD | 2:fd0ffe46a87d | 26 | LIGNE_DROITE,//PID ligne |
GaspardD | 2:fd0ffe46a87d | 27 | CHICANE_D,//PID murs |
GaspardD | 2:fd0ffe46a87d | 28 | CHICANE_G, |
GaspardD | 2:fd0ffe46a87d | 29 | EPINGLE_D,//PID epingle |
GaspardD | 2:fd0ffe46a87d | 30 | EPINGLE_G, |
GaspardD | 2:fd0ffe46a87d | 31 | ARRIVEE |
GaspardD | 2:fd0ffe46a87d | 32 | }SECTION_ST; |
GaspardD | 2:fd0ffe46a87d | 33 | |
GaspardD | 2:fd0ffe46a87d | 34 | |
GaspardD | 2:fd0ffe46a87d | 35 | typedef eneum |
GaspardD | 2:fd0ffe46a87d | 36 | { |
GaspardD | 2:fd0ffe46a87d | 37 | MURS_ABSENTS, |
GaspardD | 2:fd0ffe46a87d | 38 | MUR_G_OK, |
GaspardD | 2:fd0ffe46a87d | 39 | MUR_D_OK, |
GaspardD | 2:fd0ffe46a87d | 40 | MUR_GD_OK |
GaspardD | 2:fd0ffe46a87d | 41 | }MUR_ST |
GaspardD | 2:fd0ffe46a87d | 42 | |
GaspardD | 2:fd0ffe46a87d | 43 | typedef eneum |
GaspardD | 2:fd0ffe46a87d | 44 | { |
GaspardD | 2:fd0ffe46a87d | 45 | RISQUE_COLLISION, |
GaspardD | 2:fd0ffe46a87d | 46 | EVITEMENT_D, |
GaspardD | 2:fd0ffe46a87d | 47 | EVITEMENT_G, |
GaspardD | 2:fd0ffe46a87d | 48 | FREINAGE_URG, |
GaspardD | 2:fd0ffe46a87d | 49 | CLEAR |
GaspardD | 2:fd0ffe46a87d | 50 | }OBSTACLE_ST |
GaspardD | 2:fd0ffe46a87d | 51 | |
GaspardD | 2:fd0ffe46a87d | 52 | void murs_init(); |
GaspardD | 2:fd0ffe46a87d | 53 | void murs_update(); |
GaspardD | 2:fd0ffe46a87d | 54 | void murs_output(); |
GaspardD | 2:fd0ffe46a87d | 55 | |
GaspardD | 2:fd0ffe46a87d | 56 | void obstacle_init(); |
GaspardD | 2:fd0ffe46a87d | 57 | void obstacle_update(); |
GaspardD | 2:fd0ffe46a87d | 58 | void obstacle_output(); |
GaspardD | 2:fd0ffe46a87d | 59 | |
GaspardD | 2:fd0ffe46a87d | 60 | void section_init(); |
GaspardD | 2:fd0ffe46a87d | 61 | void section_update(); |
GaspardD | 2:fd0ffe46a87d | 62 | void section_output(); |