Alexandre Pirotte
/
0concours_cachan_programme_ok
ok
Fork of _test_suivi_mur by
fct.h@7:2f4660e9cf92, 2017-06-23 (annotated)
- Committer:
- pirottealex
- Date:
- Fri Jun 23 11:19:58 2017 +0000
- Revision:
- 7:2f4660e9cf92
- Parent:
- 6:5f7df5c74a77
pixy_ok2;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vermaelen | 2:82b72fa8dbcd | 1 | #ifndef FCT_H |
vermaelen | 2:82b72fa8dbcd | 2 | #define FCT_H |
vermaelen | 2:82b72fa8dbcd | 3 | //GLOBALES |
vermaelen | 2:82b72fa8dbcd | 4 | extern BusOut leds; |
vermaelen | 2:82b72fa8dbcd | 5 | extern DigitalOut trigger1; |
vermaelen | 2:82b72fa8dbcd | 6 | extern DigitalOut trigger2; |
vermaelen | 2:82b72fa8dbcd | 7 | extern DigitalOut trigger3; |
vermaelen | 2:82b72fa8dbcd | 8 | extern InterruptIn echo; |
vermaelen | 2:82b72fa8dbcd | 9 | extern AnalogIn AnaG; |
vermaelen | 2:82b72fa8dbcd | 10 | extern AnalogIn AnaAV; |
vermaelen | 2:82b72fa8dbcd | 11 | extern PwmOut MG; //vitesse moteur gauche |
vermaelen | 2:82b72fa8dbcd | 12 | extern PwmOut MD; //vitesse moteur droit |
vermaelen | 2:82b72fa8dbcd | 13 | extern DigitalOut sensMG; // sens moteur gauche |
vermaelen | 2:82b72fa8dbcd | 14 | extern DigitalOut sensMD; // sens moteur droit |
pirottealex | 7:2f4660e9cf92 | 15 | extern PwmOut servo; |
pirottealex | 7:2f4660e9cf92 | 16 | extern Timer temp,t,t2,tr,tb,to; |
vermaelen | 2:82b72fa8dbcd | 17 | extern Ticker tic1,tic2; |
pirottealex | 7:2f4660e9cf92 | 18 | extern DigitalIn jack, capb1,capb2; |
pirottealex | 7:2f4660e9cf92 | 19 | extern float capt_m,capt_d,capt_g,capt_ed,capt_eg,cap_lum,cap,tot_capt,pixy_cap,erreur_cap; |
pirottealex | 7:2f4660e9cf92 | 20 | extern int drap,flag1,flag2,flag3,flag4,flag5,start_memo_pixy; |
vermaelen | 3:b91371837109 | 21 | extern float US1,US2,US3,AN1,AN2,US1_av,US2_av,US3_av,AN1_av,AN2_av; |
vermaelen | 3:b91371837109 | 22 | extern float E_av,E,iE,E0,E1,E2,E3; |
pirottealex | 7:2f4660e9cf92 | 23 | extern float cmdG,cmdD,turn; |
vermaelen | 2:82b72fa8dbcd | 24 | extern int etat; |
pirottealex | 7:2f4660e9cf92 | 25 | extern float iecart,ecart_av,ecart,taille,turn; |
pirottealex | 7:2f4660e9cf92 | 26 | extern int j,capg,capd; |
pirottealex | 7:2f4660e9cf92 | 27 | extern int errorX , errorY,jck ; |
pirottealex | 7:2f4660e9cf92 | 28 | extern uint16_t blocks; |
vermaelen | 2:82b72fa8dbcd | 29 | |
vermaelen | 2:82b72fa8dbcd | 30 | |
vermaelen | 2:82b72fa8dbcd | 31 | //CONSTANTES |
vermaelen | 2:82b72fa8dbcd | 32 | #define PERIOD 0.0001 |
vermaelen | 6:5f7df5c74a77 | 33 | #define VMOY 45 |
pirottealex | 7:2f4660e9cf92 | 34 | #define VMAX 50 |
vermaelen | 4:78a9354fcee8 | 35 | #define Kp_dist 0.2 |
vermaelen | 5:3746060957fb | 36 | #define Kp_ecart 0.22 |
vermaelen | 2:82b72fa8dbcd | 37 | #define Td_ecart 0.0 |
vermaelen | 2:82b72fa8dbcd | 38 | #define Ti_ecart 1000.0 |
vermaelen | 2:82b72fa8dbcd | 39 | #define limitmin 3 |
vermaelen | 2:82b72fa8dbcd | 40 | #define limitmax 150 |
vermaelen | 2:82b72fa8dbcd | 41 | #define Te 0.001 |
vermaelen | 2:82b72fa8dbcd | 42 | #define Ti 2.0 |
pirottealex | 7:2f4660e9cf92 | 43 | #define a 59.6 |
vermaelen | 2:82b72fa8dbcd | 44 | #define b 0.1 |
pirottealex | 7:2f4660e9cf92 | 45 | #define seuil_taille 1800 //seuil auquel le robot arrete d'avancer |
pirottealex | 7:2f4660e9cf92 | 46 | #define K 0.1// coef erreur pour asservissement |
pirottealex | 7:2f4660e9cf92 | 47 | #define V 30 |
pirottealex | 7:2f4660e9cf92 | 48 | #define V_max 50 |
pirottealex | 7:2f4660e9cf92 | 49 | #define V_moy 35 |
pirottealex | 7:2f4660e9cf92 | 50 | #define lent 20 |
pirottealex | 7:2f4660e9cf92 | 51 | #define gainUS 0.60 |
pirottealex | 7:2f4660e9cf92 | 52 | #define gainUSM 0.40 |
pirottealex | 7:2f4660e9cf92 | 53 | #define PERIOD 0.0001 |
pirottealex | 7:2f4660e9cf92 | 54 | #define capt_max 120 |
pirottealex | 7:2f4660e9cf92 | 55 | #define capt_min 20 |
pirottealex | 7:2f4660e9cf92 | 56 | #define Kdist 1.4 |
pirottealex | 7:2f4660e9cf92 | 57 | #define Kcap 0.5 |
pirottealex | 7:2f4660e9cf92 | 58 | #define Dist_limit 90 |
pirottealex | 7:2f4660e9cf92 | 59 | #define periode 0.02 |
pirottealex | 7:2f4660e9cf92 | 60 | |
vermaelen | 2:82b72fa8dbcd | 61 | //PROTOTYPES |
vermaelen | 3:b91371837109 | 62 | void contournement(); |
vermaelen | 2:82b72fa8dbcd | 63 | void stopMotor(); |
vermaelen | 2:82b72fa8dbcd | 64 | void suivi_mur(); |
vermaelen | 2:82b72fa8dbcd | 65 | void rotation_horaire(); |
vermaelen | 2:82b72fa8dbcd | 66 | void init(); |
vermaelen | 2:82b72fa8dbcd | 67 | void asservissement(); |
vermaelen | 2:82b72fa8dbcd | 68 | void fcttrig(); |
vermaelen | 2:82b72fa8dbcd | 69 | void start(); |
vermaelen | 2:82b72fa8dbcd | 70 | void stop(); |
pirottealex | 7:2f4660e9cf92 | 71 | void vitesse(float, float); |
vermaelen | 2:82b72fa8dbcd | 72 | void mesAN(); |
pirottealex | 7:2f4660e9cf92 | 73 | void servo_start(void); |
pirottealex | 7:2f4660e9cf92 | 74 | void servo_stop(void); |
vermaelen | 2:82b72fa8dbcd | 75 | |
pirottealex | 7:2f4660e9cf92 | 76 | #endif |